aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjCGNU.cpp
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
commit91a0b51438e5259a79d68d7450c453827beed9e2 (patch)
tree6813309aa4d2bdde27e55e34ddb183c5966659dd /lib/CodeGen/CGObjCGNU.cpp
parent0dc65be58d319287b349ec7a898bf28d4c5261af (diff)
Fixes a problem where the compiler is reporting the wrong size to the Gnu
runtime on 64-bit architectures. Patch by David Chisnall git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68238 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCGNU.cpp')
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index f1d43e9d12..fc77c805f4 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/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);