This makes the code cleaner and adds some coverage for invalid flags being passed as -z <unknown flag>. Almost an NFC change but just wanted to confirm.
Details
Diff Detail
- Repository
- rLLD LLVM Linker
Event Timeline
No regressions in ELF test suite and test runs just fine:
=> ninja check-lld-elf [0/1] Running lit suite /q/src/llvm-taint-8.0/tools/lld/test/ELF Testing Time: 9.32s Expected Passes : 1054 Unsupported Tests : 332
Thank you for the patch. But honestly I wouldn't do this personally because the former code only depends on the usual equality check while the new code uses SmallDenseSet which is undeniably (slightly) more complicated than the comparison. From the perspective of code readability, I don't think there's too much difference, it's perhaps a matter of taste. So I think I prefer code that is simple, which is perhaps too simple that it sometimes even looks a bit stupid.
Shall I fully abandon the revision or want me to leave the test for unknown flag failure in? (Unless one already exists and I missed it, additional coverage can't hurt regardless)
Well, I do like the general idea. I would go with a sorted static array and a binary search though. This is not really time critical, but the array version would be smaller in terms of code without involving run-time allocations.