/** * What is the ith value number defined by instruction s? */ protected int getDef(SSAInstruction s, int i) { return s.getDef(i); }
/** * What is the ith value number defined by instruction s? */ protected int getDef(SSAInstruction s, int i) { return s.getDef(i); }
@Override protected int getDef(SSAInstruction inst, int index) { return inst.getDef(index); }
@Override protected int getDef(SSAInstruction inst, int index) { return inst.getDef(index); }
private void emitInstruction(SSAInstruction s) { if (s != null) { instructions[getCurrentInstructionIndex()] = s; for (int i = 0; i < s.getNumberOfDefs(); i++) { if (creators.length < (s.getDef(i) + 1)) { creators = Arrays.copyOf(creators, 2 * s.getDef(i)); } assert s.getDef(i) != -1 : "invalid def " + i + " for " + s; creators[s.getDef(i)] = s; } } }
private void emitInstruction(SSAInstruction s) { instructions[getCurrentInstructionIndex()] = s; for (int i = 0; i < s.getNumberOfDefs(); i++) { if (creators.length < (s.getDef(i) + 1)) { creators = Arrays.copyOf(creators, 2 * s.getDef(i)); } assert s.getDef(i) != -1 : "invalid def " + i + " for " + s; creators[s.getDef(i)] = s; } }
private void emitInstruction(SSAInstruction s) { if (s != null) { instructions[getCurrentInstructionIndex()] = s; for (int i = 0; i < s.getNumberOfDefs(); i++) { if (creators.length < (s.getDef(i) + 1)) { creators = Arrays.copyOf(creators, 2 * s.getDef(i)); } assert s.getDef(i) != -1 : "invalid def " + i + " for " + s; creators[s.getDef(i)] = s; } } }
private void emitInstruction(SSAInstruction s) { instructions[getCurrentInstructionIndex()] = s; for (int i = 0; i < s.getNumberOfDefs(); i++) { if (creators.length < (s.getDef(i) + 1)) { creators = Arrays.copyOf(creators, 2 * s.getDef(i)); } assert s.getDef(i) != -1 : "invalid def " + i + " for " + s; creators[s.getDef(i)] = s; } }
private static void updateForInstruction(Map<Integer, ConstantValue> constants, SymbolTable symbolTable, SSAInstruction s) { for (int j = 0; j < s.getNumberOfDefs(); j++) { symbolTable.ensureSymbol(s.getDef(j)); } for (int j = 0; j < s.getNumberOfUses(); j++) { int vn = s.getUse(j); symbolTable.ensureSymbol(vn); if (constants != null && constants.containsKey(Integer.valueOf(vn))) symbolTable.setConstantValue(vn, constants.get(Integer.valueOf(vn))); } }
private static void updateForInstruction(Map<Integer, ConstantValue> constants, SymbolTable symbolTable, SSAInstruction s) { for (int j = 0; j < s.getNumberOfDefs(); j++) { symbolTable.ensureSymbol(s.getDef(j)); } for (int j = 0; j < s.getNumberOfUses(); j++) { int vn = s.getUse(j); symbolTable.ensureSymbol(vn); if (constants != null && constants.containsKey(Integer.valueOf(vn))) symbolTable.setConstantValue(vn, constants.get(Integer.valueOf(vn))); } }
/** * If we've already created the current instruction, return the value number def'ed by the current instruction. Else, create a * new symbol. */ private int reuseOrCreateDef() { if (getCurrentInstruction() == null) { return symbolTable.newSymbol(); } else { return getCurrentInstruction().getDef(); } }
@Override protected String[] makeNameMap(CAstEntity n, Set<Scope> scopes, SSAInstruction[] insts) { String[] names = super.makeNameMap(n, scopes, insts); for(SSAInstruction inst : insts) { if (inst instanceof PrototypeLookup) { if (names[ inst.getUse(0)] != null) { names[ inst.getDef() ] = names[ inst.getUse(0) ]; } } } return names; }
/** * If we've already created the current instruction, return the value number def'ed by the current instruction. Else, create a * new symbol. */ private int reuseOrCreateDef() { if (getCurrentInstruction() == null) { return symbolTable.newSymbol(); } else { return getCurrentInstruction().getDef(); } }
@Override protected String[] makeNameMap(CAstEntity n, Set<Scope> scopes, SSAInstruction[] insts) { String[] names = super.makeNameMap(n, scopes, insts); for(SSAInstruction inst : insts) { if (inst instanceof PrototypeLookup) { if (names[ inst.getUse(0)] != null) { names[ inst.getDef() ] = names[ inst.getUse(0) ]; } } } return names; }
/** * If we've already created the current instruction, return the value number def'ed by the current instruction. Else, create a * new symbol. */ private int reuseOrCreateDef() { if (getCurrentInstruction() == null || !getCurrentInstruction().hasDef()) { return symbolTable.newSymbol(); } else { return getCurrentInstruction().getDef(); } }
/** * add a constraint indicating that the value def'd by inst can point to a * value of type t */ private void addLvalTypeKeyConstraint(SSAInstruction inst, TypeReference t) { int lval = inst.getDef(0); PointerKey lk = getPointerKeyForLocal(lval); IClass bool = getClassHierarchy().lookupClass(t); InstanceKey key = new ConcreteTypeKey(bool); system.newConstraint(lk, key); }
/** * If we've already created the current instruction, return the value number def'ed by the current instruction. Else, create a * new symbol. */ private int reuseOrCreateDef() { if (getCurrentInstruction() == null || !getCurrentInstruction().hasDef()) { return symbolTable.newSymbol(); } else { return getCurrentInstruction().getDef(); } }
/** * add a constraint indicating that the value def'd by inst can point to a * value of type t */ private void addLvalTypeKeyConstraint(SSAInstruction inst, TypeReference t) { int lval = inst.getDef(0); PointerKey lk = getPointerKeyForLocal(lval); IClass bool = getClassHierarchy().lookupClass(t); InstanceKey key = new ConcreteTypeKey(bool); system.newConstraint(lk, key); }
private void handleNonHeapInstruction(SSAInstruction instruction) { for (int i = 0; i < instruction.getNumberOfDefs(); i++) { int def = instruction.getDef(i); PointerKey defPk = heapModel.getPointerKeyForLocal(node, def); addNode(defPk); for (int j = 0; j < instruction.getNumberOfUses(); j++) { int use = instruction.getUse(j); PointerKey usePk = heapModel.getPointerKeyForLocal(node, use); addNode(usePk); addEdge(defPk, usePk, AssignLabel.noFilter()); } } }
private void handleNonHeapInstruction(SSAInstruction instruction) { for (int i = 0; i < instruction.getNumberOfDefs(); i++) { int def = instruction.getDef(i); PointerKey defPk = heapModel.getPointerKeyForLocal(node, def); addNode(defPk); for (int j = 0; j < instruction.getNumberOfUses(); j++) { int use = instruction.getUse(j); PointerKey usePk = heapModel.getPointerKeyForLocal(node, use); addNode(usePk); addEdge(defPk, usePk, AssignLabel.noFilter()); } } }