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 | bfc0104c762e385ce2b834e264b447be884c1c90 (patch) | |
tree | 06612d1391a80ab69726ff491e49b7a0b9439b10 /utils | |
parent | 2d1be87ee40a4a0241d94448173879d9df2bc5b3 (diff) | |
download | external_llvm-bfc0104c762e385ce2b834e264b447be884c1c90.zip external_llvm-bfc0104c762e385ce2b834e264b447be884c1c90.tar.gz external_llvm-bfc0104c762e385ce2b834e264b447be884c1c90.tar.bz2 |
prove diagnostic -> group mapping information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/ClangDiagnosticsEmitter.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp index 4d7f929..919ae9b 100644 --- a/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/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"; } } |