aboutsummaryrefslogtreecommitdiff
path: root/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp
diff options
context:
space:
mode:
authorKarl Schimpf <kschimpf@google.com>2013-09-03 14:04:17 -0700
committerKarl Schimpf <kschimpf@google.com>2013-09-03 14:04:17 -0700
commiteb10318143cc0045a053a1973e4aeaf246e53984 (patch)
treecc1b6e097abc12a5532e61a14429f04ece95e37a /lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp
parent30aa17affbfa35a9d32895ff6f4b5f5fbfc9575a (diff)
Remove generating STRUCT_ANON records in PNaCl bitcode files.
Don't generate types for elided cast instructions, since they are never put into the bitcode file. In addition, do not generate a type id for the types of global variables, because they are never needed. Don't allow STRUCT_ANON in bitcode files PNaClVersion==2. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3648 R=jvoung@chromium.org Review URL: https://codereview.chromium.org/23455023
Diffstat (limited to 'lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp')
-rw-r--r--lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp29
1 files changed, 2 insertions, 27 deletions
diff --git a/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp b/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp
index 4a6a454796..3d5d50cc20 100644
--- a/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp
+++ b/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp
@@ -94,7 +94,6 @@ enum {
// TYPE_BLOCK_ID_NEW abbrev id's.
TYPE_POINTER_ABBREV = naclbitc::FIRST_APPLICATION_ABBREV,
TYPE_FUNCTION_ABBREV,
- TYPE_STRUCT_ANON_ABBREV,
TYPE_ARRAY_ABBREV,
TYPE_MAX_ABBREV = TYPE_ARRAY_ABBREV
};
@@ -201,15 +200,6 @@ static void WriteTypeTable(const NaClValueEnumerator &VE,
if (TYPE_FUNCTION_ABBREV != Stream.EmitAbbrev(Abbv))
llvm_unreachable("Unexpected abbrev ordering!");
- // Abbrev for TYPE_CODE_STRUCT_ANON.
- Abbv = new NaClBitCodeAbbrev();
- Abbv->Add(NaClBitCodeAbbrevOp(naclbitc::TYPE_CODE_STRUCT_ANON));
- Abbv->Add(NaClBitCodeAbbrevOp(NaClBitCodeAbbrevOp::Fixed, 1)); // ispacked
- Abbv->Add(NaClBitCodeAbbrevOp(NaClBitCodeAbbrevOp::Array));
- Abbv->Add(NaClBitCodeAbbrevOp(NaClBitCodeAbbrevOp::Fixed, NumBits));
- if (TYPE_STRUCT_ANON_ABBREV != Stream.EmitAbbrev(Abbv))
- llvm_unreachable("Unexpected abbrev ordering!");
-
// Abbrev for TYPE_CODE_ARRAY.
Abbv = new NaClBitCodeAbbrev();
Abbv->Add(NaClBitCodeAbbrevOp(naclbitc::TYPE_CODE_ARRAY));
@@ -261,23 +251,8 @@ static void WriteTypeTable(const NaClValueEnumerator &VE,
AbbrevToUse = TYPE_FUNCTION_ABBREV;
break;
}
- case Type::StructTyID: {
- StructType *ST = cast<StructType>(T);
- // STRUCT: [ispacked, eltty x N]
- TypeVals.push_back(ST->isPacked());
- // Output all of the element types.
- for (StructType::element_iterator I = ST->element_begin(),
- E = ST->element_end(); I != E; ++I)
- TypeVals.push_back(VE.getTypeID(*I));
-
- if (ST->isLiteral()) {
- Code = naclbitc::TYPE_CODE_STRUCT_ANON;
- AbbrevToUse = TYPE_STRUCT_ANON_ABBREV;
- } else {
- report_fatal_error("Non-anon structs not supported in PNaCl bitcode");
- }
- break;
- }
+ case Type::StructTyID:
+ report_fatal_error("Struct types are not supported in PNaCl bitcode");
case Type::ArrayTyID: {
ArrayType *AT = cast<ArrayType>(T);
// ARRAY: [numelts, eltty]