From: Chris Lattner Date: Thu, 16 Apr 2009 06:17:18 +0000 (+0000) Subject: split diagnostic group definitions out into their own file. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11bddefe100d439b61cff2d592fa167b7e778ae1;p=clang split diagnostic group definitions out into their own file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69274 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj index 2079af3a44..947a223ca8 100644 --- a/clang.xcodeproj/project.pbxproj +++ b/clang.xcodeproj/project.pbxproj @@ -646,6 +646,7 @@ DEDFF87F0F848CE30035BD10 /* TemplateName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TemplateName.h; path = clang/AST/TemplateName.h; sourceTree = ""; }; DEDFF8870F848CF80035BD10 /* TemplateName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TemplateName.cpp; path = lib/AST/TemplateName.cpp; sourceTree = ""; }; DEDFFF070F959EE60035BD10 /* Diagnostic.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Diagnostic.td; sourceTree = ""; }; + DEDFFF530F9704580035BD10 /* DiagnosticGroups.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticGroups.td; sourceTree = ""; }; DEEBBD430C19C5D200A9FE82 /* TODO.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = TODO.txt; sourceTree = ""; }; DEEBC3B90C2363B800A9FE82 /* CodeGenTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CodeGenTypes.h; path = lib/CodeGen/CodeGenTypes.h; sourceTree = ""; tabWidth = 2; }; DEEBC3BB0C2363BC00A9FE82 /* CodeGenTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CodeGenTypes.cpp; path = lib/CodeGen/CodeGenTypes.cpp; sourceTree = ""; tabWidth = 2; }; @@ -680,7 +681,6 @@ DEF1658F0F8FB3FC0098507F /* GeneratePCH.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GeneratePCH.cpp; path = "tools/clang-cc/GeneratePCH.cpp"; sourceTree = ""; }; DEF1683F0F9548DC0098507F /* FixItRewriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FixItRewriter.cpp; path = lib/Frontend/FixItRewriter.cpp; sourceTree = ""; }; DEF168620F9549250098507F /* FixItRewriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FixItRewriter.h; path = clang/Frontend/FixItRewriter.h; sourceTree = ""; }; - DEF169050F9645580098507F /* DiagnosticOptions.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticOptions.td; sourceTree = ""; }; DEF169220F9645960098507F /* FrontendDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FrontendDiagnostic.h; path = clang/Frontend/FrontendDiagnostic.h; sourceTree = ""; }; DEF1692C0F9645BF0098507F /* AnalysisDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnalysisDiagnostic.h; path = clang/Analysis/AnalysisDiagnostic.h; sourceTree = ""; }; DEF2E95E0C5FBD74000C4259 /* InternalsManual.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; name = InternalsManual.html; path = docs/InternalsManual.html; sourceTree = ""; }; @@ -1186,8 +1186,8 @@ 1A7019EB0F79BC1100FEC4D1 /* DiagnosticCommonKinds.td */, 1A7019EC0F79BC1100FEC4D1 /* DiagnosticDriverKinds.td */, 1A7019ED0F79BC1100FEC4D1 /* DiagnosticFrontendKinds.td */, + DEDFFF530F9704580035BD10 /* DiagnosticGroups.td */, 1A7019EE0F79BC1100FEC4D1 /* DiagnosticLexKinds.td */, - DEF169050F9645580098507F /* DiagnosticOptions.td */, 1A7019EF0F79BC1100FEC4D1 /* DiagnosticParseKinds.td */, 1A701A250F79CE1C00FEC4D1 /* DiagnosticSemaKinds.td */, DED7D7330A524295003AD0FB /* FileManager.h */, diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td new file mode 100644 index 0000000000..468acb0f0f --- /dev/null +++ b/include/clang/Basic/DiagnosticGroups.td @@ -0,0 +1,81 @@ +//==--- DiagnosticGroups.td - Diagnostic Group Definitions ----------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +def ImplicitFunctionDeclare : DiagGroup<"implicit-function-declaration">; +def Trigraphs : DiagGroup<"trigraphs">; + +// Empty DiagGroups: these are recognized by clang but ignored. +def : DiagGroup<"aggregate-return">; +def : DiagGroup<"bad-function-cast">; +def : DiagGroup<"cast-align">; +def : DiagGroup<"cast-qual">; +def : DiagGroup<"char-align">; +def : DiagGroup<"char-subscripts">; +def : DiagGroup<"declaration-after-statement">; +def : DiagGroup<"error-implicit-function-declaration">; +def : DiagGroup<"format-security">; +def : DiagGroup<"format=2">; +def : DiagGroup<"format">; +def : DiagGroup<"four-char-constants">; +def : DiagGroup<"init-self">; +def : DiagGroup<"inline">; +def : DiagGroup<"int-to-pointer-cast">; +def : DiagGroup<"missing-braces">; +def : DiagGroup<"missing-declarations">; +def : DiagGroup<"missing-format-attribute">; +def : DiagGroup<"nested-externs">; +def : DiagGroup<"newline-eof">; +def : DiagGroup<"no-#warnings">; +def : DiagGroup<"no-comment">; +def : DiagGroup<"format-y2k">; +def : DiagGroup<"long-long">; +def : DiagGroup<"missing-field-initializers">; +def : DiagGroup<"nonportable-cfstrings">; +def : DiagGroup<"old-style-definition">; +def : DiagGroup<"packed">; +def : DiagGroup<"parentheses">; +def : DiagGroup<"pointer-arith">; +def : DiagGroup<"pointer-to-int-cast">; +def : DiagGroup<"redundant-decls">; +def : DiagGroup<"return-type">; +def : DiagGroup<"shadow">; +def : DiagGroup<"shorten-64-to-32">; +def : DiagGroup<"sign-compare">; +def : DiagGroup<"strict-overflow=">; +def : DiagGroup<"strict-overflow">; +def : DiagGroup<"strict-prototypes">; +def : DiagGroup<"strict-selector-match">; +def Switch : DiagGroup<"switch">; +def Uninitialized : DiagGroup<"uninitialized">; +def UnknownPragmas : DiagGroup<"unknown-pragmas">; +def : DiagGroup<"unused-function">; +def : DiagGroup<"unused-label">; +def : DiagGroup<"unused-parameter">; +def UnusedValue : DiagGroup<"unused-value">; +def UnusedVariable : DiagGroup<"unused-variable">; +def : DiagGroup<"variadic-macros">; +def VolatileRegisterVar : DiagGroup<"volatile-register-var">; +def : DiagGroup<"write-strings">; + +def : DiagGroup<"extra">; +def : DiagGroup<"">; // -W +def : DiagGroup<"most">; + +// Aggregation warning settings. +def : DiagGroup<"all", [ + ImplicitFunctionDeclare, + Switch, + Trigraphs, + Uninitialized, + UnknownPragmas, + UnusedValue, + UnusedVariable, + VolatileRegisterVar + ]>; + diff --git a/include/clang/Basic/DiagnosticOptions.td b/include/clang/Basic/DiagnosticOptions.td deleted file mode 100644 index 270d07a297..0000000000 --- a/include/clang/Basic/DiagnosticOptions.td +++ /dev/null @@ -1,14 +0,0 @@ -//===--- DiagnosticOptions.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 definitions for the diagnostics options. -// -//===----------------------------------------------------------------------===// - -def UnusedMacrosDiags : Option<"unused-macros", [pp_macro_not_used]>; diff --git a/include/clang/Basic/Makefile b/include/clang/Basic/Makefile index ba9d0977fe..b08d61457b 100644 --- a/include/clang/Basic/Makefile +++ b/include/clang/Basic/Makefile @@ -9,12 +9,12 @@ TABLEGEN_INC_FILES_COMMON = 1 include $(LEVEL)/Makefile.common -$(ObjDir)/Diagnostic%Kinds.inc.tmp : Diagnostic.td Diagnostic%Kinds.td $(TBLGEN) +$(ObjDir)/Diagnostic%Kinds.inc.tmp : Diagnostic.td DiagnosticGroups.td Diagnostic%Kinds.td $(TBLGEN) $(Echo) "Building Clang $(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) diagnostic tables with tblgen" $(Verb) -$(MKDIR) $(@D) $(Verb) $(TableGen) -gen-clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) -o $(call SYSPATH, $@) $< -$(ObjDir)/DiagnosticGroups.inc.tmp : Diagnostic.td $(wildcard Diagnostic*Kinds.td) $(TBLGEN) +$(ObjDir)/DiagnosticGroups.inc.tmp : Diagnostic.td $(wildcard Diagnostic*.td) $(TBLGEN) $(Echo) "Building Clang diagnostic groups with tblgen" $(Verb) -$(MKDIR) $(@D) $(Verb) $(TableGen) -gen-clang-diag-groups -o $(call SYSPATH, $@) $<