[llvm-commits] [llvm] r69270 - /llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp
Chris Lattner
sabre at nondot.org
Wed Apr 15 22:52:18 PDT 2009
Author: lattner
Date: Thu Apr 16 00:52:18 2009
New Revision: 69270
URL: http://llvm.org/viewvc/llvm-project?rev=69270&view=rev
Log:
prove diagnostic -> group mapping information.
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=69270&r1=69269&r2=69270&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/ClangDiagnosticsEmitter.cpp Thu Apr 16 00:52:18 2009
@@ -50,10 +50,22 @@
OS << "DIAG(" << R.getName() << ", ";
OS << R.getValueAsDef("Class")->getName();
OS << ", diag::" << R.getValueAsDef("DefaultMapping")->getName();
+
+ // Description string.
OS << ", \"";
std::string S = R.getValueAsString("Text");
EscapeString(S);
- OS << S << "\")\n";
+ OS << S << "\"";
+
+ // Warning associated with the diagnostic.
+ if (DefInit *DI = dynamic_cast<DefInit*>(R.getValueInit("Group"))) {
+ S = DI->getDef()->getValueAsString("GroupName");
+ EscapeString(S);
+ OS << ", \"" << S << "\"";
+ } else {
+ OS << ", 0";
+ }
+ OS << ")\n";
}
}
More information about the llvm-commits
mailing list