[PATCH] D24516: [Driver][Diagnostics] Make 'show option names' default for driver warnings

Vedant Kumar via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 10 14:54:56 PDT 2016


vsk added inline comments.


================
Comment at: lib/Frontend/CompilerInvocation.cpp:965
+  Opts.ShowOptionNames = Args.hasArg(OPT_fdiagnostics_show_option) ||
+      (DefaultShowOpt && !Args.hasArg(OPT_fno_diagnostics_show_option));
 
----------------
Does it make sense to use: hasFlag (OptSpecifier Pos, OptSpecifier Neg, bool Default=DefaultShowOpt) ? This might take care of an edge case where both show_option and no_show_option are specified -- the last flag passed should win out.


================
Comment at: test/Driver/show-option-names.c:4
+// RUN: %clang -c -target i386-apple-darwin10 -fno-diagnostics-show-option -isysroot /FOO %s 2>&1 | FileCheck --check-prefix=CHECK-NO-SHOW-OPTION-NAMES %s
+// CHECK-NO-SHOW-OPTION-NAMES-NOT: warning: no such sysroot directory: '{{([A-Za-z]:.*)?}}/FOO' [-Wmissing-sysroot]
----------------
Can you split this into two checks? One to check that the warning appear, and another to check that the option isn't printed.


https://reviews.llvm.org/D24516





More information about the cfe-commits mailing list