aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-15 22:33:02 +0000
committerChris Lattner <sabre@nondot.org>2009-04-15 22:33:02 +0000
commita0ed8ca233e6099d434e9c80d9681057369db78f (patch)
treef5d0d3894575695f72fe809cf298ae18ca376975 /utils
parent2f8c1d5fbc86f7cc484bdf1f7062bb8fe06cf240 (diff)
downloadexternal_llvm-a0ed8ca233e6099d434e9c80d9681057369db78f.zip
external_llvm-a0ed8ca233e6099d434e9c80d9681057369db78f.tar.gz
external_llvm-a0ed8ca233e6099d434e9c80d9681057369db78f.tar.bz2
make sure that empty diag groups get known by clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69235 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/ClangDiagnosticsEmitter.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp
index d0ca5a1..045eb7a 100644
--- a/utils/TableGen/ClangDiagnosticsEmitter.cpp
+++ b/utils/TableGen/ClangDiagnosticsEmitter.cpp
@@ -66,9 +66,8 @@ void ClangDiagGroupsEmitter::run(std::ostream &OS) {
// groups to diags in the group.
std::map<std::string, std::vector<const Record*> > DiagsInGroup;
- const std::vector<Record*> &Diags =
+ std::vector<Record*> Diags =
Records.getAllDerivedDefinitions("Diagnostic");
-
for (unsigned i = 0, e = Diags.size(); i != e; ++i) {
const Record *R = Diags[i];
DefInit *DI = dynamic_cast<DefInit*>(R->getValueInit("Group"));
@@ -76,6 +75,13 @@ void ClangDiagGroupsEmitter::run(std::ostream &OS) {
DiagsInGroup[DI->getDef()->getValueAsString("GroupName")].push_back(R);
}
+ // Add all DiagGroup's to the DiagsInGroup list to make sure we pick up empty
+ // groups (these are warnings that GCC supports that clang never produces).
+ Diags = Records.getAllDerivedDefinitions("DiagGroup");
+ for (unsigned i = 0, e = Diags.size(); i != e; ++i) {
+ DiagsInGroup[Diags[i]->getValueAsString("GroupName")];
+ }
+
// Walk through the groups emitting an array for each diagnostic of the diags
// that are mapped to.
OS << "\n#ifdef GET_DIAG_ARRAYS\n";