diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-06-30 22:49:27 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-06-30 22:49:27 +0000 |
commit | f7792a99b0ae87f766c634d69a76a5d05f264722 (patch) | |
tree | df30b84227f0b63cafb7a47eaa200521d7f5bb9b /tools | |
parent | 25a8ae3f10965b47ecaa9eda5e997f16fe1d9414 (diff) | |
download | external_llvm-f7792a99b0ae87f766c634d69a76a5d05f264722.zip external_llvm-f7792a99b0ae87f766c634d69a76a5d05f264722.tar.gz external_llvm-f7792a99b0ae87f766c634d69a76a5d05f264722.tar.bz2 |
llvm-mc: Symbols in a relocatable expression of the (a - b + cst) form are
allowed to be undefined when the expression is seen, we cannot enforce the
same-section requirement until the entire assembly file has been seen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74565 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-mc/AsmExpr.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/llvm-mc/AsmExpr.cpp b/tools/llvm-mc/AsmExpr.cpp index 3c19be3..4b32b92 100644 --- a/tools/llvm-mc/AsmExpr.cpp +++ b/tools/llvm-mc/AsmExpr.cpp @@ -37,12 +37,11 @@ static bool EvaluateSymbolicAdd(const MCValue &LHS, MCSymbol *RHS_A, MCSymbol *A = LHS.getSymA() ? LHS.getSymA() : RHS_A; MCSymbol *B = LHS.getSymB() ? LHS.getSymB() : RHS_B; if (B) { - // If we have a negated symbol, then we must have also have a - // non-negated symbol, and both symbols must be in the same - // non-external section. We can do this check later to permit - // expressions which eventually fold to a representable form -- such + // If we have a negated symbol, then we must have also have a non-negated + // symbol in order to encode the expression. We can do this check later to + // permit expressions which eventually fold to a representable form -- such // as (a + (0 - b)) -- if necessary. - if (!A || !A->getSection() || A->getSection() != B->getSection()) + if (!A) return false; } Res = MCValue::get(A, B, LHS.getConstant() + RHS_Cst); |