private boolean cloneNotNeededAssign(SExpIR exp) { INode parent = exp.parent(); if (parent instanceof AAssignToExpStmIR) { AAssignToExpStmIR assignment = (AAssignToExpStmIR) parent; if (assignment.getTarget() == exp) { return true; } } return false; }
/** * Called by the {@link AAssignToExpStmIR} node from {@link AAssignToExpStmIR#apply(IIsaAnalysis)}. * @param node the calling {@link AAssignToExpStmIR} node */ public void caseAAssignToExpStmIR(AAssignToExpStmIR node) throws AnalysisException { _visitedNodes.add(node); inAAssignToExpStmIR(node); if(node.getTarget() != null && !_visitedNodes.contains(node.getTarget())) { node.getTarget().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outAAssignToExpStmIR(node); }
/** * Called by the {@link AAssignToExpStmIR} node from {@link AAssignToExpStmIR#apply(IAnalysis)}. * @param node the calling {@link AAssignToExpStmIR} node */ public void caseAAssignToExpStmIR(AAssignToExpStmIR node) throws AnalysisException { _visitedNodes.add(node); inAAssignToExpStmIR(node); if(node.getTarget() != null && !_visitedNodes.contains(node.getTarget())) { node.getTarget().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outAAssignToExpStmIR(node); }
/** * Called by the {@link AAssignToExpStmIR} node from {@link AAssignToExpStmIR#apply(IAnalysis)}. * @param node the calling {@link AAssignToExpStmIR} node */ public void caseAAssignToExpStmIR(AAssignToExpStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAAssignToExpStmIR(node, question); if(node.getTarget() != null && !_visitedNodes.contains(node.getTarget())) { node.getTarget().apply(this, question); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this, question); } outAAssignToExpStmIR(node, question); }
@Override public void caseAAssignToExpStmIR(AAssignToExpStmIR node) throws AnalysisException { if (node.getTarget() instanceof AFieldExpIR) { AFieldExpIR field = (AFieldExpIR) node.getTarget(); if (field.getObject().getType() instanceof AUnionTypeIR) { if (p != null) { log.error("Expected no state designator data by now"); } p = this.stateDesInfo.remove(node); handAssignRighHandSide(node); handleAssignTarget(node); } } else { handAssignRighHandSide(node); } p = null; }
/** * Called by the {@link AAssignToExpStmIR} node from {@link AAssignToExpStmIR#apply(IAnalysis)}. * @param node the calling {@link AAssignToExpStmIR} node */ public A caseAAssignToExpStmIR(AAssignToExpStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAAssignToExpStmIR(node, question)); if(node.getTarget() != null && !_visitedNodes.contains(node.getTarget())) { mergeReturns(retVal,node.getTarget().apply(this, question)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this, question)); } mergeReturns(retVal,outAAssignToExpStmIR(node, question)); return retVal; }
public void handAssignRighHandSide(AAssignToExpStmIR node) throws AnalysisException { if (node.getExp() != null) { node.getExp().apply(this); } if (!castNotNeeded(node.getExp(), node.getTarget().getType())) { if (!(node.getTarget().getType() instanceof AUnionTypeIR)) { correctTypes(node.getExp(), node.getTarget().getType()); } } }
/** * Called by the {@link AAssignToExpStmIR} node from {@link AAssignToExpStmIR#apply(IAnalysis)}. * @param node the calling {@link AAssignToExpStmIR} node */ public A caseAAssignToExpStmIR(AAssignToExpStmIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAAssignToExpStmIR(node)); if(node.getTarget() != null && !_visitedNodes.contains(node.getTarget())) { mergeReturns(retVal,node.getTarget().apply(this)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this)); } mergeReturns(retVal,outAAssignToExpStmIR(node)); return retVal; }
@Override public void caseAAssignToExpStmIR(AAssignToExpStmIR node) throws AnalysisException { if (node.getExp() != null) { node.getExp().apply(this); handleExp(node.getExp(), node.getTarget().getType()); } }
@Override public void caseAAssignToExpStmIR(AAssignToExpStmIR node) throws AnalysisException { if(transAssistant.getInfo().getDeclAssistant().parentIsTest(node.getAncestor(ADefaultClassDeclIR.class))) { return; } if(transAssistant.getInfo().getDeclAssistant().isFullyAbstract(transAssistant.getInfo().getDeclAssistant().getSourceClass(node), transAssistant.getInfo())) { return; } if (node.getTarget() instanceof SVarExpIR) { SVarExpIR var = (SVarExpIR) node.getTarget(); if (var.getIsLocal()) { return; } } handleStateUpdate(node); }
public AAssignToExpStmIR castFieldObj(AAssignToExpStmIR assign, AFieldExpIR target, STypeIR possibleType) { ACastUnaryExpIR cast = new ACastUnaryExpIR(); cast.setType(possibleType.clone()); cast.setExp(target.getObject().clone()); AAssignToExpStmIR assignCopy = assign.clone(); AFieldExpIR fieldCopy = target.clone(); transAssistant.replaceNodeWith(fieldCopy.getObject(), cast); transAssistant.replaceNodeWith(assignCopy.getTarget(), fieldCopy); return assignCopy; }
if (assignment.getTarget() == exp)