[clang] 83feaa3 - [clang-cl] make -f(no-)ident a CoreOption

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 1 08:55:52 PST 2021


Author: Nico Weber
Date: 2021-03-01T11:53:51-05:00
New Revision: 83feaa36ad53ce93ed808169d3316ed757703e47

URL: https://github.com/llvm/llvm-project/commit/83feaa36ad53ce93ed808169d3316ed757703e47
DIFF: https://github.com/llvm/llvm-project/commit/83feaa36ad53ce93ed808169d3316ed757703e47.diff

LOG: [clang-cl] make -f(no-)ident a CoreOption

On clang emits the compiler version string into debug information
by default for both dwarf and codeview. That makes compiler output
needlessly compiler-version-dependent which makes e.g. comparing
object file outputs during a bisect hard. So it's nice if there's
an easy way to turn this off.

(On ELF, this flag also controls the .comment section, but that
part is ELF-only. The debug-info bit isn't.)

Differential Revision: https://reviews.llvm.org/D97695

Added: 
    

Modified: 
    clang/include/clang/Driver/Options.td
    clang/test/Driver/cl-options.c

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index c34c371197c3..f4da19324f02 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -669,8 +669,10 @@ def Qy : Flag<["-"], "Qy">, Flags<[CC1Option]>,
   HelpText<"Emit metadata containing compiler name and version">;
 def Qn : Flag<["-"], "Qn">, Flags<[CC1Option]>,
   HelpText<"Do not emit metadata containing compiler name and version">;
-def : Flag<["-"], "fident">, Group<f_Group>, Alias<Qy>, Flags<[CC1Option]>;
-def : Flag<["-"], "fno-ident">, Group<f_Group>, Alias<Qn>, Flags<[CC1Option]>;
+def : Flag<["-"], "fident">, Group<f_Group>, Alias<Qy>,
+  Flags<[CoreOption, CC1Option]>;
+def : Flag<["-"], "fno-ident">, Group<f_Group>, Alias<Qn>,
+  Flags<[CoreOption, CC1Option]>;
 def Qunused_arguments : Flag<["-"], "Qunused-arguments">, Flags<[NoXarchOption, CoreOption]>,
   HelpText<"Don't emit warning for unused driver arguments">;
 def Q : Flag<["-"], "Q">, IgnoredGCCCompat;

diff  --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c
index eb340a40421b..0e07ea49e4b8 100644
--- a/clang/test/Driver/cl-options.c
+++ b/clang/test/Driver/cl-options.c
@@ -639,6 +639,8 @@
 // RUN:     -fdiagnostics-parseable-fixits \
 // RUN:     -fdiagnostics-absolute-paths \
 // RUN:     -ferror-limit=10 \
+// RUN:     -fident \
+// RUN:     -fno-ident \
 // RUN:     -fmsc-version=1800 \
 // RUN:     -fno-strict-aliasing \
 // RUN:     -fstrict-aliasing \


        


More information about the cfe-commits mailing list