Beispiel #1
0
 private void visitInstruction(Instruction instr) {
   if (instr instanceof StartingInstruction) {
     StartingInstruction startingInstr = (StartingInstruction) instr;
     Instruction_phi phi = startingInstr.getInstruction();
     EList<BasicBlockRef> labels = phi.getLabels();
     int valueIndex = 0;
     for (BasicBlockRef blockRef : labels) {
       BasicBlock block = blockRef.getRef();
       List<Phi> valueRefs = basicBlockReferences.get(block);
       ValueRef valueRef = phi.getValues().get(valueIndex++);
       valueRefs.add(new Phi(startingInstr.getName(), valueRef, phi.getType(), startingInstr));
     }
   }
 }
Beispiel #2
0
 public LocalValueRefImpl getLocalVariablesInPhi(BasicBlock block) {
   int i = 0;
   Instruction_phi instruction = getStartingInstr().getInstruction();
   for (BasicBlockRef label : instruction.getLabels()) {
     if (label.getRef().equals(block)) {
       break;
     }
     i++;
   }
   ValueRef value = instruction.getValues().get(i);
   if (value instanceof LocalValueRefImpl) {
     return (LocalValueRefImpl) value;
   } else {
     return null;
   }
 }