[cfe-commits] r65784 - /cfe/trunk/lib/CodeGen/CGBlocks.cpp
Mike Stump
mrs at apple.com
Sun Mar 1 12:07:53 PST 2009
Author: mrs
Date: Sun Mar 1 14:07:53 2009
New Revision: 65784
URL: http://llvm.org/viewvc/llvm-project?rev=65784&view=rev
Log:
Be sure to mark blocks with no imports as being global.
Modified:
cfe/trunk/lib/CodeGen/CGBlocks.cpp
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=65784&r1=65783&r2=65784&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Sun Mar 1 14:07:53 2009
@@ -223,6 +223,10 @@
Elts.push_back(BuildDescriptorBlockDecl(subBlockSize));
if (subBlockDeclRefDecls.size() == 0) {
+ // Optimize to being a global block.
+ Elts[0] = CGM.getNSConcreteGlobalBlock();
+ Elts[1] = llvm::ConstantInt::get(IntTy, flags|BLOCK_IS_GLOBAL);
+
C = llvm::ConstantStruct::get(Elts);
char Name[32];
More information about the cfe-commits
mailing list