Add 'remark' diagnostic type in 'clang'

Programming / Compilers / Clang - Tobias Grosser [grosser.es] - 28 February 2014 03:11 UTC

A 'remark' is information that is not an error or a warning, but rather some additional information provided to the user. In contrast to a 'note' a 'remark' is an independent diagnostic, whereas a 'note' always depends on another diagnostic.

A typical use case for remark nodes is information provided to the user, e.g. information provided by the vectorizer about loops that have been vectorized.

This patch provides the initial implementation of 'remarks'. It includes the actual definiton of the remark nodes, their printing as well as basic parameter handling. We are reusing the existing diagnostic parameters which means a remark can be enabled with normal '-Wdiagnostic-name' flags and can be upgraded to an error using '-Werror=diagnostic-name'. '-Werror' alone does not upgrade remarks.

This patch is by intention minimal in terms of parameter handling. More experience and more discussions will most likely lead to further enhancements in the parameter handling.

9762c97 Add 'remark' diagnostic type in 'clang'
docs/InternalsManual.rst | 11 +++++++----
docs/UsersManual.rst | 12 +++++++-----
include/clang-c/Index.h | 6 ++++++
include/clang/Basic/Diagnostic.h | 1 +
include/clang/Basic/Diagnostic.td | 3 +++
include/clang/Basic/DiagnosticFrontendKinds.td | 1 +
include/clang/Basic/DiagnosticGroups.td | 1 +
include/clang/Basic/DiagnosticIDs.h | 17 +++++++++--------
lib/Basic/DiagnosticIDs.cpp | 15 ++++++++++++---
lib/CodeGen/CodeGenAction.cpp | 23 ++++++++++++++++++++++-
lib/Frontend/LogDiagnosticPrinter.cpp | 1 +
lib/Frontend/PrintPreprocessedOutput.cpp | 3 +++
lib/Frontend/TextDiagnostic.cpp | 4 ++++
tools/c-index-test/c-index-test.c | 1 +
tools/diagtool/ShowEnabledWarnings.cpp | 1 +
tools/libclang/CIndexDiagnostic.cpp | 1 +
tools/libclang/CXStoredDiagnostic.cpp | 1 +
utils/TableGen/ClangDiagnosticsEmitter.cpp | 13 +++++++++++++
18 files changed, 94 insertions(+), 21 deletions(-)

Upstream: github.com


  • Share