about summary refs log tree commit diff homepage
path: root/lib/Module
diff options
context:
space:
mode:
authorLukáš Zaoral <lzaoral@redhat.com>2022-03-05 16:50:36 +0100
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2023-03-20 14:35:16 +0000
commit70bf8d0495cee2772ae1b0c1b046721e0339f62f (patch)
tree615e67e1b77b87e1e90b6e8d07c00b7ae5739c7b /lib/Module
parent425597940be8f35a05a34638764b3c8dc482dc25 (diff)
downloadklee-70bf8d0495cee2772ae1b0c1b046721e0339f62f.tar.gz
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
Diffstat (limited to 'lib/Module')
-rw-r--r--lib/Module/FunctionAlias.cpp6
1 files changed, 2 insertions, 4 deletions
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<PointerType>(type);
-    type = ptr->getElementType();
-  }
+  while (type->isPointerTy())
+    type = type->getPointerElementType();
   return cast<FunctionType>(type);
 }