当前位置: 首页>>代码示例>>Java>>正文


Java SSAConditionalBranchInstruction类代码示例

本文整理汇总了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;
}
 
开发者ID:logicalhacking,项目名称:DASCA,代码行数:9,代码来源:SMTChecker.java

示例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;
}
 
开发者ID:logicalhacking,项目名称:DASCA,代码行数:9,代码来源:SMTChecker.java

示例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;
}
 
开发者ID:logicalhacking,项目名称:DASCA,代码行数:17,代码来源:AnalysisUtil.java

示例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("----------");
                }
            }
        }

    }
}
 
开发者ID:logicalhacking,项目名称:DASCA,代码行数:45,代码来源:CFGAnalyzer.java

示例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;

    }
 
开发者ID:logicalhacking,项目名称:DASCA,代码行数:10,代码来源:CFGAnalyzer.java

示例6: visitConditionalBranch

import com.ibm.wala.ssa.SSAConditionalBranchInstruction; //导入依赖的package包/类
/** Does nothing; control dependence handled by guard computation. */
public final void visitConditionalBranch(SSAConditionalBranchInstruction instruction) {}
 
开发者ID:wala,项目名称:MemSAT,代码行数:3,代码来源:Translator.java

示例7: visitConditionalBranch

import com.ibm.wala.ssa.SSAConditionalBranchInstruction; //导入依赖的package包/类
/** Calls {@linkplain #visitInstruction(SSAInstruction)}. */
public void visitConditionalBranch(SSAConditionalBranchInstruction instruction) {
	visitInstruction(instruction); }
 
开发者ID:wala,项目名称:MemSAT,代码行数:4,代码来源:AbstractInstructionVisitor.java

示例8: visitConditionalBranch

import com.ibm.wala.ssa.SSAConditionalBranchInstruction; //导入依赖的package包/类
@Override
public void visitConditionalBranch(SSAConditionalBranchInstruction instruction) {
	// TODO implement support
	res = new ConditionalBranchNode();
}
 
开发者ID:wondee,项目名称:faststring,代码行数:6,代码来源:InstructionNodeFactory.java


注:本文中的com.ibm.wala.ssa.SSAConditionalBranchInstruction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。