[clang] [clang-cl] Allow a colon after /Fo option (PR #87209)

Max Winkler via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 31 18:59:55 PDT 2024


MaxEW707 wrote:

@rnk for review.

LGTM!

>From experience with msvc the docs are very much outdated. For example almost all path options accept the `:` form.
For example `/Fd:` is valid even though the msdn docs do not state that. https://learn.microsoft.com/en-us/cpp/build/reference/fd-program-database-file-name?view=msvc-170.
Try out the following and it works, `cl.exe /std:c++17 /Fo:test.obj /Fd:test.pdb /Zi /c test.cpp`.

Thankfully from memory VS2019+ `/?` lists all the options that accept a colon form.
The output of msvc 1939 `/?` shows the following:
```
/Fd: <file> name .PDB file              /Fe: <file> name executable file
/Fm: <file> name map file               /Fo: <file> name object file
/Fp: <file> name .PCH file              /FR: <file> name extended .SBR file
/Fi: <file> name preprocessed file
```
showing that these options do in fact accept the colon form even though MSDN is outdated.

I think it would be super appreciated if we can fix all instances where clang-cl fails to accept the colon form for any non-ignored options that are supported if you got the time. If not no worries it was on my backlog anyways when I get time heh :).


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


More information about the cfe-commits mailing list