aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index c1436b5ff4..9175d16063 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -19,14 +19,25 @@
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "llvm/Support/CFG.h"
+#include "llvm/Target/TargetData.h"
using namespace clang;
using namespace CodeGen;
CodeGenFunction::CodeGenFunction(CodeGenModule &cgm)
: CGM(cgm), Target(CGM.getContext().Target), DebugInfo(0), SwitchInsn(0),
- CaseRangeBlock(0) {
- LLVMIntTy = ConvertType(getContext().IntTy);
- LLVMPointerWidth = Target.getPointerWidth(0);
+ CaseRangeBlock(0) {
+ LLVMIntTy = ConvertType(getContext().IntTy);
+ LLVMPointerWidth = Target.getPointerWidth(0);
+
+ // FIXME: We need to rearrange the code for copy/dispose so we have this
+ // sooner, so we can calculate offsets correctly.
+ BlockHasCopyDispose = false;
+ if (!BlockHasCopyDispose)
+ BlockOffset = CGM.getTargetData()
+ .getTypeStoreSizeInBits(CGM.getGenericBlockLiteralType()) / 8;
+ else
+ BlockOffset = CGM.getTargetData()
+ .getTypeStoreSizeInBits(CGM.getGenericExtendedBlockLiteralType()) / 8;
}
ASTContext &CodeGenFunction::getContext() const {