diff options
author | Eric Christopher <echristo@gmail.com> | 2014-01-23 06:47:25 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-01-23 06:47:25 +0000 |
commit | 80664e50cd9efab348cea6221e461bcee11386ea (patch) | |
tree | 2966905c58565322cbba4d51431bf28b8371a672 /include | |
parent | fa6e5cb5113d6cfb1f1bff3a1539859e33f9722a (diff) | |
download | llvm-80664e50cd9efab348cea6221e461bcee11386ea.tar.gz llvm-80664e50cd9efab348cea6221e461bcee11386ea.tar.bz2 llvm-80664e50cd9efab348cea6221e461bcee11386ea.tar.xz |
Add a variable to track whether or not we've used a unique section,
e.g. linkonce, to TargetMachine and set it when we've done so
for ELF targets currently. This involved making TargetMachine
non-const in a TLOF use and propagating that change around - I'm
open to other ideas.
This will be used in a future commit to handle emitting debug
information with ranges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/TargetLoweringObjectFileImpl.h | 6 | ||||
-rw-r--r-- | include/llvm/Target/TargetLoweringObjectFile.h | 8 | ||||
-rw-r--r-- | include/llvm/Target/TargetMachine.h | 4 |
3 files changed, 11 insertions, 7 deletions
diff --git a/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h b/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h index 4e90e141ce..717ebdb2f7 100644 --- a/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h +++ b/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h @@ -53,7 +53,7 @@ public: virtual const MCSection * SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler *Mang, const TargetMachine &TM) const; + Mangler *Mang, TargetMachine &TM) const; /// getTTypeGlobalReference - Return an MCExpr to use for a reference to the /// specified type info global variable from exception handling information. @@ -92,7 +92,7 @@ public: virtual const MCSection * SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler *Mang, const TargetMachine &TM) const; + Mangler *Mang, TargetMachine &TM) const; virtual const MCSection * getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, @@ -131,7 +131,7 @@ public: virtual const MCSection * SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler *Mang, const TargetMachine &TM) const; + Mangler *Mang, TargetMachine &TM) const; /// getDepLibFromLinkerOpt - Extract the dependent library name from a linker /// option string. Returns StringRef() if the option does not specify a library. diff --git a/include/llvm/Target/TargetLoweringObjectFile.h b/include/llvm/Target/TargetLoweringObjectFile.h index 5bf9a13563..e7e16ace89 100644 --- a/include/llvm/Target/TargetLoweringObjectFile.h +++ b/include/llvm/Target/TargetLoweringObjectFile.h @@ -38,7 +38,7 @@ class TargetLoweringObjectFile : public MCObjectFileInfo { const DataLayout *DL; TargetLoweringObjectFile( - const TargetLoweringObjectFile&) LLVM_DELETED_FUNCTION; + const TargetLoweringObjectFile &) LLVM_DELETED_FUNCTION; void operator=(const TargetLoweringObjectFile&) LLVM_DELETED_FUNCTION; public: @@ -91,14 +91,14 @@ public: /// be passed external (or available externally) globals. const MCSection *SectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang, - const TargetMachine &TM) const; + TargetMachine &TM) const; /// SectionForGlobal - This method computes the appropriate section to emit /// the specified global variable or function definition. This should not /// be passed external (or available externally) globals. const MCSection *SectionForGlobal(const GlobalValue *GV, Mangler *Mang, - const TargetMachine &TM) const { + TargetMachine &TM) const { return SectionForGlobal(GV, getKindForGlobal(GV, TM), Mang, TM); } @@ -167,7 +167,7 @@ public: protected: virtual const MCSection * SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, - Mangler *Mang, const TargetMachine &TM) const; + Mangler *Mang, TargetMachine &TM) const; }; } // end namespace llvm diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h index c27ffdfcd7..7cbc87d9a8 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -88,6 +88,7 @@ protected: // Can only create subclasses. unsigned MCUseLoc : 1; unsigned MCUseCFI : 1; unsigned MCUseDwarfDirectory : 1; + unsigned DebugUseUniqueSections : 1; unsigned RequireStructuredCFG : 1; public: @@ -160,6 +161,9 @@ public: bool requiresStructuredCFG() const { return RequireStructuredCFG; } void setRequiresStructuredCFG(bool Value) { RequireStructuredCFG = Value; } + bool debugUseUniqueSections() const { return DebugUseUniqueSections; } + void setDebugUseUniqueSections(bool Value) { DebugUseUniqueSections = Value; } + /// hasMCRelaxAll - Check whether all machine code instructions should be /// relaxed. bool hasMCRelaxAll() const { return MCRelaxAll; } |