Skip to content

Commit

Permalink
Remove deprecated PointerType.isOpaque calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Jan 27, 2024
1 parent 8f31fba commit 43c1029
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/llvm-remove-addrspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,7 @@ class AddrspaceRemoveTypeRemapper : public ValueMapTypeRemapper {

DstTy = SrcTy;
if (auto Ty = dyn_cast<PointerType>(SrcTy)) {
if (Ty->isOpaque()) {
DstTy = PointerType::get(Ty->getContext(), ASRemapper(Ty->getAddressSpace()));
}
else {
//Remove once opaque pointer transition is complete
DstTy = PointerType::get(
remapType(Ty->getNonOpaquePointerElementType()),
ASRemapper(Ty->getAddressSpace()));
}
DstTy = PointerType::get(Ty->getContext(), ASRemapper(Ty->getAddressSpace()));
}
else if (auto Ty = dyn_cast<FunctionType>(SrcTy)) {
SmallVector<Type *, 4> Params;
Expand Down Expand Up @@ -158,11 +150,6 @@ class AddrspaceRemoveValueMaterializer : public ValueMaterializer {
// asserts remapType(typeof arg0) == typeof mapValue(arg0).
Constant *Src = CE->getOperand(0);
auto ptrty = cast<PointerType>(Src->getType()->getScalarType());
//Remove once opaque pointer transition is complete
if (!ptrty->isOpaque()) {
Type *SrcTy = remapType(ptrty->getNonOpaquePointerElementType());
DstV = CE->getWithOperands(Ops, Ty, false, SrcTy);
}
}
else
DstV = CE->getWithOperands(Ops, Ty);
Expand Down

0 comments on commit 43c1029

Please sign in to comment.