[llvm] r369337 - [MC] Delete an overload of MCExpr::evaluateKnownAbsolute and its associated hack
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 20 00:42:05 PDT 2019
Author: maskray
Date: Tue Aug 20 00:42:04 2019
New Revision: 369337
URL: http://llvm.org/viewvc/llvm-project?rev=369337&view=rev
Log:
[MC] Delete an overload of MCExpr::evaluateKnownAbsolute and its associated hack
The hack dated back to 2010 (r121076) and was documented by r122144:
// 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.
Modified:
llvm/trunk/include/llvm/MC/MCExpr.h
llvm/trunk/lib/MC/MCExpr.cpp
Modified: llvm/trunk/include/llvm/MC/MCExpr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCExpr.h?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCExpr.h (original)
+++ llvm/trunk/include/llvm/MC/MCExpr.h Tue Aug 20 00:42:04 2019
@@ -48,10 +48,6 @@ private:
bool evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
const MCAsmLayout *Layout,
- const SectionAddrMap *Addrs) const;
-
- bool evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
- const MCAsmLayout *Layout,
const SectionAddrMap *Addrs, bool InSet) const;
protected:
Modified: llvm/trunk/lib/MC/MCExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=369337&r1=369336&r2=369337&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCExpr.cpp (original)
+++ llvm/trunk/lib/MC/MCExpr.cpp Tue Aug 20 00:42:04 2019
@@ -453,26 +453,28 @@ void MCTargetExpr::anchor() {}
/* *** */
bool MCExpr::evaluateAsAbsolute(int64_t &Res) const {
- return evaluateAsAbsolute(Res, nullptr, nullptr, nullptr);
+ return evaluateAsAbsolute(Res, nullptr, nullptr, nullptr, false);
}
bool MCExpr::evaluateAsAbsolute(int64_t &Res,
const MCAsmLayout &Layout) const {
- return evaluateAsAbsolute(Res, &Layout.getAssembler(), &Layout, nullptr);
+ return evaluateAsAbsolute(Res, &Layout.getAssembler(), &Layout, nullptr, false);
}
bool MCExpr::evaluateAsAbsolute(int64_t &Res,
const MCAsmLayout &Layout,
const SectionAddrMap &Addrs) const {
- return evaluateAsAbsolute(Res, &Layout.getAssembler(), &Layout, &Addrs);
+ // Setting InSet causes us to absolutize differences across sections and that
+ // is what the MachO writer uses Addrs for.
+ return evaluateAsAbsolute(Res, &Layout.getAssembler(), &Layout, &Addrs, true);
}
bool MCExpr::evaluateAsAbsolute(int64_t &Res, const MCAssembler &Asm) const {
- return evaluateAsAbsolute(Res, &Asm, nullptr, nullptr);
+ return evaluateAsAbsolute(Res, &Asm, nullptr, nullptr, false);
}
bool MCExpr::evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm) const {
- return evaluateAsAbsolute(Res, Asm, nullptr, nullptr);
+ return evaluateAsAbsolute(Res, Asm, nullptr, nullptr, false);
}
bool MCExpr::evaluateKnownAbsolute(int64_t &Res,
@@ -482,15 +484,6 @@ bool MCExpr::evaluateKnownAbsolute(int64
}
bool MCExpr::evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
- const MCAsmLayout *Layout,
- const SectionAddrMap *Addrs) const {
- // 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.
- return evaluateAsAbsolute(Res, Asm, Layout, Addrs, Addrs);
-}
-
-bool MCExpr::evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
const MCAsmLayout *Layout,
const SectionAddrMap *Addrs, bool InSet) const {
MCValue Value;
More information about the llvm-commits
mailing list