diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-22 22:16:24 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-22 22:16:24 +0000 |
commit | 10b6d33581400ec1a0c09f7719ccc3dc1903c27d (patch) | |
tree | 60137d8ee5536ec0963d85da98a8b9729ca05e37 /lib/MC/MCExpr.cpp | |
parent | df3ee64d791624bf28ac3e6820bf8fdd17f1bff1 (diff) |
Add r122359 back now that the bug in MCDwarfLineAddrFragment fragment has been
fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCExpr.cpp')
-rw-r--r-- | lib/MC/MCExpr.cpp | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp index 8fdf837833..58f2e94dd6 100644 --- a/lib/MC/MCExpr.cpp +++ b/lib/MC/MCExpr.cpp @@ -269,27 +269,13 @@ bool MCExpr::EvaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm, // FIXME: The use if InSet = Addrs is a hack. Setting InSet causes us // absolutize differences across sections and that is what the MachO writer // uses Addrs for. - if (!EvaluateAsRelocatableImpl(Value, Asm, Layout, Addrs, /*InSet*/ Addrs) || - !Value.isAbsolute()) { - // EvaluateAsAbsolute is defined to return the "current value" of - // the expression if we are given a Layout object, even in cases - // when the value is not fixed. - if (Layout) { - Res = Value.getConstant(); - if (Value.getSymA()) { - Res += Layout->getSymbolOffset( - &Layout->getAssembler().getSymbolData(Value.getSymA()->getSymbol())); - } - if (Value.getSymB()) { - Res -= Layout->getSymbolOffset( - &Layout->getAssembler().getSymbolData(Value.getSymB()->getSymbol())); - } - } - return false; - } + bool IsRelocatable = + EvaluateAsRelocatableImpl(Value, Asm, Layout, Addrs, /*InSet*/ Addrs); + // Record the current value. Res = Value.getConstant(); - return true; + + return IsRelocatable && Value.isAbsolute(); } /// \brief Helper method for \see EvaluateSymbolAdd(). |