summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-04-01 19:49:42 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-04-01 19:49:42 +0000
commitc2d561808387ac41e235b463d6187e3328b03a9b (patch)
tree75cc540f8c1a186553670f8ad0090f015e669a4a /clang/lib/CodeGen
parent95af35e2510f5177f85cab6d13036a7cc2d12b5c (diff)
downloadbcm5719-llvm-c2d561808387ac41e235b463d6187e3328b03a9b.tar.gz
bcm5719-llvm-c2d561808387ac41e235b463d6187e3328b03a9b.zip
Fixes a problem where the compiler is reporting the wrong size to the Gnu
runtime on 64-bit architectures. Patch by David Chisnall llvm-svn: 68238
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGObjCGNU.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index f1d43e9d121..fc77c805f42 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -969,8 +969,9 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
Elements.clear();
// Runtime version used for compatibility checking.
Elements.push_back(llvm::ConstantInt::get(LongTy, RuntimeVersion));
- //FIXME: Should be sizeof(ModuleTy)
- Elements.push_back(llvm::ConstantInt::get(LongTy, 16));
+ // sizeof(ModuleTy)
+ llvm::TargetData td = llvm::TargetData::TargetData(&TheModule);
+ Elements.push_back(llvm::ConstantInt::get(LongTy, td.getTypeSizeInBits(ModuleTy)/8));
//FIXME: Should be the path to the file where this module was declared
Elements.push_back(NULLPtr);
Elements.push_back(SymTab);
OpenPOWER on IntegriCloud