From bda35257b64545870c6de5fe8aba573ef82945d9 Mon Sep 17 00:00:00 2001 From: Julian Büning Date: Sat, 10 Oct 2020 15:13:40 +0200 Subject: Casting.h: isa_and_nonnull<> --- lib/Module/FunctionAlias.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/Module') diff --git a/lib/Module/FunctionAlias.cpp b/lib/Module/FunctionAlias.cpp index 2ab8cfd4..3fb0ec9a 100644 --- a/lib/Module/FunctionAlias.cpp +++ b/lib/Module/FunctionAlias.cpp @@ -9,8 +9,9 @@ #include "Passes.h" -#include "klee/Support/OptionCategories.h" +#include "klee/Support/Casting.h" #include "klee/Support/ErrorHandling.h" +#include "klee/Support/OptionCategories.h" #include "llvm/IR/GlobalAlias.h" #include "llvm/Support/CommandLine.h" @@ -221,13 +222,10 @@ bool FunctionAliasPass::tryToReplace(GlobalValue *match, } bool FunctionAliasPass::isFunctionOrGlobalFunctionAlias(const GlobalValue *gv) { - if (gv == nullptr) - return false; - - if (isa(gv)) + if (isa_and_nonnull(gv)) return true; - if (const auto *ga = dyn_cast(gv)) { + if (const auto *ga = dyn_cast_or_null(gv)) { const auto *aliasee = dyn_cast(ga->getAliasee()); if (!aliasee) { // check if GlobalAlias is alias bitcast -- cgit 1.4.1