]> granicus.if.org Git - clang/commitdiff
Let the backend unique these.
authorMike Stump <mrs@apple.com>
Fri, 13 Feb 2009 20:17:16 +0000 (20:17 +0000)
committerMike Stump <mrs@apple.com>
Fri, 13 Feb 2009 20:17:16 +0000 (20:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64486 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBlocks.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h

index 8c7e82e61c0ddd11666bd19b46e3dd66115aa18f..cb9de169d72a30b8c7b88b66bf43bbd341ff976c 100644 (file)
@@ -65,11 +65,9 @@ llvm::Constant *CodeGenFunction::BuildDescriptorBlockDecl() {
 
   C = llvm::ConstantStruct::get(Elts);
 
-  char Name[32];
-  sprintf(Name, "__block_descriptor_tmp_%d", CGM.getDescriptorUniqueCount());
   C = new llvm::GlobalVariable(C->getType(), true,
                                llvm::GlobalValue::InternalLinkage,
-                               C, Name, &CGM.getModule());
+                               C, "__block_descriptor_tmp", &CGM.getModule());
   return C;
 }
 
@@ -126,6 +124,7 @@ llvm::Constant *CodeGenFunction::BuildBlockLiteralTmp() {
     if (BlockHasCopyDispose)
       flags |= BLOCK_HAS_COPY_DISPOSE;
 
+    // __isa
     C = CGM.getNSConcreteStackBlock();
     if (!insideFunction ||
         (!BlockRefDeclList && !BlockByrefDeclList)) {
index 2dbee58a823b6495d866da8c272f11c5c44c0232..091158daba759d61414ee8c1a45936893615aa39 100644 (file)
@@ -52,7 +52,6 @@ CodeGenModule::CodeGenModule(ASTContext &C, const LangOptions &LO,
   DebugInfo = GenerateDebugInfo ? new CGDebugInfo(this) : 0;
 
   Block.GlobalUniqueCount = 0;
-  Block.DescriptorUniqueCount = 0;
 }
 
 CodeGenModule::~CodeGenModule() {
index 020f74cddda6a7a1ef0e03c905a8c6ee398124a6..bd5a20c68ce9fae0f4bd7906fd9976dfd8125189 100644 (file)
@@ -131,7 +131,6 @@ class CodeGenModule {
   const llvm::Type *GenericBlockLiteralType;
   struct {
     int GlobalUniqueCount;
-    int DescriptorUniqueCount;
   } Block;
 
   std::vector<llvm::Function *> BuiltinFunctions;
@@ -148,7 +147,6 @@ public:
   llvm::Constant *getNSConcreteGlobalBlock();
   llvm::Constant *getNSConcreteStackBlock();
   int getGlobalUniqueCount() { return ++Block.GlobalUniqueCount; }
-  int getDescriptorUniqueCount() { return ++Block.DescriptorUniqueCount; }
   const llvm::Type *getBlockDescriptorType();
 
   const llvm::Type *getGenericBlockLiteralType();