aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen/StringToOffsetTable.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-10-17 20:43:19 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-10-17 20:43:19 +0000
commit3446cf142eb3113679cbc11c3f63b133423d4c8b (patch)
treefc663fb4743ca420761c567a0a9eb347eb95c2f1 /utils/TableGen/StringToOffsetTable.h
parent522b113a752a8e86932eebdc41ba07e058950e41 (diff)
Use raw_ostream::write_escaped instead of EscapeString.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84356 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/StringToOffsetTable.h')
-rw-r--r--utils/TableGen/StringToOffsetTable.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/utils/TableGen/StringToOffsetTable.h b/utils/TableGen/StringToOffsetTable.h
index d9d7cf485e..ac9422c5d7 100644
--- a/utils/TableGen/StringToOffsetTable.h
+++ b/utils/TableGen/StringToOffsetTable.h
@@ -10,9 +10,10 @@
#ifndef TBLGEN_STRING_TO_OFFSET_TABLE_H
#define TBLGEN_STRING_TO_OFFSET_TABLE_H
+#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringMap.h"
-#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/raw_ostream.h"
namespace llvm {
@@ -38,9 +39,13 @@ public:
}
void EmitString(raw_ostream &O) {
+ // Escape the string.
+ SmallString<256> Str;
+ raw_svector_ostream(Str).write_escaped(AggregateString);
+ AggregateString = Str.str();
+
O << " \"";
unsigned CharsPrinted = 0;
- EscapeString(AggregateString);
for (unsigned i = 0, e = AggregateString.size(); i != e; ++i) {
if (CharsPrinted > 70) {
O << "\"\n \"";