This patch simplifies how we unify target features. Now we simply
iterate the input in reverse and only insert the feature if it hasn't
been seen yet. The only reason we need to reverse this at the end is to
keep the features in order for the existing tests.
Details
Details
- Reviewers
yaxunl jdoerfert tra - Commits
- rGc4a2674e21c4: [Clang] Simplify unifying target features
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Driver/ToolChains/CommonArgs.cpp | ||
---|---|---|
153 | Nit: You could use UnifiedFeatures.insert(UnifiedFeatures.begin(), Feature) and that would make the following std::reverse unnecessary. Up to you. |
Nit: You could use UnifiedFeatures.insert(UnifiedFeatures.begin(), Feature) and that would make the following std::reverse unnecessary. Up to you.
The code is not performance critical, so we don't care that we have to copy the elements.