diff options
author | Dan Gohman <sunfish@google.com> | 2014-02-14 11:36:49 -0800 |
---|---|---|
committer | Dan Gohman <sunfish@google.com> | 2014-02-14 11:38:17 -0800 |
commit | 8dd47ed0fe367f1d6c0f7cb404d58b24be8b6f5c (patch) | |
tree | 4f9c9aeab4d4b8aa07a6428e21ceb89552c46d37 | |
parent | 7db0b92aeaf21b8e49bb3b02ba43d61a114cbcf5 (diff) |
Another minor code simplification.
-rw-r--r-- | lib/Target/JSBackend/SimplifyAllocas.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Target/JSBackend/SimplifyAllocas.cpp b/lib/Target/JSBackend/SimplifyAllocas.cpp index fb6d65cd4b..858ded32a1 100644 --- a/lib/Target/JSBackend/SimplifyAllocas.cpp +++ b/lib/Target/JSBackend/SimplifyAllocas.cpp @@ -72,12 +72,11 @@ bool SimplifyAllocas::runOnFunction(Function &Func) { } std::vector<Instruction*> Aliases; // the bitcasts of this alloca for (Instruction::use_iterator UI = AI->use_begin(), UE = AI->use_end(); UI != UE && !Fail; ++UI) { - Instruction *U = dyn_cast<Instruction>(*UI); - if (!U || U->getOpcode() != Instruction::BitCast) { Fail = true; break; } + Instruction *U = cast<Instruction>(*UI); + if (U->getOpcode() != Instruction::BitCast) { Fail = true; break; } // bitcasting just to do loads and stores is ok for (Instruction::use_iterator BUI = U->use_begin(), BUE = U->use_end(); BUI != BUE && !Fail; ++BUI) { - Instruction *BU = dyn_cast<Instruction>(*BUI); - if (!BU) { Fail = true; break; } + Instruction *BU = cast<Instruction>(*BUI); if (BU->getOpcode() == Instruction::Load) { CHECK_TYPE(BU->getType()); break; |