Add a FIXME and explain a hack.
authorRafael Espindola <rafael.espindola@gmail.com>
Sat, 18 Dec 2010 04:19:20 +0000 (04:19 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sat, 18 Dec 2010 04:19:20 +0000 (04:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122144 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCExpr.cpp

index 8c24ce5d6b8b8537f9355c0baaefe4a9853b5547..3533da2cf646e7883923fb1a2a1ac041e878468f 100644 (file)
@@ -267,7 +267,10 @@ bool MCExpr::EvaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm,
     return true;
   }
 
-  if (!EvaluateAsRelocatableImpl(Value, Asm, Layout, Addrs, Addrs) ||
+  // 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