[PATCH] D60845: [VerifyDiagnosticConsumer] Document -verify=<prefixes> in doxygen
Joel E. Denny via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 22 13:24:47 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rC358917: [VerifyDiagnosticConsumer] Document -verify=<prefixes> in doxygen (authored by jdenny, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D60845?vs=195742&id=196127#toc
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60845/new/
https://reviews.llvm.org/D60845
Files:
include/clang/Frontend/VerifyDiagnosticConsumer.h
Index: include/clang/Frontend/VerifyDiagnosticConsumer.h
===================================================================
--- include/clang/Frontend/VerifyDiagnosticConsumer.h
+++ include/clang/Frontend/VerifyDiagnosticConsumer.h
@@ -33,7 +33,33 @@
/// 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:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60845.196127.patch
Type: text/x-patch
Size: 1613 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190422/41838c7f/attachment.bin>
More information about the cfe-commits
mailing list