Make getBaseSymbol non recursive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207759 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-05-01 13:09:42 +00:00
parent 1b68a68c04
commit 68a7a88223

View File

@ -585,16 +585,18 @@ static const MCSymbol *getBaseSymbol(const MCAsmLayout &Layout,
MCValue Value;
if (!Expr->EvaluateAsValue(Value, &Layout))
llvm_unreachable("Invalid Expression");
const MCSymbolRefExpr *RefB = Value.getSymB();
if (RefB) {
if (RefB)
Layout.getAssembler().getContext().FatalError(
SMLoc(), Twine("symbol '") + RefB->getSymbol().getName() +
"' could not be evaluated in a subtraction expression");
}
const MCSymbolRefExpr *A = Value.getSymA();
if (!A)
return nullptr;
return getBaseSymbol(Layout, A->getSymbol());
return &A->getSymbol();
}
void ELFObjectWriter::WriteSymbol(SymbolTableWriter &Writer, ELFSymbolData &MSD,