diff options
author | Martin Nowack <m.nowack@imperial.ac.uk> | 2023-10-30 14:46:22 +0000 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2024-02-08 13:17:19 +0000 |
commit | 657f9618023923f08adac11eee0a9566b808f805 (patch) | |
tree | 394afc2f0d073a0ecb3b1e4388882f1a2b2be1cb /lib/Module/FunctionAlias.cpp | |
parent | 44a38ba6f54046cb4a9f8b08a0b8711ad5d5ebaa (diff) | |
download | klee-657f9618023923f08adac11eee0a9566b808f805.tar.gz |
Add support for opaque pointers
Diffstat (limited to 'lib/Module/FunctionAlias.cpp')
-rw-r--r-- | lib/Module/FunctionAlias.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Module/FunctionAlias.cpp b/lib/Module/FunctionAlias.cpp index aa80b35d..c00bde58 100644 --- a/lib/Module/FunctionAlias.cpp +++ b/lib/Module/FunctionAlias.cpp @@ -134,10 +134,16 @@ bool FunctionAliasPass::runOnModule(Module &M) { } const FunctionType *FunctionAliasPass::getFunctionType(const GlobalValue *gv) { +#if LLVM_VERSION_CODE >= LLVM_VERSION(15, 0) + if (auto *ft = dyn_cast<FunctionType>(gv->getType())) + return ft; + return dyn_cast<FunctionType>(gv->getValueType()); +#else const Type *type = gv->getType(); while (type->isPointerTy()) type = type->getPointerElementType(); - return cast<FunctionType>(type); + return dyn_cast<FunctionType>(type); +#endif } bool FunctionAliasPass::checkType(const GlobalValue *match, |