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

Chris Lattner sabre at nondot.org
Wed Apr 15 09:55:53 PDT 2009


Author: lattner
Date: Wed Apr 15 11:55:46 2009
New Revision: 69176

URL: http://llvm.org/viewvc/llvm-project?rev=69176&view=rev
Log:
don't infer diag class from parenting relations, make it an explicit field
in the record.

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=69176&r1=69175&r2=69176&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp Wed Apr 15 11:55:46 2009
@@ -39,16 +39,6 @@
   return 0;
 }
 
-static const Record* getDiagKind(const Record* DiagClass, const Record &R) {  
-  const SuperClassVector &SC = R.getSuperClasses();
-  for (SuperClassVector::const_iterator I=SC.begin(), E=SC.end(); I!=E; ++I)
-    if ((*I)->isSubClassOf(DiagClass) && 
-        (*I)->getName() != "DiagnosticControlled")
-      return *I;
-  
-  return 0;
-}
-
 static void EmitEscaped(std::ostream& OS, const std::string &s) {
   for (std::string::const_iterator I=s.begin(), E=s.end(); I!=E; ++I)
     switch (*I) {
@@ -69,12 +59,8 @@
 
 static void ProcessDiag(std::ostream &OS, const Record *DiagClass,
                         const Record &R) {
-  const Record* DiagKind = getDiagKind(DiagClass, R);
-  if (!DiagKind)
-    return;
-
   OS << "DIAG(" << R.getName() << ", ";
-  EmitAllCaps(OS, DiagKind->getName());
+  OS << R.getValueAsDef("Class")->getName();
   OS << ", diag::" << R.getValueAsDef("DefaultMapping")->getName();
   OS << ", \"";
   EmitEscaped(OS, R.getValueAsString("Text"));





More information about the llvm-commits mailing list