================
@@ -292,9 +292,10 @@ class AnalyzerOptions {
#undef ANALYZER_OPTION_DEPENDS_ON_USER_MODE
bool isUnknownAnalyzerConfig(llvm::StringRef Name) {
- static std::vector<llvm::StringLiteral> AnalyzerConfigCmdFlags = []() {
- // Create an array of all -analyzer-config command line options.
- std::vector<llvm::StringLiteral> AnalyzerConfigCmdFlags = {
+ static const std::vector<llvm::StringLiteral> AnalyzerConfigCmdFlags =
----------------
steffenlarsen wrote:
Always ready to go the extra mile! Because we still need to do the sorting at
runtime, a C-style array would be a little tricky, but I've made it a
`std::array`. It doesn't reduce the complexity a lot, but it should hopefully
be better as we should avoid the heap allocation associated with vectors, so a
net positive either way I think. 🚀
https://github.com/llvm/llvm-project/pull/183478
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits