[clang] [clang-tools-extra] [Tooling] Resolve relative "directory" against the compilation database (PR #235400)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 4 21:38:56 PST 2026


================
@@ -409,19 +412,26 @@ bool JSONCompilationDatabase::parse(std::string &ErrorMessage) {
       ErrorMessage = "Missing key: \"directory\".";
       return false;
     }
+    SmallString<8> DirectoryStorage;
+    SmallString<128> DirectoryPath(Directory->getValue(DirectoryStorage));
----------------
MaskRay wrote:

Thanks for the suggestion! Added a one-entry cache `if (Directory->getRawValue() != PrevRawDirectory) {`

https://github.com/llvm/llvm-project/pull/235400


More information about the cfe-commits mailing list