Skip to content

Commit

Permalink
Fixes for LLVM 11 compat CallSite.h (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekilmer authored Mar 2, 2021
1 parent 6fc78e6 commit 3d71960
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/remill/BC/Compat/CallSite.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ struct CallSite {
::llvm::CallBase *cb;

CallSite(::llvm::Instruction *inst)
: cb(::llvm::dyn_cast<::llvm::CallBase>(inst)) {}
: cb(::llvm::dyn_cast_or_null<::llvm::CallBase>(inst)) {}

CallSite(::llvm::User *user)
: CallSite(::llvm::dyn_cast<::llvm::Instruction>(user)) {}
: CallSite(::llvm::dyn_cast_or_null<::llvm::Instruction>(user)) {}

bool isInvoke() const {
return ::llvm::isa<::llvm::InvokeInst>(cb);
return cb && ::llvm::isa<::llvm::InvokeInst>(*cb);
}

bool isCall() const {
return ::llvm::isa<::llvm::CallInst>(cb);
return cb && ::llvm::isa<::llvm::CallInst>(*cb);
}

::llvm::Value *getCalledValue() {
Expand Down

0 comments on commit 3d71960

Please sign in to comment.