aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/JSBackend/SimplifyAllocas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/JSBackend/SimplifyAllocas.cpp')
-rw-r--r--lib/Target/JSBackend/SimplifyAllocas.cpp7
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;