aboutsummaryrefslogtreecommitdiff
path: root/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp
diff options
context:
space:
mode:
authorKarl Schimpf <kschimpf@google.com>2013-09-04 13:34:52 -0700
committerKarl Schimpf <kschimpf@google.com>2013-09-04 13:34:52 -0700
commitd8f9bfbc093e7e0c1fab719bc014ba7c6f94ad6d (patch)
treef97b1b11573bba4db6a158514f83ee4e3ef77cb3 /lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp
parentf8ea6b0a1ed535c10089d53c93f32cfe0117c812 (diff)
Remove ARRAY/VECTOR types from PNaCl bitcode files.
The value selector list for switch statements are represented using ARRAY/VECTOR constants, but this information is not put into the bitcode file. This CL changes the value enumerator to not emit these constants. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3649 R=mseaborn@chromium.org Review URL: https://codereview.chromium.org/23653013
Diffstat (limited to 'lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp')
-rw-r--r--lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp
index bff4afb0c3..cccc5cee5a 100644
--- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp
+++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp
@@ -508,6 +508,10 @@ bool NaClBitcodeReader::ParseTypeTableBody() {
break;
}
case naclbitc::TYPE_CODE_ARRAY: // ARRAY: [numelts, eltty]
+ // Deprecated. Only exists in early PNaCl version 1 bitcode files.
+ // TODO(kschimpf) Remove this as soon as is feasible.
+ if (GetPNaClVersion() >= 2)
+ return Error("Array types not supported in PNaCl bitcode");
if (Record.size() < 2)
return Error("Invalid ARRAY type record");
if ((ResultTy = getTypeByID(Record[1])))
@@ -516,6 +520,10 @@ bool NaClBitcodeReader::ParseTypeTableBody() {
return Error("Invalid ARRAY type element");
break;
case naclbitc::TYPE_CODE_VECTOR: // VECTOR: [numelts, eltty]
+ // Deprecated. Only exists in early PNaCl version 1 bitcode files.
+ // TODO(kschimpf) Remove this as soon as is feasible.
+ if (GetPNaClVersion() >= 2)
+ return Error("Vector types not supported in PNaCl bitcode");
if (Record.size() < 2)
return Error("Invalid VECTOR type record");
if ((ResultTy = getTypeByID(Record[1])))