[PATCH] D137534: [C++20] [Modules] [ClangScanDeps] Allow clang-scan-deps to without specified compilation database in P1689 (3/3)

Ben Boeckel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 28 05:57:57 PST 2022


ben.boeckel added inline comments.


================
Comment at: clang/tools/clang-scan-deps/ClangScanDeps.cpp:197
+llvm::cl::opt<std::string> P1689TargetedCommand(
+    "p1689-targeted-command", llvm::cl::Optional,
+    llvm::cl::desc("Only supported for P1689, the targeted command of which "
----------------
ben.boeckel wrote:
> ChuanqiXu wrote:
> > ben.boeckel wrote:
> > > ChuanqiXu wrote:
> > > > ben.boeckel wrote:
> > > > > Can this be something like `--` so that I don't have to figure out how to quote the thing (for the shell and whatever parsing Clang does internally)?
> > > > Yeah, it can. Both `-` and `--` are accepted. I've updated the test to disambiguate.
> > > I don't mean the flag using `--` as a prefix. I don't care about that. What I *do* care about is having to quote everything I'd give to `clang` here. I'd vastly prefer something like:
> > > 
> > > ```
> > > clang-scan-deps -p1689-targeted-file-name=… -p1689-use-command -- -flags --for ---clang --go --here
> > > ```
> > I got your point. But I prefer the current style if it won't be a problem for you to quote the options. In my imagination, it would be easier for the build systems to quote the flags than we synthesis things here. I guess there should already be one existing command line in the build system. And I feel like the current style may be more convenient and friendly for other tools to use. Could you try to use the current style?
> I don't think CMake has a mechanism for that at all right now. The problem is knowing how to quote things. Is it specified how Clang will parse this string into arguments? Is it platform-dependent?
Ah, it is the same as the compilation database parsing.


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

https://reviews.llvm.org/D137534



More information about the cfe-commits mailing list