diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-09-09 10:32:47 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-09-09 10:32:47 -0700 |
commit | b63e4bfe73188f7d68065f5b274e169491e593d2 (patch) | |
tree | ac29183c92f4d361752d478435e6b31e68910ca4 /lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp | |
parent | 1c0cea6c1fc807794f0d785392e05b19d0c70210 (diff) |
PNaCl bitcode: Remove TYPE_CODE_POINTER entries from type table
There are now no uses of pointer type IDs in PNaCl bitcode, so we can
stop outputting pointer types into the type table.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3671
TEST=test/NaCl/Bitcode/*.ll
Review URL: https://codereview.chromium.org/23600013
Diffstat (limited to 'lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp')
-rw-r--r-- | lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp b/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp index 923d0b2c1e..cd4a894ef0 100644 --- a/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp +++ b/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp @@ -227,6 +227,8 @@ static void WriteTypeTable(const NaClValueEnumerator &VE, TypeVals.push_back(cast<IntegerType>(T)->getBitWidth()); break; case Type::PointerTyID: { + if (PNaClVersion >= 2) + report_fatal_error("Pointer types are not supported in PNaCl bitcode"); PointerType *PTy = cast<PointerType>(T); // POINTER: [pointee type, address space] Code = naclbitc::TYPE_CODE_POINTER; @@ -550,7 +552,7 @@ static void EmitFnForwardTypeRef(const Value *V, VE.InsertFnForwardTypeRef(ValID)) { SmallVector<unsigned, 2> Vals; Vals.push_back(ValID); - Vals.push_back(VE.getTypeID(VE.NormalizeScalarType(V->getType()))); + Vals.push_back(VE.getTypeID(VE.NormalizeType(V->getType()))); Stream.EmitRecord(naclbitc::FUNC_CODE_INST_FORWARDTYPEREF, Vals, FUNCTION_INST_FORWARDTYPEREF_ABBREV); } |