aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/InstrSelection/InstrSelection.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/CodeGen/InstrSelection/InstrSelection.cpp b/lib/CodeGen/InstrSelection/InstrSelection.cpp
index 1eb507a..583df38 100644
--- a/lib/CodeGen/InstrSelection/InstrSelection.cpp
+++ b/lib/CodeGen/InstrSelection/InstrSelection.cpp
@@ -202,11 +202,9 @@ InsertCode4AllPhisInMeth(Function *F, TargetMachine &target)
//
for( ; IIt != InstList.end(); ++IIt ) {
- if( (*IIt)->getOpcode() == Instruction::PHINode ) {
-
- PHINode *PN = (PHINode *) (*IIt);
-
- Value *PhiCpRes = new Value(PN->getType(),PN->getValueType(),"PhiCp:");
+ if (PHINode *PN = dyn_cast<PHINode>(*IIt)) {
+ // FIXME: This is probably wrong...
+ Value *PhiCpRes = new PHINode(PN->getType(), "PhiCp:");
// for each incoming value of the phi, insert phi elimination
//