[PATCH] D103142: [clang][clangd] Use reverse header map lookup in suggestPathToFileForDiagnostics
Dmitry Polukhin via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 1 00:55:06 PDT 2021
DmitryPolukhin added inline comments.
================
Comment at: clang/lib/Lex/HeaderMap.cpp:245
+StringRef HeaderMapImpl::reverseLookupFilename(StringRef DestPath) const {
+ if (ReverseMap.empty()) {
+ const HMapHeader &Hdr = getHeader();
----------------
bruno wrote:
> Please rewrite this to early return in case this isn't empty.
Done, but it causes a bit of code duplication due to second lookup. Please let me know if you thought about rewriting it somehow else.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103142/new/
https://reviews.llvm.org/D103142
More information about the cfe-commits
mailing list