Remove the RelaxAll overrule in MCAssembler::fixupNeedsRelaxation,

because that method is only getting called for MCInstFragment. These
fragments aren't even generated when RelaxAll is set, which is why the
flag reference here is superfluous. Removing it simplifies the code
with no harmful effects.

An assertion is added higher up to make sure this path is never
reached.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169886 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eli Bendersky
2012-12-11 17:16:00 +00:00
parent 0439f3e0cf
commit 37a9830d20

View File

@ -657,9 +657,6 @@ void MCAssembler::Finish() {
bool MCAssembler::fixupNeedsRelaxation(const MCFixup &Fixup, bool MCAssembler::fixupNeedsRelaxation(const MCFixup &Fixup,
const MCInstFragment *DF, const MCInstFragment *DF,
const MCAsmLayout &Layout) const { const MCAsmLayout &Layout) const {
if (getRelaxAll())
return true;
// If we cannot resolve the fixup value, it requires relaxation. // If we cannot resolve the fixup value, it requires relaxation.
MCValue Target; MCValue Target;
uint64_t Value; uint64_t Value;
@ -780,6 +777,8 @@ bool MCAssembler::layoutSectionOnce(MCAsmLayout &Layout, MCSectionData &SD) {
default: default:
break; break;
case MCFragment::FT_Inst: case MCFragment::FT_Inst:
assert(!getRelaxAll() &&
"Did not expect a MCInstFragment in RelaxAll mode");
RelaxedFrag = relaxInstruction(Layout, *cast<MCInstFragment>(I)); RelaxedFrag = relaxInstruction(Layout, *cast<MCInstFragment>(I));
break; break;
case MCFragment::FT_Dwarf: case MCFragment::FT_Dwarf: