summaryrefslogtreecommitdiffstats
path: root/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/utils/TableGen/ClangDiagnosticsEmitter.cpp')
-rw-r--r--clang/utils/TableGen/ClangDiagnosticsEmitter.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
index db159d102cd..2c265aff62c 100644
--- a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
+++ b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
@@ -472,6 +472,11 @@ static bool isError(const Record &Diag) {
return ClsName == "CLASS_ERROR";
}
+static bool isRemark(const Record &Diag) {
+ const std::string &ClsName = Diag.getValueAsDef("Class")->getName();
+ return ClsName == "CLASS_REMARK";
+}
+
/// ClangDiagsDefsEmitter - The top-level class emits .def files containing
/// declarations of Clang diagnostics.
namespace clang {
@@ -518,6 +523,14 @@ void EmitClangDiagsDefs(RecordKeeper &Records, raw_ostream &OS,
}
}
+ // Check that all remarks have an associated diagnostic group.
+ if (isRemark(R)) {
+ if (!isa<DefInit>(R.getValueInit("Group"))) {
+ PrintFatalError(R.getLoc(), "Error " + R.getName() +
+ " not in any diagnostic group");
+ }
+ }
+
// Filter by component.
if (!Component.empty() && Component != R.getValueAsString("Component"))
continue;
OpenPOWER on IntegriCloud