summaryrefslogtreecommitdiff
path: root/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
commit88d2fa438a5b9feb7da77e4beeaa00944ae4168e (patch)
tree78670ed745845060a34061c675e15f0ba9026d25 /utils/TableGen/StringToOffsetTable.h
parent8c0152f8a557742efddc57c3993c2c0a3a79ca4d (diff)
downloadllvm-88d2fa438a5b9feb7da77e4beeaa00944ae4168e.tar.gz
llvm-88d2fa438a5b9feb7da77e4beeaa00944ae4168e.tar.bz2
llvm-88d2fa438a5b9feb7da77e4beeaa00944ae4168e.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/StringToOffsetTable.h')
-rw-r--r--utils/TableGen/StringToOffsetTable.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/TableGen/StringToOffsetTable.h b/utils/TableGen/StringToOffsetTable.h
index 803f5bd5cf..6d528a2b0a 100644
--- a/utils/TableGen/StringToOffsetTable.h
+++ b/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);