this enables us to map a group of headers to one header name,
e.g. headers from one directory can be mapped to the same header.
Details
Diff Detail
Event Timeline
include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp | ||
---|---|---|
16 | Can we make this a std::vector<std::pair<llvm::Regex, const char *>>? Creating llvm::Regex is somewhat expensive so we only want to do it once. We also never lookup into the postfix header map and only iterate over it so using a StringMap for it is wasteful. |
- Change RegexHeaderMap from StringMap to std::vector<std::pair<StringRef, StringRef>>.
include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp | ||
---|---|---|
16 | As per our offline discussion, copy constructor of llvm::Regex is deleted and the non-const match function prevents us from making the header map const. So we use std::vector<std::pair<StringRef, StringRef>> instead. |
If the regex construction turns out to be too slow we can fix it later. LGTM for now.
Can we make this a std::vector<std::pair<llvm::Regex, const char *>>? Creating llvm::Regex is somewhat expensive so we only want to do it once. We also never lookup into the postfix header map and only iterate over it so using a StringMap for it is wasteful.