[PATCH] D60845: [VerifyDiagnosticConsumer] Document -verify=<prefixes> in doxygen

Joel E. Denny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 16:42:14 PDT 2019


jdenny created this revision.
jdenny added reviewers: NoQ, Charusso, hfinkel, rsmith.
Herald added a project: clang.

Previously, it was only documented by `-cc1 -help`, so people weren't
aware of it, as discussed in D60732 <https://reviews.llvm.org/D60732>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60845

Files:
  clang/include/clang/Frontend/VerifyDiagnosticConsumer.h


Index: clang/include/clang/Frontend/VerifyDiagnosticConsumer.h
===================================================================
--- clang/include/clang/Frontend/VerifyDiagnosticConsumer.h
+++ clang/include/clang/Frontend/VerifyDiagnosticConsumer.h
@@ -33,7 +33,31 @@
 /// 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 "-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
+///
+/// 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:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60845.195652.patch
Type: text/x-patch
Size: 1471 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190417/e2595a9d/attachment.bin>


More information about the cfe-commits mailing list