Simplify the code a bit by using linkage predicates.

llvm-svn: 208382
This commit is contained in:
Rafael Espindola 2014-05-09 00:43:37 +00:00
parent 33b2d71cb8
commit b32629589d
1 changed files with 4 additions and 4 deletions

View File

@ -2558,7 +2558,7 @@ static void assertPrivateName(const llvm::GlobalValue *GV) {
(void)NameRef;
assert(NameRef[0] == '\01' && (NameRef[1] == 'L' || NameRef[1] == 'l'));
assert(GV->getVisibility() == llvm::GlobalValue::DefaultVisibility);
assert(GV->getLinkage() == llvm::GlobalValue::PrivateLinkage);
assert(GV->hasPrivateLinkage());
}
/*
@ -2642,7 +2642,7 @@ llvm::Constant *CGObjCMac::GetOrEmitProtocol(const ObjCProtocolDecl *PD) {
if (Entry) {
// Already created, update the initializer.
assert(Entry->getLinkage() == llvm::GlobalValue::PrivateLinkage);
assert(Entry->hasPrivateLinkage());
Entry->setInitializer(Init);
} else {
Entry =
@ -6328,7 +6328,7 @@ llvm::Constant *CGObjCNonFragileABIMac::GetOrEmitProtocol(
if (Entry) {
// Already created, update the initializer.
assert(Entry->getLinkage() == llvm::GlobalValue::WeakAnyLinkage);
assert(Entry->hasWeakAnyLinkage());
Entry->setInitializer(Init);
} else {
Entry =
@ -6733,7 +6733,7 @@ llvm::Value *CGObjCNonFragileABIMac::GetClass(CodeGenFunction &CGF,
std::string ClassName(getClassSymbolPrefix() + ID->getNameAsString());
llvm::GlobalVariable *ClassGV = GetClassGlobal(ClassName, true);
(void)ClassGV;
assert(ClassGV->getLinkage() == llvm::GlobalValue::ExternalWeakLinkage);
assert(ClassGV->hasExternalWeakLinkage());
}
return EmitClassRef(CGF, ID);