summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/StringToOffsetTable.h
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2012-03-08 06:55:27 +0000
committerCraig Topper <craig.topper@gmail.com>2012-03-08 06:55:27 +0000
commitd31658d44c493b9036f417bb1f165e94b0b0a814 (patch)
tree9b5fe02ce8e6c76ec645d1c92604f0b7effa5bf3 /llvm/utils/TableGen/StringToOffsetTable.h
parent5ecfd7fd12c18e6ebae58f2ca766f8320827ccce (diff)
downloadbcm5719-llvm-d31658d44c493b9036f417bb1f165e94b0b0a814.tar.gz
bcm5719-llvm-d31658d44c493b9036f417bb1f165e94b0b0a814.zip
Re-commit r152202 hopefully fixing the MSVC linker error.
Original commit message: Use uint16_t to store InstrNameIndices in MCInstrInfo. Add asserts to protect all 16-bit string table offsets. Also make sure the string to offset table string is not larger than 65536 characters since larger string literals aren't portable. llvm-svn: 152296
Diffstat (limited to 'llvm/utils/TableGen/StringToOffsetTable.h')
-rw-r--r--llvm/utils/TableGen/StringToOffsetTable.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/StringToOffsetTable.h b/llvm/utils/TableGen/StringToOffsetTable.h
index 803f5bd5cf0..6d528a2b0a7 100644
--- a/llvm/utils/TableGen/StringToOffsetTable.h
+++ b/llvm/utils/TableGen/StringToOffsetTable.h
@@ -40,6 +40,9 @@ public:
}
void EmitString(raw_ostream &O) {
+ assert(AggregateString.size() <= 65536 &&
+ "Aggregate string too large to be portable");
+
// Escape the string.
SmallString<256> Str;
raw_svector_ostream(Str).write_escaped(AggregateString);
OpenPOWER on IntegriCloud