summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCExpr.h
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-12-18 03:57:21 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-12-18 03:57:21 +0000
commitd076482ab7e672d1d65a43809695e8d0d3995203 (patch)
tree1f274c9ddf8a3f4e316c4e8b7bbddcb5d26e64ea /include/llvm/MC/MCExpr.h
parent390482569c2446a05518034c891fcfb378079a80 (diff)
downloadllvm-d076482ab7e672d1d65a43809695e8d0d3995203.tar.gz
llvm-d076482ab7e672d1d65a43809695e8d0d3995203.tar.bz2
llvm-d076482ab7e672d1d65a43809695e8d0d3995203.tar.xz
Revert 122011, 122012, 122013, 122023 adding back an important optimization.
I added a note, but suggestions on how to add a test are really welcome. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122138 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCExpr.h')
-rw-r--r--include/llvm/MC/MCExpr.h24
1 files changed, 9 insertions, 15 deletions
diff --git a/include/llvm/MC/MCExpr.h b/include/llvm/MC/MCExpr.h
index 55e3f46a89..da3cebe414 100644
--- a/include/llvm/MC/MCExpr.h
+++ b/include/llvm/MC/MCExpr.h
@@ -44,12 +44,14 @@ private:
MCExpr(const MCExpr&); // DO NOT IMPLEMENT
void operator=(const MCExpr&); // DO NOT IMPLEMENT
- bool EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout *Layout,
+ bool EvaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
+ const MCAsmLayout *Layout,
const SectionAddrMap *Addrs) const;
protected:
explicit MCExpr(ExprKind _Kind) : Kind(_Kind) {}
- bool EvaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout,
+ bool EvaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
+ const MCAsmLayout *Layout,
const SectionAddrMap *Addrs,
bool InSet) const;
public:
@@ -76,16 +78,11 @@ public:
/// values. If not given, then only non-symbolic expressions will be
/// evaluated.
/// @result - True on success.
- bool EvaluateAsAbsolute(int64_t &Res) const {
- return EvaluateAsAbsolute(Res, 0, 0);
- }
- bool EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout) const{
- return EvaluateAsAbsolute(Res, &Layout, 0);
- }
+ bool EvaluateAsAbsolute(int64_t &Res) const;
+ bool EvaluateAsAbsolute(int64_t &Res, const MCAssembler &Asm) const;
+ bool EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout) const;
bool EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout &Layout,
- const SectionAddrMap &Addrs) const {
- return EvaluateAsAbsolute(Res, &Layout, &Addrs);
- }
+ const SectionAddrMap &Addrs) const;
/// EvaluateAsRelocatable - Try to evaluate the expression to a relocatable
/// value, i.e. an expression of the fixed form (a - b + constant).
@@ -93,10 +90,7 @@ public:
/// @param Res - The relocatable value, if evaluation succeeds.
/// @param Layout - The assembler layout object to use for evaluating values.
/// @result - True on success.
- bool EvaluateAsRelocatable(MCValue &Res,
- const MCAsmLayout *Layout = 0) const {
- return EvaluateAsRelocatableImpl(Res, Layout, 0, false);
- }
+ bool EvaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout = 0) const;
/// @}