public void removePhiFuncVariable(String origName, String varName) { for (int i = 0; i < getPhiFunctions().size(); i++) { PhiFunction phiFunc = getPhiFunctions().get(i); if (0 == phiFunc.getVariable().getName().compareTo(origName)) { __debugPrintln("Removing Phi Func ref: " + origName + " to " + varName); phiFunc.deleteVariable(varName); } } }
// Updates this block's Phi Function public void updatePhiFunction(Argument arg, Symbol sym) { for (int i = 0; i < getPhiFunctions().size(); i++) { PhiFunction phiFunc = getPhiFunctions().get(i); if (0 == phiFunc.getVariable().getName().compareTo(arg.getOrigName())) { __debugPrintln("Updating Phi Func: " + arg.getOrigName() + " to " + sym.getIntegerValue()); phiFunc.updateVariable(arg.getName(), new Symbol(sym)); break; } } }
public void updatePhiFunctionCurName(String strCurName, Symbol sym) { for (int i = 0; i < getPhiFunctions().size(); i++) { PhiFunction phiFunc = getPhiFunctions().get(i); if (phiFunc.varInMergeList(strCurName)) { __debugPrintln( "Updating Phi Func: " + phiFunc.getVariable().getName() + " to " + sym.getIntegerValue()); phiFunc.updateVariable(strCurName, new Symbol(sym)); break; } } }
public Symbol getPhiFunctionSymbol(String strName) { Symbol symRet = null; for (int i = 0; i < getPhiFunctions().size(); i++) { PhiFunction phiFunc = getPhiFunctions().get(i); if (0 == phiFunc.getVariable().getName().compareTo(strName)) { __debugPrintln("Found Symbol for " + strName); symRet = new Symbol( "" + phiFunc.getConstValue(), Symbol.SymbolType.CONSTANT, Symbol.DataType.INTEGER); symRet.setIntegerValue(phiFunc.getConstValue()); break; } } return symRet; }
public PhiFunction getPhiFunctionMatchingCurName(String strCurName) { PhiFunction ret = null; for (int i = 0; i < getPhiFunctions().size(); i++) { PhiFunction phiFunc = getPhiFunctions().get(i); if (phiFunc.varInMergeList(strCurName)) { __debugPrintln( "Found Phi Func : " + phiFunc.getVariable().getName() + " matching " + strCurName); ret = phiFunc; break; } } return ret; }