[PATCH] D69822: [clang] Add new -fdebug-default-version flag.

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 4 14:08:12 PST 2019


dblaikie added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3247-3248
   }
+  else if (DefaultDWARFVersion != 0)
+    DWARFVersion = DefaultDWARFVersion;
 
----------------
cmtice wrote:
> dblaikie wrote:
> > Hmm, actually - why is this case necessary/what does it cover? I was hoping the case you added inside the "if (EmitDwarf)" case above would be all that was required (& the call to ParseDebugDefaultVersion would go inside there at the use, to reduce the variable scope/keep the code closer together).
> This covers the case where you are setting the default dwarf version without actually turning on/off debug info at all (there's no -gdwarf or -g option, so EmitDwarf is false).
Ah, perhaps I'm missing something - why should the DWARFVersion be set if EmitDwarf is false? No DWARF was requested, so the DWARFVersion probably shouldn't be set, I think?


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

https://reviews.llvm.org/D69822





More information about the cfe-commits mailing list