[PATCH] D33680: [ELF] - Resolve references properly when using .symver directive

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 11:53:20 PDT 2017


Rafael Avila de Espindola <rafael.espindola at gmail.com> writes:

> George Rimar via Phabricator <reviews at reviews.llvm.org> writes:
>
>>> You can do
>>> 
>>>   for (size_t I = 0; I < SymVector.size(); ++I)
>>> 
>>> to remove `DefaultV`, no?
>> Yes, I tried something like that too when wrote it. I just found that its looks close to
>> mutating arguments. When you debug a loop it is probably easier to understand logic when
>> it's end is static. Having something like temp vector it is not ideal, but I would prefer to have temp vector than
>> mutate loop bound probably.
>
> I think that removing DefaultV and having a comment on why we call
> size() on each iteration is probably the best.

Actually, since we just push_back, we can just use

 for (size_t I = 0, N = SymVector.size(); I < N; ++I)

no?

Cheers,
Rafael


More information about the llvm-commits mailing list