[clang] [clang-tools-extra] [Tooling] Resolve tool names from PATH in CommonOptionsParser (PR #213681)
Zeyi Xu via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 3 07:20:25 PDT 2026
================
@@ -139,6 +139,7 @@ llvm::Error CommonOptionsParser::init(
new FixedCompilationDatabase(".", std::vector<std::string>()));
}
}
+ Compilations = inferToolLocation(std::move(Compilations));
----------------
zeyi2 wrote:
I read the [Compilation Database Format Spec](https://clang.llvm.org/docs/JSONCompilationDatabase.html):
> command: The compile command as a single shell-escaped string. Arguments may be shell quoted and escaped following platform conventions, with ‘"’ and ‘\’ being the only special characters. Shell expansion is not supported.
The specification does not explicitly require `PATH` lookup for the `command` field. However, `arguments` is defined as suitable for `execvp()`, which resolves bare tool names through `PATH`. Since both fields represent the same compilation, resolving them consistently seems reasonable.
https://github.com/llvm/llvm-project/pull/213681
More information about the cfe-commits
mailing list