// // This file is distributed under the MIT License. See LICENSE.md for details. // #include "FuncOrCallInst.h" using namespace dla; using namespace llvm; bool FuncOrCallInst::isNull() const { if (holds_alternative(Val)) return get(Val) == nullptr; if (holds_alternative(Val)) return get(Val) == nullptr; revng_abort("Can only be Function or CallInst"); } const Value *FuncOrCallInst::getVal() const { if (holds_alternative(Val)) return static_cast(get(Val)); if (holds_alternative(Val)) return static_cast(get(Val)); revng_abort("Can only be Function or CallInst"); } const Type *FuncOrCallInst::getRetType() const { if (holds_alternative(Val)) return dla::getRetType(get(Val)); if (holds_alternative(Val)) return dla::getRetType(get(Val)); revng_abort("Can only be Function or CallInst"); } unsigned long FuncOrCallInst::arg_size() const { if (holds_alternative(Val)) return dla::arg_size(get(Val)); if (holds_alternative(Val)) return dla::arg_size(get(Val)); revng_abort("Can only be Function or CallInst"); } const Value *FuncOrCallInst::getArg(unsigned Idx) const { if (holds_alternative(Val)) return dla::getArgs(get(Val)).begin() + Idx; if (holds_alternative(Val)) return *(dla::getArgs(get(Val)).begin() + Idx); revng_abort("Can only be Function or CallInst"); }