delete a forwarding function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100815 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-04-08 21:34:17 +00:00
parent 74aae4726a
commit 287df1bc03
6 changed files with 111 additions and 113 deletions

View File

@ -51,11 +51,6 @@ protected:
const MCSection *MergeableConst4Section; const MCSection *MergeableConst4Section;
const MCSection *MergeableConst8Section; const MCSection *MergeableConst8Section;
const MCSection *MergeableConst16Section; const MCSection *MergeableConst16Section;
protected:
const MCSection *getELFSection(StringRef Section, unsigned Type,
unsigned Flags, SectionKind Kind,
bool IsExplicit = false) const;
public: public:
TargetLoweringObjectFileELF() {} TargetLoweringObjectFileELF() {}
~TargetLoweringObjectFileELF() {} ~TargetLoweringObjectFileELF() {}

View File

@ -96,7 +96,7 @@ namespace llvm {
const MCSection *getELFSection(StringRef Section, unsigned Type, const MCSection *getELFSection(StringRef Section, unsigned Type,
unsigned Flags, SectionKind Kind, unsigned Flags, SectionKind Kind,
bool IsExplicit); bool IsExplicit = false);
/// @} /// @}

View File

@ -39,90 +39,86 @@ using namespace dwarf;
// ELF // ELF
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
const MCSection *TargetLoweringObjectFileELF::
getELFSection(StringRef Section, unsigned Type, unsigned Flags,
SectionKind Kind, bool IsExplicit) const {
return getContext().getELFSection(Section, Type, Flags, Kind, IsExplicit);
}
void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx, void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx,
const TargetMachine &TM) { const TargetMachine &TM) {
TargetLoweringObjectFile::Initialize(Ctx, TM); TargetLoweringObjectFile::Initialize(Ctx, TM);
BSSSection = BSSSection =
getELFSection(".bss", MCSectionELF::SHT_NOBITS, getContext().getELFSection(".bss", MCSectionELF::SHT_NOBITS,
MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, MCSectionELF::SHF_WRITE |MCSectionELF::SHF_ALLOC,
SectionKind::getBSS()); SectionKind::getBSS());
TextSection = TextSection =
getELFSection(".text", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".text", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_EXECINSTR | MCSectionELF::SHF_ALLOC, MCSectionELF::SHF_EXECINSTR |
MCSectionELF::SHF_ALLOC,
SectionKind::getText()); SectionKind::getText());
DataSection = DataSection =
getELFSection(".data", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".data", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, MCSectionELF::SHF_WRITE |MCSectionELF::SHF_ALLOC,
SectionKind::getDataRel()); SectionKind::getDataRel());
ReadOnlySection = ReadOnlySection =
getELFSection(".rodata", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".rodata", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC, MCSectionELF::SHF_ALLOC,
SectionKind::getReadOnly()); SectionKind::getReadOnly());
TLSDataSection = TLSDataSection =
getELFSection(".tdata", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".tdata", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_TLS | MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_TLS |
MCSectionELF::SHF_WRITE, SectionKind::getThreadData()); MCSectionELF::SHF_WRITE,
SectionKind::getThreadData());
TLSBSSSection = TLSBSSSection =
getELFSection(".tbss", MCSectionELF::SHT_NOBITS, getContext().getELFSection(".tbss", MCSectionELF::SHT_NOBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_TLS | MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_TLS |
MCSectionELF::SHF_WRITE, SectionKind::getThreadBSS()); MCSectionELF::SHF_WRITE,
SectionKind::getThreadBSS());
DataRelSection = DataRelSection =
getELFSection(".data.rel", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".data.rel", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_WRITE, MCSectionELF::SHF_ALLOC |MCSectionELF::SHF_WRITE,
SectionKind::getDataRel()); SectionKind::getDataRel());
DataRelLocalSection = DataRelLocalSection =
getELFSection(".data.rel.local", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".data.rel.local", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_WRITE, MCSectionELF::SHF_ALLOC |MCSectionELF::SHF_WRITE,
SectionKind::getDataRelLocal()); SectionKind::getDataRelLocal());
DataRelROSection = DataRelROSection =
getELFSection(".data.rel.ro", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".data.rel.ro", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_WRITE, MCSectionELF::SHF_ALLOC |MCSectionELF::SHF_WRITE,
SectionKind::getReadOnlyWithRel()); SectionKind::getReadOnlyWithRel());
DataRelROLocalSection = DataRelROLocalSection =
getELFSection(".data.rel.ro.local", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".data.rel.ro.local", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_WRITE, MCSectionELF::SHF_ALLOC |MCSectionELF::SHF_WRITE,
SectionKind::getReadOnlyWithRelLocal()); SectionKind::getReadOnlyWithRelLocal());
MergeableConst4Section = MergeableConst4Section =
getELFSection(".rodata.cst4", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".rodata.cst4", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_MERGE, MCSectionELF::SHF_ALLOC |MCSectionELF::SHF_MERGE,
SectionKind::getMergeableConst4()); SectionKind::getMergeableConst4());
MergeableConst8Section = MergeableConst8Section =
getELFSection(".rodata.cst8", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".rodata.cst8", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_MERGE, MCSectionELF::SHF_ALLOC |MCSectionELF::SHF_MERGE,
SectionKind::getMergeableConst8()); SectionKind::getMergeableConst8());
MergeableConst16Section = MergeableConst16Section =
getELFSection(".rodata.cst16", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".rodata.cst16", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_MERGE, MCSectionELF::SHF_ALLOC |MCSectionELF::SHF_MERGE,
SectionKind::getMergeableConst16()); SectionKind::getMergeableConst16());
StaticCtorSection = StaticCtorSection =
getELFSection(".ctors", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".ctors", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_WRITE, MCSectionELF::SHF_ALLOC |MCSectionELF::SHF_WRITE,
SectionKind::getDataRel()); SectionKind::getDataRel());
StaticDtorSection = StaticDtorSection =
getELFSection(".dtors", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".dtors", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_WRITE, MCSectionELF::SHF_ALLOC |MCSectionELF::SHF_WRITE,
SectionKind::getDataRel()); SectionKind::getDataRel());
// Exception Handling Sections. // Exception Handling Sections.
@ -132,46 +128,47 @@ void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx,
// runtime hit for C++ apps. Either the contents of the LSDA need to be // runtime hit for C++ apps. Either the contents of the LSDA need to be
// adjusted or this should be a data section. // adjusted or this should be a data section.
LSDASection = LSDASection =
getELFSection(".gcc_except_table", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".gcc_except_table", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC, SectionKind::getReadOnly()); MCSectionELF::SHF_ALLOC,
SectionKind::getReadOnly());
EHFrameSection = EHFrameSection =
getELFSection(".eh_frame", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".eh_frame", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_WRITE, MCSectionELF::SHF_ALLOC |MCSectionELF::SHF_WRITE,
SectionKind::getDataRel()); SectionKind::getDataRel());
// Debug Info Sections. // Debug Info Sections.
DwarfAbbrevSection = DwarfAbbrevSection =
getELFSection(".debug_abbrev", MCSectionELF::SHT_PROGBITS, 0, getContext().getELFSection(".debug_abbrev", MCSectionELF::SHT_PROGBITS, 0,
SectionKind::getMetadata()); SectionKind::getMetadata());
DwarfInfoSection = DwarfInfoSection =
getELFSection(".debug_info", MCSectionELF::SHT_PROGBITS, 0, getContext().getELFSection(".debug_info", MCSectionELF::SHT_PROGBITS, 0,
SectionKind::getMetadata()); SectionKind::getMetadata());
DwarfLineSection = DwarfLineSection =
getELFSection(".debug_line", MCSectionELF::SHT_PROGBITS, 0, getContext().getELFSection(".debug_line", MCSectionELF::SHT_PROGBITS, 0,
SectionKind::getMetadata()); SectionKind::getMetadata());
DwarfFrameSection = DwarfFrameSection =
getELFSection(".debug_frame", MCSectionELF::SHT_PROGBITS, 0, getContext().getELFSection(".debug_frame", MCSectionELF::SHT_PROGBITS, 0,
SectionKind::getMetadata()); SectionKind::getMetadata());
DwarfPubNamesSection = DwarfPubNamesSection =
getELFSection(".debug_pubnames", MCSectionELF::SHT_PROGBITS, 0, getContext().getELFSection(".debug_pubnames", MCSectionELF::SHT_PROGBITS, 0,
SectionKind::getMetadata()); SectionKind::getMetadata());
DwarfPubTypesSection = DwarfPubTypesSection =
getELFSection(".debug_pubtypes", MCSectionELF::SHT_PROGBITS, 0, getContext().getELFSection(".debug_pubtypes", MCSectionELF::SHT_PROGBITS, 0,
SectionKind::getMetadata()); SectionKind::getMetadata());
DwarfStrSection = DwarfStrSection =
getELFSection(".debug_str", MCSectionELF::SHT_PROGBITS, 0, getContext().getELFSection(".debug_str", MCSectionELF::SHT_PROGBITS, 0,
SectionKind::getMetadata()); SectionKind::getMetadata());
DwarfLocSection = DwarfLocSection =
getELFSection(".debug_loc", MCSectionELF::SHT_PROGBITS, 0, getContext().getELFSection(".debug_loc", MCSectionELF::SHT_PROGBITS, 0,
SectionKind::getMetadata()); SectionKind::getMetadata());
DwarfARangesSection = DwarfARangesSection =
getELFSection(".debug_aranges", MCSectionELF::SHT_PROGBITS, 0, getContext().getELFSection(".debug_aranges", MCSectionELF::SHT_PROGBITS, 0,
SectionKind::getMetadata()); SectionKind::getMetadata());
DwarfRangesSection = DwarfRangesSection =
getELFSection(".debug_ranges", MCSectionELF::SHT_PROGBITS, 0, getContext().getELFSection(".debug_ranges", MCSectionELF::SHT_PROGBITS, 0,
SectionKind::getMetadata()); SectionKind::getMetadata());
DwarfMacroInfoSection = DwarfMacroInfoSection =
getELFSection(".debug_macinfo", MCSectionELF::SHT_PROGBITS, 0, getContext().getELFSection(".debug_macinfo", MCSectionELF::SHT_PROGBITS, 0,
SectionKind::getMetadata()); SectionKind::getMetadata());
} }
@ -261,7 +258,7 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
// Infer section flags from the section name if we can. // Infer section flags from the section name if we can.
Kind = getELFKindForNamedSection(SectionName, Kind); Kind = getELFKindForNamedSection(SectionName, Kind);
return getELFSection(SectionName, return getContext().getELFSection(SectionName,
getELFSectionType(SectionName, Kind), getELFSectionType(SectionName, Kind),
getELFSectionFlags(Kind), Kind, true); getELFSectionFlags(Kind), Kind, true);
} }
@ -293,7 +290,8 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
SmallString<128> Name(Prefix, Prefix+strlen(Prefix)); SmallString<128> Name(Prefix, Prefix+strlen(Prefix));
MCSymbol *Sym = Mang->getSymbol(GV); MCSymbol *Sym = Mang->getSymbol(GV);
Name.append(Sym->getName().begin(), Sym->getName().end()); Name.append(Sym->getName().begin(), Sym->getName().end());
return getELFSection(Name.str(), getELFSectionType(Name.str(), Kind), return getContext().getELFSection(Name.str(),
getELFSectionType(Name.str(), Kind),
getELFSectionFlags(Kind), Kind); getELFSectionFlags(Kind), Kind);
} }
@ -319,7 +317,7 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
std::string Name = SizeSpec + utostr(Align); std::string Name = SizeSpec + utostr(Align);
return getELFSection(Name, MCSectionELF::SHT_PROGBITS, return getContext().getELFSection(Name, MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_ALLOC | MCSectionELF::SHF_ALLOC |
MCSectionELF::SHF_MERGE | MCSectionELF::SHF_MERGE |
MCSectionELF::SHF_STRINGS, MCSectionELF::SHF_STRINGS,

View File

@ -9,6 +9,7 @@
#include "ARMTargetObjectFile.h" #include "ARMTargetObjectFile.h"
#include "ARMSubtarget.h" #include "ARMSubtarget.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSectionELF.h" #include "llvm/MC/MCSectionELF.h"
#include "llvm/Support/Dwarf.h" #include "llvm/Support/Dwarf.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
@ -25,12 +26,14 @@ void ARMElfTargetObjectFile::Initialize(MCContext &Ctx,
if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) { if (TM.getSubtarget<ARMSubtarget>().isAAPCS_ABI()) {
StaticCtorSection = StaticCtorSection =
getELFSection(".init_array", MCSectionELF::SHT_INIT_ARRAY, getContext().getELFSection(".init_array", MCSectionELF::SHT_INIT_ARRAY,
MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, MCSectionELF::SHF_WRITE |
MCSectionELF::SHF_ALLOC,
SectionKind::getDataRel()); SectionKind::getDataRel());
StaticDtorSection = StaticDtorSection =
getELFSection(".fini_array", MCSectionELF::SHT_FINI_ARRAY, getContext().getELFSection(".fini_array", MCSectionELF::SHT_FINI_ARRAY,
MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, MCSectionELF::SHF_WRITE |
MCSectionELF::SHF_ALLOC,
SectionKind::getDataRel()); SectionKind::getDataRel());
} }
} }

View File

@ -11,6 +11,7 @@
#include "MBlazeSubtarget.h" #include "MBlazeSubtarget.h"
#include "llvm/DerivedTypes.h" #include "llvm/DerivedTypes.h"
#include "llvm/GlobalVariable.h" #include "llvm/GlobalVariable.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSectionELF.h" #include "llvm/MC/MCSectionELF.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
@ -22,13 +23,13 @@ Initialize(MCContext &Ctx, const TargetMachine &TM) {
TargetLoweringObjectFileELF::Initialize(Ctx, TM); TargetLoweringObjectFileELF::Initialize(Ctx, TM);
SmallDataSection = SmallDataSection =
getELFSection(".sdata", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".sdata", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, MCSectionELF::SHF_WRITE |MCSectionELF::SHF_ALLOC,
SectionKind::getDataRel()); SectionKind::getDataRel());
SmallBSSSection = SmallBSSSection =
getELFSection(".sbss", MCSectionELF::SHT_NOBITS, getContext().getELFSection(".sbss", MCSectionELF::SHT_NOBITS,
MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, MCSectionELF::SHF_WRITE |MCSectionELF::SHF_ALLOC,
SectionKind::getBSS()); SectionKind::getBSS());
} }

View File

@ -11,6 +11,7 @@
#include "MipsSubtarget.h" #include "MipsSubtarget.h"
#include "llvm/DerivedTypes.h" #include "llvm/DerivedTypes.h"
#include "llvm/GlobalVariable.h" #include "llvm/GlobalVariable.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSectionELF.h" #include "llvm/MC/MCSectionELF.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachine.h"
@ -26,13 +27,13 @@ void MipsTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM){
TargetLoweringObjectFileELF::Initialize(Ctx, TM); TargetLoweringObjectFileELF::Initialize(Ctx, TM);
SmallDataSection = SmallDataSection =
getELFSection(".sdata", MCSectionELF::SHT_PROGBITS, getContext().getELFSection(".sdata", MCSectionELF::SHT_PROGBITS,
MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, MCSectionELF::SHF_WRITE |MCSectionELF::SHF_ALLOC,
SectionKind::getDataRel()); SectionKind::getDataRel());
SmallBSSSection = SmallBSSSection =
getELFSection(".sbss", MCSectionELF::SHT_NOBITS, getContext().getELFSection(".sbss", MCSectionELF::SHT_NOBITS,
MCSectionELF::SHF_WRITE | MCSectionELF::SHF_ALLOC, MCSectionELF::SHF_WRITE |MCSectionELF::SHF_ALLOC,
SectionKind::getBSS()); SectionKind::getBSS());
} }