From 293a7c184007acfe584e159adee491c85e0bbdd4 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sat, 18 Dec 2010 04:19:20 +0000 Subject: [PATCH] Add a FIXME and explain a hack. llvm-svn: 122144 --- llvm/lib/MC/MCExpr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp index 8c24ce5d6b8b..3533da2cf646 100644 --- a/llvm/lib/MC/MCExpr.cpp +++ b/llvm/lib/MC/MCExpr.cpp @@ -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