[Bitcode] Remove typed pointer abbreviation
authorArthur Eubanks <aeubanks@google.com>
Mon, 27 Feb 2023 19:29:23 +0000 (11:29 -0800)
committerArthur Eubanks <aeubanks@google.com>
Mon, 27 Feb 2023 21:11:09 +0000 (13:11 -0800)
Since typed pointers are deprecated.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D144901

llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

index 16d1399..51756eb 100644 (file)
@@ -901,15 +901,8 @@ void ModuleBitcodeWriter::writeTypeTable() {
 
   uint64_t NumBits = VE.computeBitsRequiredForTypeIndicies();
 
-  // Abbrev for TYPE_CODE_POINTER.
-  auto Abbv = std::make_shared<BitCodeAbbrev>();
-  Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_POINTER));
-  Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, NumBits));
-  Abbv->Add(BitCodeAbbrevOp(0));  // Addrspace = 0
-  unsigned PtrAbbrev = Stream.EmitAbbrev(std::move(Abbv));
-
   // Abbrev for TYPE_CODE_OPAQUE_POINTER.
-  Abbv = std::make_shared<BitCodeAbbrev>();
+  auto Abbv = std::make_shared<BitCodeAbbrev>();
   Abbv->Add(BitCodeAbbrevOp(bitc::TYPE_CODE_OPAQUE_POINTER));
   Abbv->Add(BitCodeAbbrevOp(0)); // Addrspace = 0
   unsigned OpaquePtrAbbrev = Stream.EmitAbbrev(std::move(Abbv));
@@ -995,8 +988,6 @@ void ModuleBitcodeWriter::writeTypeTable() {
         Code = bitc::TYPE_CODE_POINTER;
         TypeVals.push_back(VE.getTypeID(PTy->getNonOpaquePointerElementType()));
         TypeVals.push_back(AddressSpace);
-        if (AddressSpace == 0)
-          AbbrevToUse = PtrAbbrev;
       }
       break;
     }