[llvm] 01dacc4 - [Bitcode] Remove typed pointer abbreviation

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 13:11:24 PST 2023


Author: Arthur Eubanks
Date: 2023-02-27T13:11:09-08:00
New Revision: 01dacc41f3c20b9bfddf0ca68b63f16666a1725e

URL: https://github.com/llvm/llvm-project/commit/01dacc41f3c20b9bfddf0ca68b63f16666a1725e
DIFF: https://github.com/llvm/llvm-project/commit/01dacc41f3c20b9bfddf0ca68b63f16666a1725e.diff

LOG: [Bitcode] Remove typed pointer abbreviation

Since typed pointers are deprecated.

Reviewed By: nikic

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

Added: 
    

Modified: 
    llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 16d13993111c8..51756eb8ecb06 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -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;
     }


        


More information about the llvm-commits mailing list