summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/include/llvm/TableGen/StringToOffsetTable.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/include/llvm/TableGen/StringToOffsetTable.h')
-rw-r--r--contrib/llvm/include/llvm/TableGen/StringToOffsetTable.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/llvm/include/llvm/TableGen/StringToOffsetTable.h b/contrib/llvm/include/llvm/TableGen/StringToOffsetTable.h
index e327703..e5b61ed 100644
--- a/contrib/llvm/include/llvm/TableGen/StringToOffsetTable.h
+++ b/contrib/llvm/include/llvm/TableGen/StringToOffsetTable.h
@@ -76,6 +76,26 @@ public:
}
O << "\"";
}
+
+ /// Emit the string using character literals. MSVC has a limitation that
+ /// string literals cannot be longer than 64K.
+ void EmitCharArray(raw_ostream &O) {
+ assert(AggregateString.find(')') == std::string::npos &&
+ "can't emit raw string with closing parens");
+ int Count = 0;
+ O << ' ';
+ for (char C : AggregateString) {
+ O << " \'";
+ O.write_escaped(StringRef(&C, 1));
+ O << "\',";
+ Count++;
+ if (Count > 14) {
+ O << "\n ";
+ Count = 0;
+ }
+ }
+ O << '\n';
+ }
};
} // end namespace llvm
OpenPOWER on IntegriCloud