X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FELFTargetAsmInfo.cpp;h=624b95c7b6c162e643545d7665d0c968a507c83a;hb=6140a8b0572c80383a67248e8b1c0cf2379b1c43;hp=47727d111f12b6ab5c5ccd62954e71228bfb3a00;hpb=8f092252d3fe75064abe330e0e6f75e213f4ac06;p=oota-llvm.git diff --git a/lib/Target/ELFTargetAsmInfo.cpp b/lib/Target/ELFTargetAsmInfo.cpp index 47727d111f1..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: @@ -86,6 +87,8 @@ ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { } } else assert(0 && "Unsupported global"); + + return NULL; } const Section* @@ -107,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); @@ -123,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"); @@ -182,4 +184,3 @@ std::string ELFTargetAsmInfo::printSectionFlags(unsigned flags) const { return Flags; } -