diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-08-29 12:34:39 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-08-29 12:34:39 -0700 |
commit | a6bf06e32a23367bbc5b4029fa1c973d335683df (patch) | |
tree | f6bbaa00e5050e8d46a5c957f5dbe9c29c70c856 /lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp | |
parent | 013bcfcfcd04a3469429771e80997c02fdd03501 (diff) |
PNaCl bitcode: Remove handling of named struct types
Named struct types should not appear in LLVM IR that passes the PNaCl
ABI verifier.
Remove the test struct-types.ll because it no longer passes.
Handling of TYPE_CODE_STRUCT_ANON must remain for now until this issue
is fixed: https://code.google.com/p/nativeclient/issues/detail?id=3648
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3590
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/23490018
Diffstat (limited to 'lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp')
-rw-r--r-- | lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp index 0eaab6d78b..9e8c398172 100644 --- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp +++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp @@ -402,8 +402,6 @@ bool NaClBitcodeReader::ParseTypeTableBody() { SmallVector<uint64_t, 64> Record; unsigned NumRecords = 0; - SmallString<64> TypeName; - // Read all the records for this type table. while (1) { NaClBitstreamEntry Entry = Stream.advanceSkippingSubblocks(); @@ -505,40 +503,6 @@ bool NaClBitcodeReader::ParseTypeTableBody() { ResultTy = StructType::get(Context, EltTys, Record[0]); break; } - case naclbitc::TYPE_CODE_STRUCT_NAME: // STRUCT_NAME: [strchr x N] - if (ConvertToString(Record, 0, TypeName)) - return Error("Invalid STRUCT_NAME record"); - continue; - - case naclbitc::TYPE_CODE_STRUCT_NAMED: { // STRUCT: [ispacked, eltty x N] - if (Record.size() < 1) - return Error("Invalid STRUCT type record"); - - if (NumRecords >= TypeList.size()) - return Error("invalid TYPE table"); - - // Check to see if this was forward referenced, if so fill in the temp. - StructType *Res = cast_or_null<StructType>(TypeList[NumRecords]); - if (Res) { - Res->setName(TypeName); - TypeList[NumRecords] = 0; - } else // Otherwise, create a new struct. - Res = StructType::create(Context, TypeName); - TypeName.clear(); - - SmallVector<Type*, 8> EltTys; - for (unsigned i = 1, e = Record.size(); i != e; ++i) { - if (Type *T = getTypeByID(Record[i])) - EltTys.push_back(T); - else - break; - } - if (EltTys.size() != Record.size()-1) - return Error("invalid STRUCT type record"); - Res->setBody(EltTys, Record[0]); - ResultTy = Res; - break; - } case naclbitc::TYPE_CODE_ARRAY: // ARRAY: [numelts, eltty] if (Record.size() < 2) return Error("Invalid ARRAY type record"); |