X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FELFTargetAsmInfo.cpp;h=624b95c7b6c162e643545d7665d0c968a507c83a;hb=236aa8a5032282d8793b537c0f3f7ffb381a83d4;hp=76e0b1b4af5950169cf37f3b010960d566f3ba06;hpb=8a84e4402a1ab7ff36f52acdf5e1891e283a947e;p=oota-llvm.git diff --git a/lib/Target/ELFTargetAsmInfo.cpp b/lib/Target/ELFTargetAsmInfo.cpp index 76e0b1b4af5..624b95c7b6c 100644 --- a/lib/Target/ELFTargetAsmInfo.cpp +++ b/lib/Target/ELFTargetAsmInfo.cpp @@ -44,6 +44,7 @@ ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { if (const Function *F = dyn_cast(GV)) { switch (F->getLinkage()) { default: assert(0 && "Unknown linkage type!"); + case Function::PrivateLinkage: case Function::InternalLinkage: case Function::DLLExportLinkage: case Function::ExternalLinkage: @@ -109,7 +110,7 @@ ELFTargetAsmInfo::MergeableConstSection(const Type *Ty) const { // FIXME: string here is temporary, until stuff will fully land in. // We cannot use {Four,Eight,Sixteen}ByteConstantSection here, since it's // currently directly used by asmprinter. - unsigned Size = TD->getABITypeSize(Ty); + unsigned Size = TD->getTypePaddedSize(Ty); if (Size == 4 || Size == 8 || Size == 16) { std::string Name = ".rodata.cst" + utostr(Size); @@ -125,10 +126,9 @@ const Section* ELFTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const { const TargetData *TD = TM.getTargetData(); Constant *C = cast(GV)->getInitializer(); - const ConstantArray *CVA = cast(C); - const Type *Ty = CVA->getType()->getElementType(); + const Type *Ty = cast(C->getType())->getElementType(); - unsigned Size = TD->getABITypeSize(Ty); + unsigned Size = TD->getTypePaddedSize(Ty); if (Size <= 16) { assert(getCStringSection() && "Should have string section prefix"); @@ -184,4 +184,3 @@ std::string ELFTargetAsmInfo::printSectionFlags(unsigned flags) const { return Flags; } -