Skip to content

Commit c42eda5

Browse files
committed
IROutliner: cast instead of dyn_cast and assert
1 parent e844407 commit c42eda5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Transforms/IPO/IROutliner.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,8 @@ static void getSortedConstantKeys(std::vector<Value *> &SortedKeys,
179179

180180
stable_sort(SortedKeys, [](const Value *LHS, const Value *RHS) {
181181
assert(LHS && RHS && "Expected non void values.");
182-
const ConstantInt *LHSC = dyn_cast<ConstantInt>(LHS);
183-
const ConstantInt *RHSC = dyn_cast<ConstantInt>(RHS);
184-
assert(RHSC && "Not a constant integer in return value?");
185-
assert(LHSC && "Not a constant integer in return value?");
182+
const ConstantInt *LHSC = cast<ConstantInt>(LHS);
183+
const ConstantInt *RHSC = cast<ConstantInt>(RHS);
186184

187185
return LHSC->getLimitedValue() < RHSC->getLimitedValue();
188186
});

0 commit comments

Comments
 (0)