]> granicus.if.org Git - clang/commitdiff
[VerifyDiagnosticConsumer] Document -verify=<prefixes> in doxygen
authorJoel E. Denny <jdenny.ornl@gmail.com>
Mon, 22 Apr 2019 20:25:06 +0000 (20:25 +0000)
committerJoel E. Denny <jdenny.ornl@gmail.com>
Mon, 22 Apr 2019 20:25:06 +0000 (20:25 +0000)
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

include/clang/Frontend/VerifyDiagnosticConsumer.h

index 5d274e43e9fe1e760283f77ec8b20b2fa73d48c0..965a14410832114a13641c0fd0cf4ea4148d550b 100644 (file)
@@ -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: