diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonTargetObjectFile.h | 7 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MipsTargetObjectFile.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/Mips/MipsTargetObjectFile.h | 5 | ||||
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCTargetObjectFile.h | 7 | ||||
-rw-r--r-- | llvm/lib/Target/TargetLoweringObjectFile.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/Target/TargetMachine.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/XCore/XCoreTargetObjectFile.h | 7 |
11 files changed, 27 insertions, 26 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 3621b582878..7f534acb70a 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -232,7 +232,7 @@ static const char *getSectionPrefixForGlobal(SectionKind Kind) { const MCSection *TargetLoweringObjectFileELF:: SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler *Mang, const TargetMachine &TM) const { + Mangler *Mang, TargetMachine &TM) const { // If we have -ffunction-section or -fdata-section then we should emit the // global value to a uniqued section specifically for it. bool EmitUniquedSection; @@ -258,6 +258,8 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Flags |= ELF::SHF_GROUP; } + // Set that we've used a unique section name in the target machine. + TM.setDebugUseUniqueSections(true); return getContext().getELFSection(Name.str(), getELFSectionType(Name.str(), Kind), Flags, Kind, 0, Group); @@ -529,7 +531,7 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, const MCSection *TargetLoweringObjectFileMachO:: SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler *Mang, const TargetMachine &TM) const { + Mangler *Mang, TargetMachine &TM) const { // Handle thread local data. if (Kind.isThreadBSS()) return TLSBSSSection; @@ -754,7 +756,7 @@ static const char *getCOFFSectionNameForUniqueGlobal(SectionKind Kind) { const MCSection *TargetLoweringObjectFileCOFF:: SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler *Mang, const TargetMachine &TM) const { + Mangler *Mang, TargetMachine &TM) const { // If this global is linkonce/weak and the target handles this by emitting it // into a 'uniqued' section name, create and return the section now. diff --git a/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp b/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp index 7773cff2d21..a26b81de06c 100644 --- a/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp +++ b/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp @@ -87,7 +87,7 @@ IsGlobalInSmallSection(const GlobalValue *GV, const TargetMachine &TM, const MCSection *HexagonTargetObjectFile:: SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler *Mang, const TargetMachine &TM) const { + Mangler *Mang, TargetMachine &TM) const { // Handle Small Section classification here. if (Kind.isBSS() && IsGlobalInSmallSection(GV, TM, Kind)) diff --git a/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.h b/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.h index 41f6792ca8e..ac87814b4b6 100644 --- a/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.h +++ b/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.h @@ -30,10 +30,9 @@ namespace llvm { const TargetMachine &TM) const; bool IsSmallDataEnabled () const; - const MCSection* SelectSectionForGlobal(const GlobalValue *GV, - SectionKind Kind, - Mangler *Mang, - const TargetMachine &TM) const; + const MCSection *SelectSectionForGlobal(const GlobalValue *GV, + SectionKind Kind, Mangler *Mang, + TargetMachine &TM) const; }; } // namespace llvm diff --git a/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp b/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp index 4c748c5b57c..90808bcb052 100644 --- a/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp +++ b/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp @@ -103,7 +103,7 @@ IsGlobalInSmallSection(const GlobalValue *GV, const TargetMachine &TM, const MCSection *MipsTargetObjectFile:: SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler *Mang, const TargetMachine &TM) const { + Mangler *Mang, TargetMachine &TM) const { // TODO: Could also support "weak" symbols as well with ".gnu.linkonce.s.*" // sections? diff --git a/llvm/lib/Target/Mips/MipsTargetObjectFile.h b/llvm/lib/Target/Mips/MipsTargetObjectFile.h index c0e9140c829..9aaf7941abf 100644 --- a/llvm/lib/Target/Mips/MipsTargetObjectFile.h +++ b/llvm/lib/Target/Mips/MipsTargetObjectFile.h @@ -31,9 +31,8 @@ namespace llvm { const TargetMachine &TM) const; const MCSection *SelectSectionForGlobal(const GlobalValue *GV, - SectionKind Kind, - Mangler *Mang, - const TargetMachine &TM) const; + SectionKind Kind, Mangler *Mang, + TargetMachine &TM) const; // TODO: Classify globals as mips wishes. const MCSection *getReginfoSection() const { return ReginfoSection; } diff --git a/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp b/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp index 32678674f9a..b9cfe7c9a84 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp @@ -24,7 +24,7 @@ Initialize(MCContext &Ctx, const TargetMachine &TM) { const MCSection * PPC64LinuxTargetObjectFile:: SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler *Mang, const TargetMachine &TM) const { + Mangler *Mang, TargetMachine &TM) const { const MCSection *DefaultSection = TargetLoweringObjectFileELF::SelectSectionForGlobal(GV, Kind, Mang, TM); diff --git a/llvm/lib/Target/PowerPC/PPCTargetObjectFile.h b/llvm/lib/Target/PowerPC/PPCTargetObjectFile.h index 262c52213d2..571954535db 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetObjectFile.h +++ b/llvm/lib/Target/PowerPC/PPCTargetObjectFile.h @@ -22,9 +22,10 @@ namespace llvm { virtual void Initialize(MCContext &Ctx, const TargetMachine &TM); - virtual const MCSection * - SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler *Mang, const TargetMachine &TM) const; + virtual const MCSection *SelectSectionForGlobal(const GlobalValue *GV, + SectionKind Kind, + Mangler *Mang, + TargetMachine &TM) const; /// \brief Describe a TLS variable address within debug info. virtual const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const; diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp index b62577e0801..8d73a3ab347 100644 --- a/llvm/lib/Target/TargetLoweringObjectFile.cpp +++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp @@ -265,7 +265,7 @@ SectionKind TargetLoweringObjectFile::getKindForGlobal(const GlobalValue *GV, /// be passed external (or available externally) globals. const MCSection *TargetLoweringObjectFile:: SectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang, - const TargetMachine &TM) const { + TargetMachine &TM) const { // Select section name. if (GV->hasSection()) return getExplicitSectionGlobal(GV, Kind, Mang, TM); @@ -277,11 +277,9 @@ SectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang, // Lame default implementation. Calculate the section name for global. -const MCSection * -TargetLoweringObjectFile::SelectSectionForGlobal(const GlobalValue *GV, - SectionKind Kind, - Mangler *Mang, - const TargetMachine &TM) const{ +const MCSection *TargetLoweringObjectFile::SelectSectionForGlobal( + const GlobalValue *GV, SectionKind Kind, Mangler *Mang, + TargetMachine &TM) const { assert(!Kind.isThreadLocal() && "Doesn't support TLS"); if (Kind.isText()) diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp index a2350352071..39ade0a2b85 100644 --- a/llvm/lib/Target/TargetMachine.cpp +++ b/llvm/lib/Target/TargetMachine.cpp @@ -55,6 +55,7 @@ TargetMachine::TargetMachine(const Target &T, MCUseLoc(true), MCUseCFI(true), MCUseDwarfDirectory(false), + DebugUseUniqueSections(false), RequireStructuredCFG(false), Options(Options) { } diff --git a/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp b/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp index 61eb2b51f3e..fec79d759c8 100644 --- a/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp +++ b/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp @@ -130,7 +130,7 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, const MCSection *XCoreTargetObjectFile:: SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang, - const TargetMachine &TM) const{ + TargetMachine &TM) const{ if (Kind.isText()) return TextSection; if (Kind.isMergeable1ByteCString()) return CStringSection; if (Kind.isMergeableConst4()) return MergeableConst4Section; diff --git a/llvm/lib/Target/XCore/XCoreTargetObjectFile.h b/llvm/lib/Target/XCore/XCoreTargetObjectFile.h index bf9798d5085..127ff0704c1 100644 --- a/llvm/lib/Target/XCore/XCoreTargetObjectFile.h +++ b/llvm/lib/Target/XCore/XCoreTargetObjectFile.h @@ -27,9 +27,10 @@ static const unsigned CodeModelLargeSize = 256; getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang, const TargetMachine &TM) const; - virtual const MCSection * - SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler *Mang, const TargetMachine &TM) const; + virtual const MCSection *SelectSectionForGlobal(const GlobalValue *GV, + SectionKind Kind, + Mangler *Mang, + TargetMachine &TM) const; virtual const MCSection *getSectionForConstant(SectionKind Kind) const; }; |