r358917 - [VerifyDiagnosticConsumer] Document -verify=<prefixes> in doxygen

Joel E. Denny via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 22 13:25:06 PDT 2019


Author: jdenny
Date: Mon Apr 22 13:25:06 2019
New Revision: 358917

URL: http://llvm.org/viewvc/llvm-project?rev=358917&view=rev
Log:
[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

Modified:
    cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h

Modified: cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h?rev=358917&r1=358916&r2=358917&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h (original)
+++ cfe/trunk/include/clang/Frontend/VerifyDiagnosticConsumer.h Mon Apr 22 13:25:06 2019
@@ -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:




More information about the cfe-commits mailing list