diff options
author | Nikita Popov <npopov@redhat.com> | 2023-07-18 11:39:02 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-07-18 11:41:46 +0200 |
commit | 35bdcb03d91fb98f6d400505183613f6f8aa7af3 (patch) | |
tree | 855d271d4273c8a46463fbadd025506d2dfd4786 /llvm/lib | |
parent | 3fa5ee67babad11a88943ede42a4123299acf31a (diff) | |
download | llvm-35bdcb03d91fb98f6d400505183613f6f8aa7af3.zip llvm-35bdcb03d91fb98f6d400505183613f6f8aa7af3.tar.gz llvm-35bdcb03d91fb98f6d400505183613f6f8aa7af3.tar.bz2 |
[llvm] Remove uses of isOpaqueOrPointeeTypeEquals() (NFC)
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/Function.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/Transforms/Coroutines/Coroutines.cpp | 11 |
2 files changed, 5 insertions, 13 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index 57163ad..27219e8 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -1609,12 +1609,7 @@ static bool matchIntrinsicType( if (!ThisArgVecTy || !ReferenceType || (ReferenceType->getElementCount() != ThisArgVecTy->getElementCount())) return true; - PointerType *ThisArgEltTy = - dyn_cast<PointerType>(ThisArgVecTy->getElementType()); - if (!ThisArgEltTy) - return true; - return !ThisArgEltTy->isOpaqueOrPointeeTypeMatches( - ReferenceType->getElementType()); + return !ThisArgVecTy->getElementType()->isPointerTy(); } case IITDescriptor::VecElementArgument: { if (D.getArgumentNumber() >= ArgTys.size()) diff --git a/llvm/lib/Transforms/Coroutines/Coroutines.cpp b/llvm/lib/Transforms/Coroutines/Coroutines.cpp index 399bff7..b101326 100644 --- a/llvm/lib/Transforms/Coroutines/Coroutines.cpp +++ b/llvm/lib/Transforms/Coroutines/Coroutines.cpp @@ -612,18 +612,15 @@ static void checkAsyncContextProjectFunction(const Instruction *I, Function *F) { auto *FunTy = cast<FunctionType>(F->getValueType()); Type *Int8Ty = Type::getInt8Ty(F->getContext()); - auto *RetPtrTy = dyn_cast<PointerType>(FunTy->getReturnType()); - if (!RetPtrTy || !RetPtrTy->isOpaqueOrPointeeTypeMatches(Int8Ty)) + if (!FunTy->getReturnType()->isPointerTy()) fail(I, "llvm.coro.suspend.async resume function projection function must " - "return an i8* type", + "return a ptr type", F); - if (FunTy->getNumParams() != 1 || !FunTy->getParamType(0)->isPointerTy() || - !cast<PointerType>(FunTy->getParamType(0)) - ->isOpaqueOrPointeeTypeMatches(Int8Ty)) + if (FunTy->getNumParams() != 1 || !FunTy->getParamType(0)->isPointerTy()) fail(I, "llvm.coro.suspend.async resume function projection function must " - "take one i8* type as parameter", + "take one ptr type as parameter", F); } |