summaryrefslogtreecommitdiff
path: root/lib/VMCore/Instruction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/Instruction.cpp')
-rw-r--r--lib/VMCore/Instruction.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index d3f62d0d08..9792adaaa1 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/VMCore/Instruction.cpp
@@ -286,9 +286,10 @@ bool Instruction::isUsedOutsideOfBlock(const BasicBlock *BB) const {
for (const_use_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
// PHI nodes uses values in the corresponding predecessor block. For other
// instructions, just check to see whether the parent of the use matches up.
- const PHINode *PN = dyn_cast<PHINode>(*UI);
+ const User *U = *UI;
+ const PHINode *PN = dyn_cast<PHINode>(U);
if (PN == 0) {
- if (cast<Instruction>(*UI)->getParent() != BB)
+ if (cast<Instruction>(U)->getParent() != BB)
return true;
continue;
}