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

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 5 12:57:11 PST 2019


MaskRay added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3237
 
+    // If the user specified a default DWARF version, that takes precedence
+    // over the platform default.
----------------
    lang=cpp
    if (DefaultDWARFVersion) {
      // If the user specified a default DWARF version, that takes precedence
      // over the platform default.
      DWARFVersion = DefaultDWARFVersion;
    } else {
      // Start with the platform default DWARF version.
      DWARFVersion = TC.GetDefaultDwarfVersion();
      assert(DWARFVersion && "toolchain default DWARF version must be nonzero");
    }



================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6171
+
+  if (DwarfVersion == 0)
+    DwarfVersion = ParseDwarfDefaultVersion(getToolChain(), Args);
----------------
  lang=cpp
  if (DwarfVersion == 0) {
    DwarfVersion = ParseDwarfDefaultVersion(getToolChain(), Args);
    if (DwarfVersion == 0)
      DwarfVersion = getToolChain().GetDefaultDwarfVersion();
  }

This part constructs a -cc1as command line. It is not covered by a test. Can you add one?


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

https://reviews.llvm.org/D69822





More information about the cfe-commits mailing list