[PATCH] D152785: [COFF] Support -gsplit-dwarf for COFF on Windows

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 21 10:59:18 PDT 2023


MaskRay requested changes to this revision.
MaskRay added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/include/clang/Driver/Options.td:1167
 // GCC style -dumpdir. We intentionally don't implement the less useful -dumpbase{,-ext}.
-def dumpdir : Separate<["-"], "dumpdir">, Flags<[CC1Option]>,
+def dumpdir : Separate<["-"], "dumpdir">, Flags<[CC1Option, CoreOption]>,
   MetaVarName<"<dumppfx>">,
----------------
HaohaiWen wrote:
> MaskRay wrote:
> > This exposes `-dumpdir ` to clang-cl which may not be useful.
> clang -gdwarf -gsplit-dwarf foo.cpp -o foo.exe -### will be expanded to
> clang -cc1 ... "-dumpdir" "foo.exe-" .... "-split-dwarf-file" "foo.exe-foo.dwo"
> 
> dwo name will be prefixed by dumpdir if it's specified.
> 
> This dumpdir is required for clang-cl to have same dwo filename behavior as clang.
CoreOption allows `-dumpdir` to be used with clang-cl. If you do this, I expect a driver test case.

clang-cl passes `-dumpdir` to clang -cc1. `-dumpdir` has the CC1Option flag, so `-cc1` accepts the option.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152785



More information about the cfe-commits mailing list