[PATCH] D52296: [Clang] - Add -fdwarf-fission=split,single option.

Paul Robinson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 8 11:42:52 PST 2018


probinson added inline comments.


================
Comment at: lib/Driver/ToolChains/Clang.cpp:5889
   const llvm::Triple &T = getToolChain().getTriple();
-  if (Args.hasArg(options::OPT_gsplit_dwarf) &&
+  if ((getDebugFissionKind(D, Args) == DwarfFissionKind::Split) &&
       (T.isOSLinux() || T.isOSFuchsia())) {
----------------
grimar wrote:
> dblaikie wrote:
> > Could having more than one call to getDebugFissionKind lead to the error message (for -fdwarf-fission=garbage) being printed multiple times? Or is this call on a distinct/mutually exclusive codepath to the other?
> I think it should not be possible. Currently, there are 2 inclusions of the `getDebugFissionKind `. One is used for construction clang job,
> and one is here, it is used to construct an assembler tool job. I do not see a way how it can be printed multiple times.
> 
> For example, the following invocation will print it only once:
> 
> ```
> clang main.c -o out.s -S -fdwarf-fission=foo
> clang-8: error: unsupported argument 'foo' to option 'fdwarf-fission='
> ```
The example you give here will not create an assembler job. Try
`clang main.c -fdwarf-fission=foo -fno-integrated-as` which I think will exercise the path David is asking about.


https://reviews.llvm.org/D52296





More information about the cfe-commits mailing list