aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MC
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-12-06 00:47:03 +0000
committerJim Grosbach <grosbach@apple.com>2011-12-06 00:47:03 +0000
commit370b78d795154899a22ca2b4674e890661ff1d59 (patch)
tree212eb851e899aec47082208576f32338dbc3cd08 /include/llvm/MC
parent7c0674100443b4115d2fd6472e59cd8dcb9cc6d4 (diff)
downloadexternal_llvm-370b78d795154899a22ca2b4674e890661ff1d59.zip
external_llvm-370b78d795154899a22ca2b4674e890661ff1d59.tar.gz
external_llvm-370b78d795154899a22ca2b4674e890661ff1d59.tar.bz2
Move target-specific logic out of generic MCAssembler.
Whether a fixup needs relaxation for the associated instruction is a target-specific function, as the FIXME indicated. Create a hook for that and use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145881 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC')
-rw-r--r--include/llvm/MC/MCAsmBackend.h9
-rw-r--r--include/llvm/MC/MCAssembler.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/include/llvm/MC/MCAsmBackend.h b/include/llvm/MC/MCAsmBackend.h
index 4a0cf37..b841ddb 100644
--- a/include/llvm/MC/MCAsmBackend.h
+++ b/include/llvm/MC/MCAsmBackend.h
@@ -16,9 +16,11 @@
#include "llvm/Support/DataTypes.h"
namespace llvm {
+class MCAsmLayout;
class MCELFObjectTargetWriter;
class MCFixup;
class MCInst;
+class MCInstFragment;
class MCObjectWriter;
class MCSection;
template<typename T>
@@ -104,6 +106,13 @@ public:
/// \param Inst - The instruction to test.
virtual bool MayNeedRelaxation(const MCInst &Inst) const = 0;
+ /// fixupNeedsRelaxation - Target specific predicate for whether a given
+ /// fixup requires the associated instruction to be relaxed.
+ virtual bool fixupNeedsRelaxation(const MCFixup &Fixup,
+ uint64_t Value,
+ const MCInstFragment *DF,
+ const MCAsmLayout &Layout) const = 0;
+
/// RelaxInstruction - Relax the instruction in the given fragment to the next
/// wider instruction.
///
diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h
index 7d84092..687dd0c 100644
--- a/include/llvm/MC/MCAssembler.h
+++ b/include/llvm/MC/MCAssembler.h
@@ -717,7 +717,7 @@ private:
/// Check whether a fixup can be satisfied, or whether it needs to be relaxed
/// (increased in size, in order to hold its value correctly).
- bool fixupNeedsRelaxation(const MCFixup &Fixup, const MCFragment *DF,
+ bool fixupNeedsRelaxation(const MCFixup &Fixup, const MCInstFragment *DF,
const MCAsmLayout &Layout) const;
/// Check whether the given fragment needs relaxation.