summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJoel E. Denny <jdenny.ornl@gmail.com>2019-04-22 20:25:06 +0000
committerJoel E. Denny <jdenny.ornl@gmail.com>2019-04-22 20:25:06 +0000
commit9779aa41dd73984edb7f3641bd019c54ede3c977 (patch)
tree02267f845a6a76f703267517cd45014f59a8956a /include
parent6b8fd557a1fb4e5ad6ccec5c3a582ec9c712284b (diff)
[VerifyDiagnosticConsumer] Document -verify=<prefixes> in doxygen
Previously, it was only documented by `-cc1 -help`, so people weren't aware of it, as discussed in D60732. Reviewed By: Charusso, NoQ Differential Revision: https://reviews.llvm.org/D60845 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358917 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/Frontend/VerifyDiagnosticConsumer.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/include/clang/Frontend/VerifyDiagnosticConsumer.h b/include/clang/Frontend/VerifyDiagnosticConsumer.h
index 5d274e43e9..965a144108 100644
--- a/include/clang/Frontend/VerifyDiagnosticConsumer.h
+++ b/include/clang/Frontend/VerifyDiagnosticConsumer.h
@@ -33,7 +33,33 @@ class TextDiagnosticBuffer;
/// markers in the input source to check that all the emitted diagnostics match
/// those expected.
///
-/// USING THE DIAGNOSTIC CHECKER:
+/// INVOKING THE DIAGNOSTIC CHECKER:
+///
+/// VerifyDiagnosticConsumer is typically invoked via the "-verify" option to
+/// "clang -cc1". "-verify" is equivalent to "-verify=expected", so all
+/// diagnostics are typically specified with the prefix "expected". For
+/// example:
+///
+/// \code
+/// int A = B; // expected-error {{use of undeclared identifier 'B'}}
+/// \endcode
+///
+/// Custom prefixes can be specified as a comma-separated sequence. Each
+/// prefix must start with a letter and contain only alphanumeric characters,
+/// hyphens, and underscores. For example, given just "-verify=foo,bar",
+/// the above diagnostic would be ignored, but the following diagnostics would
+/// be recognized:
+///
+/// \code
+/// int A = B; // foo-error {{use of undeclared identifier 'B'}}
+/// int C = D; // bar-error {{use of undeclared identifier 'D'}}
+/// \endcode
+///
+/// Multiple occurrences accumulate prefixes. For example,
+/// "-verify -verify=foo,bar -verify=baz" is equivalent to
+/// "-verify=expected,foo,bar,baz".
+///
+/// SPECIFYING DIAGNOSTICS:
///
/// Indicating that a line expects an error or a warning is simple. Put a
/// comment on the line that has the diagnostic, use: