diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-30 22:07:48 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-30 22:07:48 +0000 |
commit | 0f6610e41701e7d7a9b65c52e1a0926530ac3ce1 (patch) | |
tree | bad1f6c523af03e6693679f89fea62397323a873 /lib/CodeGen/CGObjCMac.cpp | |
parent | 71e62a92812eeb239926a2ce6cc371d8f50aa814 (diff) |
add imag_info section and data (for objc2 nonfragile abi).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63430 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 67ef1ae0e8..14b39cb13b 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -3197,6 +3197,23 @@ void CGObjCNonFragileABIMac::FinishNonFragileABIModule() { UsedGlobals.push_back(GV); } + // static int L_OBJC_IMAGE_INFO[2] = { 0, flags }; + // FIXME. flags can be 0 | 1 | 2 | 6. For now just use 0 + std::vector<llvm::Constant*> Values(2); + Values[0] = llvm::ConstantInt::get(ObjCTypes.IntTy, 0); + Values[1] = llvm::ConstantInt::get(ObjCTypes.IntTy, 0); + llvm::Constant* Init = llvm::ConstantArray::get( + llvm::ArrayType::get(ObjCTypes.IntTy, 2), + Values); + llvm::GlobalVariable *IMGV = + new llvm::GlobalVariable(Init->getType(), false, + llvm::GlobalValue::InternalLinkage, + Init, + "\01L_OBJC_IMAGE_INFO", + &CGM.getModule()); + IMGV->setSection("__DATA, __objc_imageinfo, regular, no_dead_strip"); + UsedGlobals.push_back(IMGV); + std::vector<llvm::Constant*> Used; for (std::vector<llvm::GlobalVariable*>::iterator i = UsedGlobals.begin(), e = UsedGlobals.end(); i != e; ++i) { @@ -3361,8 +3378,6 @@ llvm::GlobalVariable * CGObjCNonFragileABIMac::BuildClassMetaData( &CGM.getModule()); GV->setSection("__DATA, __objc_const"); UsedGlobals.push_back(GV); - // FIXME! why? - GV->setAlignment(32); return GV; } @@ -3836,8 +3851,6 @@ llvm::Constant *CGObjCNonFragileABIMac::GetOrEmitProtocolRef( &CGM.getModule()); Entry->setSection("__DATA,__datacoal_nt,coalesced"); UsedGlobals.push_back(Entry); - // FIXME: Is this necessary? Why only for protocol? - Entry->setAlignment(4); } return Entry; @@ -3941,8 +3954,6 @@ llvm::Constant *CGObjCNonFragileABIMac::GetOrEmitProtocol( std::string("\01l_OBJC_PROTOCOL_$_")+ProtocolName, &CGM.getModule()); Entry->setSection("__DATA,__datacoal_nt,coalesced"); - // FIXME: Is this necessary? Why only for protocol? - Entry->setAlignment(4); } Entry->setVisibility(llvm::GlobalValue::HiddenVisibility); |