aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-03-12 21:00:49 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-03-12 21:00:49 +0000
commitdf3c8f29691a1e3f9ac4afbf05be52dbc898dae9 (patch)
tree7bb7e05b7318e959bf11cc69d0b4e30473965d14 /include
parenta0e36d55c495b3325805c659ac365b5faea84e34 (diff)
MC: Factor out MCAssembler::EvaluateFixup, and simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCAssembler.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h
index 4db1c012b0..d614c69742 100644
--- a/include/llvm/MC/MCAssembler.h
+++ b/include/llvm/MC/MCAssembler.h
@@ -21,6 +21,7 @@
namespace llvm {
class raw_ostream;
+class MCAsmLayout;
class MCAssembler;
class MCContext;
class MCExpr;
@@ -28,6 +29,7 @@ class MCFragment;
class MCSection;
class MCSectionData;
class MCSymbol;
+class MCValue;
class TargetAsmBackend;
/// MCAsmFixup - Represent a fixed size region of bytes inside some fragment
@@ -624,6 +626,25 @@ private:
/// already have been computed.
void LayoutSection(MCSectionData &SD);
+ // FIXME: Make protected once we factor out object writer classes.
+public:
+ /// Evaluate a fixup to a relocatable expression and the value which should be
+ /// placed into the fixup.
+ ///
+ /// \param Layout The layout to use for evaluation.
+ /// \param Fixup The fixup to evaluate.
+ /// \param DF The fragment the fixup is inside.
+ /// \param Target [out] On return, the relocatable expression the fixup
+ /// evaluates to.
+ /// \param Value [out] On return, the value of the fixup as currently layed
+ /// out.
+ /// \return Whether the fixup value was fully resolved. This is true if the
+ /// \arg Value result is fixed, otherwise the value may change due to
+ /// relocation.
+ bool EvaluateFixup(const MCAsmLayout &Layout,
+ MCAsmFixup &Fixup, MCDataFragment *DF,
+ MCValue &Target, uint64_t &Value) const;
+
public:
/// Construct a new assembler instance.
///