本文整理汇总了Java中com.ibm.wala.ssa.SSAConditionalBranchInstruction类的典型用法代码示例。如果您正苦于以下问题:Java SSAConditionalBranchInstruction类的具体用法?Java SSAConditionalBranchInstruction怎么用?Java SSAConditionalBranchInstruction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SSAConditionalBranchInstruction类属于com.ibm.wala.ssa包,在下文中一共展示了SSAConditionalBranchInstruction类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getExprForCondition
import com.ibm.wala.ssa.SSAConditionalBranchInstruction; //导入依赖的package包/类
public static Expr getExprForCondition(ValidityChecker vc, BasicBlock basicBlock, IR entryIR) {
// According to WALA documentation these blocks contain exactly one instruction
SSAConditionalBranchInstruction inst = (SSAConditionalBranchInstruction) basicBlock.getLastInstruction();
int var = inst.getUse(0); // This Instruction contains exactly two uses (0, 1) and use 1 is always 0.
Expr expr = getExprForInstruction(vc, var, entryIR, null);
return expr;
}
示例2: getExprForConditionalBranchInstruction
import com.ibm.wala.ssa.SSAConditionalBranchInstruction; //导入依赖的package包/类
public static Expr getExprForConditionalBranchInstruction(ValidityChecker vc, SSAInstruction inst, IR entryIR) {
// According to WALA documentation these blocks contain exactly one instruction
SSAConditionalBranchInstruction condInst = (SSAConditionalBranchInstruction) inst;
int var = condInst.getUse(0); // This Instruction contains exactly two uses (0, 1) and use 1 is always 0.
Expr expr = getExprForInstruction(vc, var, entryIR, BinaryOpInstruction.Operator.AND); // The AND operator identifies the expression as a boolean type
return expr;
}
示例3: getConditions
import com.ibm.wala.ssa.SSAConditionalBranchInstruction; //导入依赖的package包/类
/**
* Get the corresponding instruction for each conditional branch
* @return
*/
public static ArrayList<SSAInstruction> getConditions(HashMap<Integer, BasicBlockInContext<IExplodedBasicBlock>> sgNodes) {
log.debug("** get conditional branch instructions");
ArrayList<SSAInstruction> list = new ArrayList<SSAInstruction>();
for(BasicBlockInContext<IExplodedBasicBlock> bbic : sgNodes.values()) {
SSAInstruction inst = bbic.getLastInstruction();
if(inst != null && inst instanceof SSAConditionalBranchInstruction) {
log.debug("conditional branch instruction: " + inst);
list.add(inst);
}
}
return list;
}
示例4: analyzeConditional
import com.ibm.wala.ssa.SSAConditionalBranchInstruction; //导入依赖的package包/类
/**
* This will search for a SSAConditionalBranchInstruction in the node and
* print information related to this conditional to the console
*
* @param node
*/
public static void analyzeConditional(CGNode node) {
// The symbol table maps a variable number in the ssa to the actual name and value
SymbolTable symtab = node.getIR().getSymbolTable();
SSACFG cfg = node.getIR().getControlFlowGraph();
// Iterate over all basic blocks
for (int i = 0; i < cfg.getNumberOfNodes(); i++) {
BasicBlock bb = cfg.getBasicBlock(i);
// Iterate over all instructions in the basic block
List<SSAInstruction> instructions = bb.getAllInstructions();
if (containsConditional(instructions)) {
for (SSAInstruction ins : instructions) {
if (ins.toString().contains("binaryop")) {
System.out.print(ins);
for (int u = 0; u < ins.getNumberOfUses(); u++) {
System.out.print(" && ");
// In case of null we have a phi instruction. JavaScript apparently does not handle this very well.
if (symtab.getValue(ins.getUse(u)) == null)
System.out.print(ins.getUse(u) + " depends on previous if ");
else
System.out.print(ins.getUse(u) + " = " + symtab.getValue(ins.getUse(u)));
}
System.out.println("");
}
if (ins instanceof SSAConditionalBranchInstruction) {
System.out.println(ins.toString(symtab));
System.out.println("----------");
}
}
}
}
}
示例5: containsConditional
import com.ibm.wala.ssa.SSAConditionalBranchInstruction; //导入依赖的package包/类
private static boolean containsConditional(List<SSAInstruction> list) {
for (SSAInstruction ins : list) {
if (ins instanceof SSAConditionalBranchInstruction)
return true;
}
return false;
}
示例6: visitConditionalBranch
import com.ibm.wala.ssa.SSAConditionalBranchInstruction; //导入依赖的package包/类
/** Does nothing; control dependence handled by guard computation. */
public final void visitConditionalBranch(SSAConditionalBranchInstruction instruction) {}
示例7: visitConditionalBranch
import com.ibm.wala.ssa.SSAConditionalBranchInstruction; //导入依赖的package包/类
/** Calls {@linkplain #visitInstruction(SSAInstruction)}. */
public void visitConditionalBranch(SSAConditionalBranchInstruction instruction) {
visitInstruction(instruction); }
示例8: visitConditionalBranch
import com.ibm.wala.ssa.SSAConditionalBranchInstruction; //导入依赖的package包/类
@Override
public void visitConditionalBranch(SSAConditionalBranchInstruction instruction) {
// TODO implement support
res = new ConditionalBranchNode();
}