mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Forgot dyn_cast check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132025 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -881,8 +881,8 @@ void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC,
|
|||||||
|
|
||||||
for (Value::use_iterator UI = LIC->use_begin(), E = LIC->use_end();
|
for (Value::use_iterator UI = LIC->use_begin(), E = LIC->use_end();
|
||||||
UI != E; ++UI) {
|
UI != E; ++UI) {
|
||||||
Instruction *U = cast<Instruction>(*UI);
|
Instruction *U = dyn_cast<Instruction>(*UI);
|
||||||
if (!L->contains(U))
|
if (!U || !L->contains(U))
|
||||||
continue;
|
continue;
|
||||||
U->replaceUsesOfWith(LIC, Replacement);
|
U->replaceUsesOfWith(LIC, Replacement);
|
||||||
Worklist.push_back(U);
|
Worklist.push_back(U);
|
||||||
@@ -896,8 +896,8 @@ void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC,
|
|||||||
// can. This case occurs when we unswitch switch statements.
|
// can. This case occurs when we unswitch switch statements.
|
||||||
for (Value::use_iterator UI = LIC->use_begin(), E = LIC->use_end();
|
for (Value::use_iterator UI = LIC->use_begin(), E = LIC->use_end();
|
||||||
UI != E; ++UI) {
|
UI != E; ++UI) {
|
||||||
Instruction *U = cast<Instruction>(*UI);
|
Instruction *U = dyn_cast<Instruction>(*UI);
|
||||||
if (!L->contains(U))
|
if (!U || !L->contains(U))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Worklist.push_back(U);
|
Worklist.push_back(U);
|
||||||
|
Reference in New Issue
Block a user