[PATCH] D42475: [ELF] Add warnings for various symbols that cannot be ordered
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 7 07:43:35 PST 2018
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();
```
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D42475
More information about the llvm-commits
mailing list