[llvm-commits] PATCH: clean up usage of the RelaxAll flag in MC

Eli Bendersky eliben at google.com
Tue Dec 11 08:38:01 PST 2012


>> It removes 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.
>
> Nice catch.
>
> How would you feel about replacing the if with
>
> assert(!getRelaxAll() && "MCInstFragment created unnecessarily");
>

I like asserts, but I would prefer to put this one higher in the call
tree. Say in relaxInstruction, or even in layoutSectionOnce when it
sees a FT_Inst fragment. What do you say?

Eli



More information about the llvm-commits mailing list