[cfe-commits] r68238 - /cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
Fariborz Jahanian
fjahanian at apple.com
Wed Apr 1 12:49:42 PDT 2009
Author: fjahanian
Date: Wed Apr 1 14:49:42 2009
New Revision: 68238
URL: http://llvm.org/viewvc/llvm-project?rev=68238&view=rev
Log:
Fixes a problem where the compiler is reporting the wrong size to the Gnu
runtime on 64-bit architectures.
Patch by David Chisnall
Modified:
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=68238&r1=68237&r2=68238&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Wed Apr 1 14:49:42 2009
@@ -969,8 +969,9 @@
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);
More information about the cfe-commits
mailing list