]> granicus.if.org Git - clang/commitdiff
For now, we need to have the llvm type of the block pointer remain as
authorMike Stump <mrs@apple.com>
Tue, 20 Oct 2009 20:30:01 +0000 (20:30 +0000)
committerMike Stump <mrs@apple.com>
Tue, 20 Oct 2009 20:30:01 +0000 (20:30 +0000)
it was.  Fixes codegen bug introduced yesterday.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84668 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBlocks.cpp

index 5998493986177f6cf59cd274bdaa846f7151ae19..8e020c80ead86261919c52ce03c56f9e83791341 100644 (file)
@@ -576,7 +576,10 @@ BlockModule::GetAddrOfGlobalBlock(const BlockExpr *BE, const char * n) {
 }
 
 llvm::Value *CodeGenFunction::LoadBlockStruct() {
-  return Builder.CreateLoad(LocalDeclMap[getBlockStructDecl()], "self");
+  llvm::Value *V = Builder.CreateLoad(LocalDeclMap[getBlockStructDecl()],
+                                      "self");
+  // For now, we codegen based upon byte offsets.
+  return Builder.CreateBitCast(V, PtrToInt8Ty);
 }
 
 llvm::Function *