aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-07-14 10:51:59 +0200
committerNikita Popov <npopov@redhat.com>2023-07-14 11:52:13 +0200
commit3eae1bf4c2c768dfadb03ede0e43168dbac4e683 (patch)
tree7b45d3d3052412126969d70749b9ca5cae3744b1 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent720debcf641080e65974c217c8659fa11199da7d (diff)
downloadllvm-3eae1bf4c2c768dfadb03ede0e43168dbac4e683.zip
llvm-3eae1bf4c2c768dfadb03ede0e43168dbac4e683.tar.gz
llvm-3eae1bf4c2c768dfadb03ede0e43168dbac4e683.tar.bz2
[llvm] Remove uses of getNonOpaquePointerElementType() (NFC)
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index f2bfb4e..9416c7f 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -977,18 +977,11 @@ void ModuleBitcodeWriter::writeTypeTable() {
case Type::PointerTyID: {
PointerType *PTy = cast<PointerType>(T);
unsigned AddressSpace = PTy->getAddressSpace();
- if (PTy->isOpaque()) {
- // OPAQUE_POINTER: [address space]
- Code = bitc::TYPE_CODE_OPAQUE_POINTER;
- TypeVals.push_back(AddressSpace);
- if (AddressSpace == 0)
- AbbrevToUse = OpaquePtrAbbrev;
- } else {
- // POINTER: [pointee type, address space]
- Code = bitc::TYPE_CODE_POINTER;
- TypeVals.push_back(VE.getTypeID(PTy->getNonOpaquePointerElementType()));
- TypeVals.push_back(AddressSpace);
- }
+ // OPAQUE_POINTER: [address space]
+ Code = bitc::TYPE_CODE_OPAQUE_POINTER;
+ TypeVals.push_back(AddressSpace);
+ if (AddressSpace == 0)
+ AbbrevToUse = OpaquePtrAbbrev;
break;
}
case Type::FunctionTyID: {