diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCAsmInfo.h | 7 | ||||
-rw-r--r-- | include/llvm/MC/MCSection.h | 8 | ||||
-rw-r--r-- | include/llvm/MC/MCSectionELF.h | 5 |
3 files changed, 13 insertions, 7 deletions
diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h index d190ea4..33def86 100644 --- a/include/llvm/MC/MCAsmInfo.h +++ b/include/llvm/MC/MCAsmInfo.h @@ -223,10 +223,6 @@ namespace llvm { //===--- Dwarf Emission Directives -----------------------------------===// - /// AbsoluteDebugSectionOffsets - True if we should emit abolute section - /// offsets for debug information. - bool AbsoluteDebugSectionOffsets; // Defaults to false. - /// HasLEB128 - True if target asm supports leb128 directives. bool HasLEB128; // Defaults to false. @@ -385,9 +381,6 @@ namespace llvm { MCSymbolAttr getProtectedVisibilityAttr() const { return ProtectedVisibilityAttr; } - bool isAbsoluteDebugSectionOffsets() const { - return AbsoluteDebugSectionOffsets; - } bool hasLEB128() const { return HasLEB128; } diff --git a/include/llvm/MC/MCSection.h b/include/llvm/MC/MCSection.h index 4a1c46c..e9c19fc 100644 --- a/include/llvm/MC/MCSection.h +++ b/include/llvm/MC/MCSection.h @@ -39,6 +39,14 @@ namespace llvm { virtual void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS) const = 0; + + /// isBaseAddressKnownZero - Return true if we know that this section will + /// get a base address of zero. In cases where we know that this is true we + /// can emit section offsets as direct references to avoid a subtraction + /// from the base of the section, saving a relocation. + virtual bool isBaseAddressKnownZero() const { + return false; + } }; class MCSectionCOFF : public MCSection { diff --git a/include/llvm/MC/MCSectionELF.h b/include/llvm/MC/MCSectionELF.h index cdd2f73..e550cd2 100644 --- a/include/llvm/MC/MCSectionELF.h +++ b/include/llvm/MC/MCSectionELF.h @@ -172,6 +172,11 @@ public: virtual void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS) const; + /// isBaseAddressKnownZero - We know that non-allocatable sections (like + /// debug info) have a base of zero. + virtual bool isBaseAddressKnownZero() const { + return (getFlags() & SHF_ALLOC) == 0; + } /// PrintTargetSpecificSectionFlags - Targets that define their own /// MCSectionELF subclasses with target specific section flags should |