diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-04-16 05:52:18 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-04-16 05:52:18 +0000 |
| commit | cce520f88439762795c7cd6f44a5e3fafa8b9cec (patch) | |
| tree | 6391211e9ad914a6a8481c90e67cfd0e5613e9f8 | |
| parent | a538967177e73526741b048575aacc409d41cf21 (diff) | |
| download | bcm5719-llvm-cce520f88439762795c7cd6f44a5e3fafa8b9cec.tar.gz bcm5719-llvm-cce520f88439762795c7cd6f44a5e3fafa8b9cec.zip | |
prove diagnostic -> group mapping information.
llvm-svn: 69270
| -rw-r--r-- | llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp b/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp index 4d7f92968c2..919ae9befed 100644 --- a/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -50,10 +50,22 @@ void ClangDiagsDefsEmitter::run(std::ostream &OS) { 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"; } } |

