Skip to content

Commit 1ff06c5

Browse files
committed
[verifier] Get rid of getResolverFunctionType. NFC (#102631)
With opaque pointers we can just get the pointer type for the resolver function by using PointerType::get, making the GlobalIFunc::getResolverFunctionType function obsolete.
1 parent 6ca6780 commit 1ff06c5

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

llvm/include/llvm/IR/GlobalIFunc.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ class GlobalIFunc final : public GlobalObject, public ilist_node<GlobalIFunc> {
8080
static_cast<const GlobalIFunc *>(this)->getResolverFunction());
8181
}
8282

83-
static FunctionType *getResolverFunctionType(Type *IFuncValTy) {
84-
return FunctionType::get(IFuncValTy->getPointerTo(), false);
85-
}
86-
8783
static bool isValidLinkage(LinkageTypes L) {
8884
return isExternalLinkage(L) || isLocalLinkage(L) || isWeakLinkage(L) ||
8985
isLinkOnceLinkage(L);

llvm/lib/IR/Verifier.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,9 +1006,7 @@ void Verifier::visitGlobalIFunc(const GlobalIFunc &GI) {
10061006
Check(isa<PointerType>(Resolver->getFunctionType()->getReturnType()),
10071007
"IFunc resolver must return a pointer", &GI);
10081008

1009-
const Type *ResolverFuncTy =
1010-
GlobalIFunc::getResolverFunctionType(GI.getValueType());
1011-
Check(ResolverTy == ResolverFuncTy->getPointerTo(GI.getAddressSpace()),
1009+
Check(ResolverTy == PointerType::get(Context, GI.getAddressSpace()),
10121010
"IFunc resolver has incorrect type", &GI);
10131011
}
10141012

0 commit comments

Comments
 (0)