Skip to content

Commit fd20427

Browse files
committed
!fixup use dyn_cast
1 parent 311d8fe commit fd20427

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Transforms/Utils/Evaluator.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@ isSimpleEnoughValueToCommitHelper(Constant *C,
7474
return true;
7575
}
7676

77-
if (isa<ConstantPtrAuth>(C))
78-
return false;
79-
8077
// We don't know exactly what relocations are allowed in constant expressions,
8178
// so we allow &global+constantoffset, which is safe and uniformly supported
8279
// across targets.
83-
ConstantExpr *CE = cast<ConstantExpr>(C);
80+
ConstantExpr *CE = dyn_cast<ConstantExpr>(C);
81+
if (!CE)
82+
return false;
8483
switch (CE->getOpcode()) {
8584
case Instruction::BitCast:
8685
// Bitcast is fine if the casted value is fine.

0 commit comments

Comments
 (0)