Add (hidden) TableGen command option '-clang-component' which specifies the
component's warnings to process for '-gen-clang-diags-defs'.
Also, when the component is specified, generate a '#if' prologue at the top of
the generated .def file (to match the current files).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66975 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/TableGen.cpp b/utils/TableGen/TableGen.cpp
index e6ed092..22c5d50 100644
--- a/utils/TableGen/TableGen.cpp
+++ b/utils/TableGen/TableGen.cpp
@@ -110,6 +110,11 @@
cl::list<std::string>
IncludeDirs("I", cl::desc("Directory of include files"),
cl::value_desc("directory"), cl::Prefix);
+
+ cl::opt<std::string>
+ ClangComponent("clang-component",
+ cl::desc("Only use warnings from specified component"),
+ cl::value_desc("component"), cl::Hidden);
}
@@ -202,7 +207,7 @@
AsmWriterEmitter(Records).run(*Out);
break;
case GenClangDiagsDefs:
- ClangDiagsDefsEmitter(Records).run(*Out);
+ ClangDiagsDefsEmitter(Records, ClangComponent).run(*Out);
break;
case GenDAGISel:
DAGISelEmitter(Records).run(*Out);