This revision was automatically updated to reflect the committed changes.
Closed by commit rL242606: Silence the driver warnings, if we see "-w" on the 
Driver. (authored by filcab).

Changed prior to commit:
  http://reviews.llvm.org/D11322?vs=30059&id=30073#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D11322

Files:
  cfe/trunk/lib/Driver/Driver.cpp
  cfe/trunk/test/Index/warning-flags.c

Index: cfe/trunk/lib/Driver/Driver.cpp
===================================================================
--- cfe/trunk/lib/Driver/Driver.cpp
+++ cfe/trunk/lib/Driver/Driver.cpp
@@ -387,6 +387,9 @@
 
   InputArgList Args = ParseArgStrings(ArgList.slice(1));
 
+  // Silence driver warnings if requested
+  Diags.setIgnoreAllWarnings(Args.hasArg(options::OPT_w));
+
   // -no-canonical-prefixes is used very early in main.
   Args.ClaimAllArgs(options::OPT_no_canonical_prefixes);
 
Index: cfe/trunk/test/Index/warning-flags.c
===================================================================
--- cfe/trunk/test/Index/warning-flags.c
+++ cfe/trunk/test/Index/warning-flags.c
@@ -7,6 +7,7 @@
 // RUN: c-index-test -test-load-source-reparse 5 all -Wno-return-type %s 
2>&1|FileCheck -check-prefix=CHECK-SECOND-WARNING %s
 // RUN: c-index-test -test-load-source all -w %s 2>&1|not grep warning:
 // RUN: c-index-test -test-load-source-reparse 5 all -w %s 2>&1|not grep 
warning:
+// RUN: c-index-test -test-load-source all -w -O4 %s 2>&1|not grep warning:
 
 // CHECK-BOTH-WARNINGS: warning: control reaches end of non-void function
 // CHECK-BOTH-WARNINGS: warning: incompatible pointer types returning 'float 
*' from a function with result type 'int *'


Index: cfe/trunk/lib/Driver/Driver.cpp
===================================================================
--- cfe/trunk/lib/Driver/Driver.cpp
+++ cfe/trunk/lib/Driver/Driver.cpp
@@ -387,6 +387,9 @@
 
   InputArgList Args = ParseArgStrings(ArgList.slice(1));
 
+  // Silence driver warnings if requested
+  Diags.setIgnoreAllWarnings(Args.hasArg(options::OPT_w));
+
   // -no-canonical-prefixes is used very early in main.
   Args.ClaimAllArgs(options::OPT_no_canonical_prefixes);
 
Index: cfe/trunk/test/Index/warning-flags.c
===================================================================
--- cfe/trunk/test/Index/warning-flags.c
+++ cfe/trunk/test/Index/warning-flags.c
@@ -7,6 +7,7 @@
 // RUN: c-index-test -test-load-source-reparse 5 all -Wno-return-type %s 2>&1|FileCheck -check-prefix=CHECK-SECOND-WARNING %s
 // RUN: c-index-test -test-load-source all -w %s 2>&1|not grep warning:
 // RUN: c-index-test -test-load-source-reparse 5 all -w %s 2>&1|not grep warning:
+// RUN: c-index-test -test-load-source all -w -O4 %s 2>&1|not grep warning:
 
 // CHECK-BOTH-WARNINGS: warning: control reaches end of non-void function
 // CHECK-BOTH-WARNINGS: warning: incompatible pointer types returning 'float *' from a function with result type 'int *'
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to