From 8eff29d805e32bd03ef0e14c5d25384b35498336 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 17 Oct 2009 20:43:19 +0000 Subject: Use raw_ostream::write_escaped instead of EscapeString. llvm-svn: 84356 --- llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp') diff --git a/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp b/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp index c127afd7705..6f1080eb5eb 100644 --- a/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -52,15 +52,12 @@ void ClangDiagsDefsEmitter::run(raw_ostream &OS) { // Description string. OS << ", \""; - std::string S = R.getValueAsString("Text"); - EscapeString(S); - OS << S << "\""; + OS.write_escaped(R.getValueAsString("Text")) << '"'; // Warning associated with the diagnostic. if (DefInit *DI = dynamic_cast(R.getValueInit("Group"))) { - S = DI->getDef()->getValueAsString("GroupName"); - EscapeString(S); - OS << ", \"" << S << "\""; + OS << ", \""; + OS.write_escaped(DI->getDef()->getValueAsString("GroupName")) << '"'; } else { OS << ", 0"; } @@ -151,11 +148,10 @@ void ClangDiagGroupsEmitter::run(raw_ostream &OS) { OS << "\n#ifdef GET_DIAG_TABLE\n"; for (std::map::iterator I = DiagsInGroup.begin(), E = DiagsInGroup.end(); I != E; ++I) { - std::string S = I->first; - EscapeString(S); // Group option string. - OS << " { \"" << S << "\"," - << std::string(MaxLen-I->first.size()+1, ' '); + OS << " { \""; + OS.write_escaped(I->first) << "\"," + << std::string(MaxLen-I->first.size()+1, ' '); // Diagnostics in the group. if (I->second.DiagsInGroup.empty()) -- cgit v1.2.3