[PATCH] D42475: [ELF] Add warnings for various symbols that cannot be ordered
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 7 18:20:07 PST 2018
George Rimar via Phabricator <reviews at reviews.llvm.org> writes:
> grimar added a comment.
>
> In https://reviews.llvm.org/D42475#1000525, @jhenderson wrote:
>
>> I haven't gone as far as @rafael suggested on the mailing list and moved everything back into the Writer (except for the reading in), since that seemed to be against what @ruiu and @grimar prefer. I'm happy with it either way.
>
>
> Thanks for update, Reporting duplicates during reading (with suggestion below) in Driver.cpp looks nice for me, though I have no very strong preference FWIW.
>
>
>
> ================
> Comment at: ELF/Driver.cpp:597
> +
> + std::vector<StringRef> Ret;
> + DenseSet<StringRef> Names;
> ----------------
> I guess this can be `SetVector<StringRef>` and then something like below should work:
>
>
> ```
> SetVector<StringRef> Names;
> for (StringRef S : args::getLines(*MB))
> if (!Names.insert(S).second && Config->WarnSymbolOrdering)
> warn("symbol ordering file: symbol '" + S + "' specified multiple times");
> return Names.takeVector();
> ```
I like the idea.
Thanks,
Rafael
More information about the llvm-commits
mailing list