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

Paul Robinson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 4 14:44:52 PST 2019


probinson added inline comments.


================
Comment at: clang/include/clang/Driver/Options.td:2002
 def gno_codeview_ghash : Flag<["-"], "gno-codeview-ghash">, Flags<[CoreOption]>;
+
 def ginline_line_tables : Flag<["-"], "ginline-line-tables">, Flags<[CoreOption]>;
----------------
Unexpected blank line here.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3237
 
+    // If the user specified a default DWARF version, that takes precedent over
+    // the platform default.
----------------
precedence


================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:1151
+      || Value > 5
+      || Value < 1)
+    TC.getDriver().Diag(diag::err_drv_invalid_int_value)
----------------
Clang doesn't support DWARF v1.  I expect nobody does at this point (DWARF 2 came out in 1993).


================
Comment at: clang/test/CodeGen/debug-default-version.c:1
+// RUN: %clang -target x86_64-linux-gnu -fdebug-default-version=4 -gdwarf-2 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2
+// RUN: %clang -target x86_64-linux-gnu -gdwarf-3 -fdebug-default-version=4 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER3
----------------
MaskRay wrote:
> This looks like a clangDriver change. Maybe move the test to test/Driver ?
+1.  It should be sufficient to use `-###` and check what gets passed as cc1 options.


================
Comment at: clang/test/CodeGen/debug-default-version.c:24
+// disables codeview, of you can explicitly ask for both if you don't know how
+// the app will be debugged.
+// RUN: %clang -target i686-pc-windows-msvc -fdebug-default-version=2 -gdwarf -S -emit-llvm -o - %s \
----------------
Does that actually work?  Last I checked, DWARF and COFF didn't play nicely, but I admit that was quite a while ago.


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

https://reviews.llvm.org/D69822





More information about the cfe-commits mailing list