[Mlir-commits] [clang] [flang] [mlir] [clang][flang][mlir] Support -frecord-command-line option (PR #102975)

Fangrui Song llvmlistbot at llvm.org
Mon Sep 16 17:56:53 PDT 2024


MaskRay wrote:

> > Why do we need the two new files?
> > We have clang/lib/Driver/ToolChains/CommonArgs.cpp and clang/lib/Driver/ToolChain.cpp for shared code.
> 
> Since most of the code in `CommonArgs.cpp` had to do with functions in the `clang::driver::tools` namespace, I wasn't sure that code that is only shared between `Clang.cpp` and `Flang.cpp` ought to go there. The other function that was moved is a utility function to escape arguments and was originally declared `static` in `Clang.cpp`.
> 
> If it is ok to use `CommandArgs.cpp` for limited sharing and utilities, I can move the code there.

Adding the shared code to `CommonArgs.cpp` LGTM. Shared functions there use `tools::`, though.

`rg driver:: clang/lib/Driver` reveals what files define `driver::` member functions. `CommonArgs.cpp` doesn't define `driver::`.

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


More information about the Mlir-commits mailing list