[PATCH] D51088: [clangd] Get rid of regexes in CanonicalIncludes
Eric Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 22 04:17:24 PDT 2018
ioeric added inline comments.
================
Comment at: clangd/index/CanonicalIncludes.h:44
/// Maps all files matching \p RE to \p CanonicalPath
- void addRegexMapping(llvm::StringRef RE, llvm::StringRef CanonicalPath);
+ void addSuffixMapping(llvm::StringRef Suffix, llvm::StringRef CanonicalPath);
----------------
It seems that this is only file path suffix matching (by components) now. We should probably rename the function to be explicit.
================
Comment at: clangd/index/CanonicalIncludes.h:62
+ llvm::StringMap<std::string> SuffixHeaderMapping;
+ /// Maximum number of path components stored in a key of SuffixHeaderMapping.
+ int MaxSuffixComponents = 0;
----------------
It might be worth documenting why this is useful (i.e. the optimization).
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D51088
More information about the cfe-commits
mailing list