[clang] [clang-cl] Accept `cl`-style output arguments (`/Fo`, `-Fo`) for `--precompile` (PR #121046)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Thu May 15 07:11:27 PDT 2025


ChuanqiXu9 wrote:

> Sorry, I don't remember seeing that discussion, and I'm probably missing lots of modules context. As a counter argument, clang-cl uses `/Yc` and `/Fp` to generate PCH files, to match MSVC's interface although the file format is different.
> 
> More importantly, it feels like we're being very unintentional about the interface design here. Why should clang-cl's `/Fo` name a BMI file if that's not what MSVC does, and the document clearly says that the flag "Specifies an object (.obj) file name or directory to be used instead of the default."?
> 
> If the idea is to punt on the design, maybe the solution is just to use regular clang flags for this?

although I don't use MSVC. I think '/Fo' is basically '-o'. Its semantic is to specify the path to the output file. And with '--precompile' the output file is BMI. And with '-c', the output is obj files. And with '-emit-llvm', the output is llvm ir. So I feel it is fine.

But of course, all of these are my thoughts and imagination. I am never a clang-cl user ever. So if now clang-cl can accept '-o', I don't mind to use that if @mathstuf agrees on this. Since most end users won't write this in my mind. The build system are the major users here.

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


More information about the cfe-commits mailing list