[lld] r292359 - [ELF] Move createThunks() after scanRelocations()

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 02:49:00 PST 2017


Thanks for the comments,

I've got a follow up patch coming shortly to convert Thunks to using
synthetic sections, it involves touching this area and I can address
these then if its ok?

Peter

On 18 January 2017 at 22:09, Rafael Avila de Espindola
<rafael.espindola at gmail.com> wrote:
> Peter Smith via llvm-commits <llvm-commits at lists.llvm.org> writes:
>> +template <class ELFT>
>> +void createThunks(ArrayRef<OutputSectionBase *> OutputSections) {
>> +  for (OutputSectionBase *Base : OutputSections) {
>> +    if (auto *OS = dyn_cast<OutputSection<ELFT>>(Base)) {
>
> Invert the if and early return maybe?
>
>> +      for (InputSection<ELFT> *IS : OS->Sections) {
>> +        for (const Relocation &Rel : IS->Relocations) {
>> +          if (Rel.Sym == nullptr) {
>> +            continue;
>> +          }
>
> You don't need the {}.
>
>> +          if (!isPreemptible(Body, Type) && needsPlt(Expr))
>> +            Expr = fromPlt(Expr);
>> +          Expr = Target->getThunkExpr(Expr, Type, IS->getFile(), Body);
>
> Are these lines still needed now that the code was moved? All tests pass
> if I delete them.
>
>
> Cheers,
> Rafael


More information about the llvm-commits mailing list