[llvm-commits] [llvm] r69235 - /llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp

Chris Lattner sabre at nondot.org
Wed Apr 15 15:33:02 PDT 2009


Author: lattner
Date: Wed Apr 15 17:33:02 2009
New Revision: 69235

URL: http://llvm.org/viewvc/llvm-project?rev=69235&view=rev
Log:
make sure that empty diag groups get known by clang.

Modified:
    llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp

Modified: llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp?rev=69235&r1=69234&r2=69235&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp Wed Apr 15 17:33:02 2009
@@ -66,9 +66,8 @@
   // 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 @@
     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";





More information about the llvm-commits mailing list