@Override public void caseAMapSeqUpdateStmIR(AMapSeqUpdateStmIR node) throws AnalysisException { if (node.getCol() instanceof SVarExpIR) { SVarExpIR col = (SVarExpIR) node.getCol(); handleStateUpdate(node, col, stateDesInfo.getStateDesVars(node), null, namedTypeHandler.handleMapSeq(node)); } else { log.error("Expected collection of map/sequence" + " update to be a variable expression by now. Got: " + node.getCol()); } }
private boolean cloneNotNeededMapPutGet(SExpIR exp) { INode parent = exp.parent(); if (parent instanceof AMapSeqUpdateStmIR) { AMapSeqUpdateStmIR mapSeqUpd = (AMapSeqUpdateStmIR) parent; if (mapSeqUpd.getCol() == exp) { return true; } } if (parent instanceof AMapSeqGetExpIR) { AMapSeqGetExpIR mapSeqGet = (AMapSeqGetExpIR) parent; if (mapSeqGet.getCol() == exp) { return true; } } return false; }
/** * Called by the {@link AMapSeqUpdateStmIR} node from {@link AMapSeqUpdateStmIR#apply(IIsaAnalysis)}. * @param node the calling {@link AMapSeqUpdateStmIR} node */ public void caseAMapSeqUpdateStmIR(AMapSeqUpdateStmIR node) throws AnalysisException { _visitedNodes.add(node); inAMapSeqUpdateStmIR(node); if(node.getCol() != null && !_visitedNodes.contains(node.getCol())) { node.getCol().apply(this); } if(node.getIndex() != null && !_visitedNodes.contains(node.getIndex())) { node.getIndex().apply(this); } if(node.getValue() != null && !_visitedNodes.contains(node.getValue())) { node.getValue().apply(this); } outAMapSeqUpdateStmIR(node); }
/** * Called by the {@link AMapSeqUpdateStmIR} node from {@link AMapSeqUpdateStmIR#apply(IAnalysis)}. * @param node the calling {@link AMapSeqUpdateStmIR} node */ public void caseAMapSeqUpdateStmIR(AMapSeqUpdateStmIR node) throws AnalysisException { _visitedNodes.add(node); inAMapSeqUpdateStmIR(node); if(node.getCol() != null && !_visitedNodes.contains(node.getCol())) { node.getCol().apply(this); } if(node.getIndex() != null && !_visitedNodes.contains(node.getIndex())) { node.getIndex().apply(this); } if(node.getValue() != null && !_visitedNodes.contains(node.getValue())) { node.getValue().apply(this); } outAMapSeqUpdateStmIR(node); }
/** * Called by the {@link AMapSeqUpdateStmIR} node from {@link AMapSeqUpdateStmIR#apply(IAnalysis)}. * @param node the calling {@link AMapSeqUpdateStmIR} node */ public void caseAMapSeqUpdateStmIR(AMapSeqUpdateStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAMapSeqUpdateStmIR(node, question); if(node.getCol() != null && !_visitedNodes.contains(node.getCol())) { node.getCol().apply(this, question); } if(node.getIndex() != null && !_visitedNodes.contains(node.getIndex())) { node.getIndex().apply(this, question); } if(node.getValue() != null && !_visitedNodes.contains(node.getValue())) { node.getValue().apply(this, question); } outAMapSeqUpdateStmIR(node, question); }
private boolean isColOfMapSeq(AFieldExpIR node) { return node.parent() instanceof AMapSeqGetExpIR && ((AMapSeqGetExpIR) node.parent()).getCol() == node || node.parent() instanceof AMapSeqUpdateStmIR && ((AMapSeqUpdateStmIR) node.parent()).getCol() == node; }
/** * Called by the {@link AMapSeqUpdateStmIR} node from {@link AMapSeqUpdateStmIR#apply(IAnalysis)}. * @param node the calling {@link AMapSeqUpdateStmIR} node */ public A caseAMapSeqUpdateStmIR(AMapSeqUpdateStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAMapSeqUpdateStmIR(node, question)); if(node.getCol() != null && !_visitedNodes.contains(node.getCol())) { mergeReturns(retVal,node.getCol().apply(this, question)); } if(node.getIndex() != null && !_visitedNodes.contains(node.getIndex())) { mergeReturns(retVal,node.getIndex().apply(this, question)); } if(node.getValue() != null && !_visitedNodes.contains(node.getValue())) { mergeReturns(retVal,node.getValue().apply(this, question)); } mergeReturns(retVal,outAMapSeqUpdateStmIR(node, question)); return retVal; }
/** * Called by the {@link AMapSeqUpdateStmIR} node from {@link AMapSeqUpdateStmIR#apply(IAnalysis)}. * @param node the calling {@link AMapSeqUpdateStmIR} node */ public A caseAMapSeqUpdateStmIR(AMapSeqUpdateStmIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAMapSeqUpdateStmIR(node)); if(node.getCol() != null && !_visitedNodes.contains(node.getCol())) { mergeReturns(retVal,node.getCol().apply(this)); } if(node.getIndex() != null && !_visitedNodes.contains(node.getIndex())) { mergeReturns(retVal,node.getIndex().apply(this)); } if(node.getValue() != null && !_visitedNodes.contains(node.getValue())) { mergeReturns(retVal,node.getValue().apply(this)); } mergeReturns(retVal,outAMapSeqUpdateStmIR(node)); return retVal; }
SExpIR col = node.getCol();