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
This commit is contained in:
Fariborz Jahanian 2009-04-01 19:49:42 +00:00
parent 95af35e251
commit c2d5618083
1 changed files with 3 additions and 2 deletions

View File

@ -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);