]> granicus.if.org Git - clang/commitdiff
Obj-C non fragile ABI: Use GetClassGlobal in one more instance I missed.
authorDaniel Dunbar <daniel@zuster.org>
Sun, 1 Mar 2009 04:51:18 +0000 (04:51 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sun, 1 Mar 2009 04:51:18 +0000 (04:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65762 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCMac.cpp

index fdb739495e8746d8640af894d4089c0de49c0010..71580dd30ab5d1593db38e743774436f0b7b8972 100644 (file)
@@ -4565,18 +4565,7 @@ llvm::Value *CGObjCNonFragileABIMac::EmitMetaClassRef(CGBuilderTy &Builder,
     return Builder.CreateLoad(Entry, false, "tmp");
   
   std::string MetaClassName("\01_OBJC_METACLASS_$_" + ID->getNameAsString());
-  llvm::GlobalVariable *MetaClassGV = 
-    CGM.getModule().getGlobalVariable(MetaClassName);
-  if (!MetaClassGV) {
-    MetaClassGV =
-      new llvm::GlobalVariable(ObjCTypes.ClassnfABITy, false,
-                               llvm::GlobalValue::ExternalLinkage,
-                               0,
-                               MetaClassName,
-                               &CGM.getModule());
-      UsedGlobals.push_back(MetaClassGV);
-  }
-
+  llvm::GlobalVariable *MetaClassGV = GetClassGlobal(MetaClassName);
   Entry = 
     new llvm::GlobalVariable(ObjCTypes.ClassnfABIPtrTy, false,
                              llvm::GlobalValue::InternalLinkage,