Skip to content

Commit

Permalink
fix(callgraph): strip bitcast through constant expr
Browse files Browse the repository at this point in the history
  • Loading branch information
caballa committed Jun 21, 2021
1 parent ca53cad commit 9d8d71a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/seadsa/DsaCompleteCallGraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ static const Value *findUniqueReturnValue(const Function &F) {
}

static Value *stripBitCast(Value *V) {
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
if (CE->isCast()) {
return CE->getOperand(0);
}
}
if (BitCastInst *BC = dyn_cast<BitCastInst>(V)) {
return BC->getOperand(0);
} else {
return V;
}
return V;
}

static bool typeCompatible(const Type *t1, const Type *t2) {
Expand Down

0 comments on commit 9d8d71a

Please sign in to comment.