diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-03-18 00:58:53 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-03-18 00:58:53 +0000 |
commit | 0682951b4f569b9a162ddfcffaa90a3ba5adb231 (patch) | |
tree | 184ca41be38fff4489a4b0bfdb9d61c308d0de1d /include/llvm/Target/TargetAsmBackend.h | |
parent | ec1176a206229b8aab0106715e640646d3efb692 (diff) | |
download | external_llvm-0682951b4f569b9a162ddfcffaa90a3ba5adb231.zip external_llvm-0682951b4f569b9a162ddfcffaa90a3ba5adb231.tar.gz external_llvm-0682951b4f569b9a162ddfcffaa90a3ba5adb231.tar.bz2 |
MC/Darwin: Add a new target hook for whether the target uses "reliable" symbol differences, basically whether the assembler should attempt to understand atoms when using scattered symbols.
Also, avoid some virtual call overhead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98789 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetAsmBackend.h')
-rw-r--r-- | include/llvm/Target/TargetAsmBackend.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/llvm/Target/TargetAsmBackend.h b/include/llvm/Target/TargetAsmBackend.h index 35a995f..faf91c4 100644 --- a/include/llvm/Target/TargetAsmBackend.h +++ b/include/llvm/Target/TargetAsmBackend.h @@ -24,6 +24,10 @@ protected: // Can only create subclasses. /// TheTarget - The Target that this machine was created for. const Target &TheTarget; + unsigned HasAbsolutizedSet : 1; + unsigned HasReliableSymbolDifference : 1; + unsigned HasScatteredSymbols : 1; + public: virtual ~TargetAsmBackend(); @@ -40,7 +44,21 @@ public: /// value of L0 - L1. This distinction is only relevant for platforms that /// support scattered symbols, since in the absence of scattered symbols (a - /// b) cannot change after assembly. - virtual bool hasAbsolutizedSet() const { return false; } + bool hasAbsolutizedSet() const { return HasAbsolutizedSet; } + + /// hasReliableSymbolDifference - Check whether this target implements + /// accurate relocations for differences between symbols. If not, differences + /// between symbols will always be relocatable expressions and any references + /// to temporary symbols will be assumed to be in the same atom, unless they + /// reside in a different section. + /// + /// This should always be true (since it results in fewer relocations with no + /// loss of functionality), but is currently supported as a way to maintain + /// exact object compatibility with Darwin 'as' (on non-x86_64). It should + /// eventually should be eliminated. See also \see hasAbsolutizedSet. + bool hasReliableSymbolDifference() const { + return HasReliableSymbolDifference; + } /// hasScatteredSymbols - Check whether this target supports scattered /// symbols. If so, the assembler should assume that atoms can be scattered by @@ -50,7 +68,7 @@ public: /// /// Note that the assembler currently does not reason about atoms, instead it /// assumes all temporary symbols reside in the "current atom". - virtual bool hasScatteredSymbols() const { return false; } + bool hasScatteredSymbols() const { return HasScatteredSymbols; } /// doesSectionRequireSymbols - Check whether the given section requires that /// all symbols (even temporaries) have symbol table entries. |