[PATCH] D124262: compile commands header to source heuristic lower-cases filenames before inferring file types

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 25 05:50:14 PDT 2022


sammccall added a comment.

Change looks good, thank you!

Can you add a test demonstrating it, and update the diff here?
Take a look at the `InterpolateTest` cases in `clang/unittests/Tooling/CompilationDatabaseTest.cpp`.

(If you can, please create diffs with context using `-U99999` - this lets us see more context around the changed lines in phabricator)



================
Comment at: clang/lib/Tooling/InterpolatingCompilationDatabase.cpp:332
       Paths.emplace_back(Path, I);
-      Types.push_back(foldType(guessType(Path)));
+      Types.push_back(foldType(guessType(StringRef(OriginalPaths[I]))));
       Stems.emplace_back(sys::path::stem(Path), I);
----------------
nit: StringRef() isn't needed here, conversion will happen implicitly.

(The one on 329 is needed because the overload set of StringSaver::save is ambiguous)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124262/new/

https://reviews.llvm.org/D124262



More information about the cfe-commits mailing list