Add `-verify-ignore-unexpected` option to ignore unexpected diagnostics in VerifyDiag...
authorEric Fiselier <eric@efcs.ca>
Sat, 13 Jun 2015 07:11:40 +0000 (07:11 +0000)
committerEric Fiselier <eric@efcs.ca>
Sat, 13 Jun 2015 07:11:40 +0000 (07:11 +0000)
commit098e6de9aa41dec16c09dfab456b83bf8a2946cb
tree4773b375e153fed6721b70d60bcb11cc895f6736
parentee187e247bc2c7b97eb345e1de7f5ccf151e24e5
Add `-verify-ignore-unexpected` option to ignore unexpected diagnostics in VerifyDiagnosticsConsumer

Summary:
The goal of this patch is to make `-verify` easier to use when testing libc++. The `notes` attached to compile error diagnostics are numerous and relatively unstable when they reference libc++ header internals. This patch allows libc++ to write stable compilation failure tests by allowing unexpected diagnostic messages to be ignored where they are not relevant.

This patch adds a new CC1 flag called `-verify-ignore-unexpected`. `-verify-ignore-unexpected` tells `VerifyDiagnosticsConsumer` to ignore *all* unexpected diagnostic messages. `-verify-ignore-unexpected=<LevelList>` can be used to only ignore certain diagnostic levels. `<LevelList>` is a comma separated list of diagnostic levels to ignore. The supported levels are `note`, `remark`, `warning` and `error`.

Reviewers: bogner, grosser, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D10138

llvm-svn: 239665
clang/include/clang/Basic/DiagnosticOptions.def
clang/include/clang/Basic/DiagnosticOptions.h
clang/include/clang/Driver/CC1Options.td
clang/lib/Basic/CMakeLists.txt
clang/lib/Basic/DiagnosticOptions.cpp [new file with mode: 0644]
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
clang/test/Frontend/verify-ignore-unexpected.c [new file with mode: 0644]