summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCExpr.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-04-29 18:00:03 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-04-29 18:00:03 +0000
commit0eab5c4d85b4c4bb161bcdd959aa58a6f54415cc (patch)
tree9fbabf08ded997347b88ad63746aebc103199d5f /include/llvm/MC/MCExpr.h
parent6db7fe873624dd5e5e21c263614df32577e40c95 (diff)
downloadllvm-0eab5c4d85b4c4bb161bcdd959aa58a6f54415cc.tar.gz
llvm-0eab5c4d85b4c4bb161bcdd959aa58a6f54415cc.tar.bz2
llvm-0eab5c4d85b4c4bb161bcdd959aa58a6f54415cc.tar.xz
MCExpr: Add FindAssociatedSection, which attempts to mirror the 'as' semantics
that associate sections with expressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCExpr.h')
-rw-r--r--include/llvm/MC/MCExpr.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/MC/MCExpr.h b/include/llvm/MC/MCExpr.h
index fea5249eab..521fde6982 100644
--- a/include/llvm/MC/MCExpr.h
+++ b/include/llvm/MC/MCExpr.h
@@ -19,6 +19,7 @@ class MCAsmInfo;
class MCAsmLayout;
class MCAssembler;
class MCContext;
+class MCSection;
class MCSectionData;
class MCSymbol;
class MCValue;
@@ -92,6 +93,12 @@ public:
/// @result - True on success.
bool EvaluateAsRelocatable(MCValue &Res, const MCAsmLayout &Layout) const;
+ /// FindAssociatedSection - Find the "associated section" for this expression,
+ /// which is currently defined as the absolute section for constants, or
+ /// otherwise the section associated with the first defined symbol in the
+ /// expression.
+ const MCSection *FindAssociatedSection() const;
+
/// @}
static bool classof(const MCExpr *) { return true; }
@@ -420,6 +427,7 @@ public:
virtual bool EvaluateAsRelocatableImpl(MCValue &Res,
const MCAsmLayout *Layout) const = 0;
virtual void AddValueSymbols(MCAssembler *) const = 0;
+ virtual const MCSection *FindAssociatedSection() const = 0;
static bool classof(const MCExpr *E) {
return E->getKind() == MCExpr::Target;