From 70bf8d0495cee2772ae1b0c1b046721e0339f62f Mon Sep 17 00:00:00 2001 From: Lukáš Zaoral Date: Sat, 5 Mar 2022 16:50:36 +0100 Subject: llvm14: PointerType::getElementType() was deprecated ... for LLVM 14 in [1] and has already been removed from the LLVM 15 branch in [2]. Some changes are only temporary to silence the warning though, as Type::getPointerElementType() is planned to be removed as well. [3] [1] https://reviews.llvm.org/D117885/new/ [2] https://github.com/llvm/llvm-project/commit/d593cf7 [3] https://llvm.org/docs/OpaquePointers.html#migration-instructions --- lib/Module/FunctionAlias.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/Module') diff --git a/lib/Module/FunctionAlias.cpp b/lib/Module/FunctionAlias.cpp index a98b74fb..aa80b35d 100644 --- a/lib/Module/FunctionAlias.cpp +++ b/lib/Module/FunctionAlias.cpp @@ -135,10 +135,8 @@ bool FunctionAliasPass::runOnModule(Module &M) { const FunctionType *FunctionAliasPass::getFunctionType(const GlobalValue *gv) { const Type *type = gv->getType(); - while (type->isPointerTy()) { - const PointerType *ptr = cast(type); - type = ptr->getElementType(); - } + while (type->isPointerTy()) + type = type->getPointerElementType(); return cast(type); } -- cgit 1.4.1