Use references and simplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122405 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2010-12-22 16:11:57 +00:00
parent f01212489b
commit 33a38a1b5a
3 changed files with 5 additions and 8 deletions

View File

@ -90,7 +90,7 @@ public:
/// @param Res - The relocatable value, if evaluation succeeds.
/// @param Layout - The assembler layout object to use for evaluating values.
/// @result - True on success.
bool EvaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout = 0) const;
bool EvaluateAsRelocatable(MCValue &Res, const MCAsmLayout &Layout) const;
/// @}

View File

@ -215,7 +215,7 @@ bool MCAssembler::EvaluateFixup(const MCAsmLayout &Layout,
MCValue &Target, uint64_t &Value) const {
++stats::EvaluateFixup;
if (!Fixup.getValue()->EvaluateAsRelocatable(Target, &Layout))
if (!Fixup.getValue()->EvaluateAsRelocatable(Target, Layout))
report_fatal_error("expected relocatable expression");
// FIXME: How do non-scattered symbols work in ELF? I presume the linker

View File

@ -409,12 +409,9 @@ static bool EvaluateSymbolicAdd(const MCAssembler *Asm,
}
bool MCExpr::EvaluateAsRelocatable(MCValue &Res,
const MCAsmLayout *Layout) const {
if (Layout)
return EvaluateAsRelocatableImpl(Res, &Layout->getAssembler(), Layout,
0, false);
else
return EvaluateAsRelocatableImpl(Res, 0, 0, 0, false);
const MCAsmLayout &Layout) const {
return EvaluateAsRelocatableImpl(Res, &Layout.getAssembler(), &Layout,
0, false);
}
bool MCExpr::EvaluateAsRelocatableImpl(MCValue &Res,