[PATCH] D21787: [include-fixer] make HeaderMapCollector maps from regex instead of postfix.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 4 01:42:53 PDT 2016


bkramer added inline comments.

================
Comment at: include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp:16
@@ -15,2 +15,3 @@
 const HeaderMapCollector::HeaderMap *getSTLPostfixHeaderMap() {
   static const HeaderMapCollector::HeaderMap STLPostfixHeaderMap = {
+      {"include/__stddef_max_align_t.h$", "<cstddef>"},
----------------
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.


http://reviews.llvm.org/D21787





More information about the cfe-commits mailing list