From f27e5a09a0d815b8a4814152954ff87dadfdefc0 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 2 Jun 2009 17:58:47 +0000 Subject: Import Clang, at r72732. --- include/clang/Basic/Diagnostic.td | 73 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 include/clang/Basic/Diagnostic.td (limited to 'include/clang/Basic/Diagnostic.td') diff --git a/include/clang/Basic/Diagnostic.td b/include/clang/Basic/Diagnostic.td new file mode 100644 index 0000000..67d8eaa --- /dev/null +++ b/include/clang/Basic/Diagnostic.td @@ -0,0 +1,73 @@ +//===--- Diagnostic.td - C Language Family Diagnostic Handling ------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the TableGen core definitions for the diagnostics +// and diagnostic control. +// +//===----------------------------------------------------------------------===// + +// Define the diagnostic mappings. +class DiagMapping; +def MAP_IGNORE : DiagMapping; +def MAP_WARNING : DiagMapping; +def MAP_ERROR : DiagMapping; +def MAP_FATAL : DiagMapping; + +// Define the diagnostic classes. +class DiagClass; +def CLASS_NOTE : DiagClass; +def CLASS_WARNING : DiagClass; +def CLASS_EXTENSION : DiagClass; +def CLASS_ERROR : DiagClass; + +// Diagnostic Groups. +class DiagGroup subgroups = []> { + string GroupName = Name; + list SubGroups = subgroups; +} +class InGroup { DiagGroup Group = G; } +//class IsGroup { DiagGroup Group = DiagGroup; } + + +// This defines the diagnostic groups that have references to them. +include "DiagnosticGroups.td" + + +// All diagnostics emitted by the compiler are an indirect subclass of this. +class Diagnostic { + /// Component is specified by the file with a big let directive. + string Component = ?; + string Text = text; + DiagClass Class = DC; + DiagMapping DefaultMapping = defaultmapping; + DiagGroup Group; +} + +class Error : Diagnostic; +class Warning : Diagnostic; +class Extension : Diagnostic; +class ExtWarn : Diagnostic; +class Note : Diagnostic; + + +class DefaultIgnore { DiagMapping DefaultMapping = MAP_IGNORE; } +class DefaultWarn { DiagMapping DefaultMapping = MAP_WARNING; } +class DefaultError { DiagMapping DefaultMapping = MAP_ERROR; } +class DefaultFatal { DiagMapping DefaultMapping = MAP_FATAL; } + +// Definitions for Diagnostics. +include "DiagnosticASTKinds.td" +include "DiagnosticAnalysisKinds.td" +include "DiagnosticCommonKinds.td" +include "DiagnosticDriverKinds.td" +include "DiagnosticFrontendKinds.td" +include "DiagnosticLexKinds.td" +include "DiagnosticParseKinds.td" +include "DiagnosticSemaKinds.td" + -- cgit v1.1