Let the backend unique these.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64486 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index 8c7e82e..cb9de16 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -65,11 +65,9 @@
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 @@
if (BlockHasCopyDispose)
flags |= BLOCK_HAS_COPY_DISPOSE;
+ // __isa
C = CGM.getNSConcreteStackBlock();
if (!insideFunction ||
(!BlockRefDeclList && !BlockByrefDeclList)) {
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 2dbee58..091158d 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -52,7 +52,6 @@
DebugInfo = GenerateDebugInfo ? new CGDebugInfo(this) : 0;
Block.GlobalUniqueCount = 0;
- Block.DescriptorUniqueCount = 0;
}
CodeGenModule::~CodeGenModule() {
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h
index 020f74c..bd5a20c 100644
--- a/lib/CodeGen/CodeGenModule.h
+++ b/lib/CodeGen/CodeGenModule.h
@@ -131,7 +131,6 @@
const llvm::Type *GenericBlockLiteralType;
struct {
int GlobalUniqueCount;
- int DescriptorUniqueCount;
} Block;
std::vector<llvm::Function *> BuiltinFunctions;
@@ -148,7 +147,6 @@
llvm::Constant *getNSConcreteGlobalBlock();
llvm::Constant *getNSConcreteStackBlock();
int getGlobalUniqueCount() { return ++Block.GlobalUniqueCount; }
- int getDescriptorUniqueCount() { return ++Block.DescriptorUniqueCount; }
const llvm::Type *getBlockDescriptorType();
const llvm::Type *getGenericBlockLiteralType();