From: Rafael Espindola Date: Fri, 9 May 2014 00:43:37 +0000 (+0000) Subject: Simplify the code a bit by using linkage predicates. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed2fa8cac40773d5226b6586cf78f4a022b2f026;p=clang Simplify the code a bit by using linkage predicates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208382 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 8f5969c919..575884b661 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -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);