/** * Called by the {@link ALetDefExpIR} node from {@link ALetDefExpIR#apply(IAnalysis)}. * @param node the calling {@link ALetDefExpIR} node */ public void caseALetDefExpIR(ALetDefExpIR node) throws AnalysisException { _visitedNodes.add(node); inALetDefExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } { List<AVarDeclIR> copy = new ArrayList<AVarDeclIR>(node.getLocalDefs()); for( AVarDeclIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outALetDefExpIR(node); }
/** * Called by the {@link ALetDefExpIR} node from {@link ALetDefExpIR#apply(IIsaAnalysis)}. * @param node the calling {@link ALetDefExpIR} node */ public void caseALetDefExpIR(ALetDefExpIR node) throws AnalysisException { _visitedNodes.add(node); inALetDefExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } { List<AVarDeclIR> copy = new ArrayList<AVarDeclIR>(node.getLocalDefs()); for( AVarDeclIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outALetDefExpIR(node); }
/** * Called by the {@link ALetDefExpIR} node from {@link ALetDefExpIR#apply(IAnalysis)}. * @param node the calling {@link ALetDefExpIR} node */ public void caseALetDefExpIR(ALetDefExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inALetDefExpIR(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } { List<AVarDeclIR> copy = new ArrayList<AVarDeclIR>(node.getLocalDefs()); for( AVarDeclIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this, question); } outALetDefExpIR(node, question); }
/** * Called by the {@link ALetDefExpIR} node from {@link ALetDefExpIR#apply(IAnalysis)}. * @param node the calling {@link ALetDefExpIR} node */ public A caseALetDefExpIR(ALetDefExpIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inALetDefExpIR(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } { List<AVarDeclIR> copy = new ArrayList<AVarDeclIR>(node.getLocalDefs()); for( AVarDeclIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this)); } mergeReturns(retVal,outALetDefExpIR(node)); return retVal; }
/** * Called by the {@link ALetDefExpIR} node from {@link ALetDefExpIR#apply(IAnalysis)}. * @param node the calling {@link ALetDefExpIR} node */ public A caseALetDefExpIR(ALetDefExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inALetDefExpIR(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } { List<AVarDeclIR> copy = new ArrayList<AVarDeclIR>(node.getLocalDefs()); for( AVarDeclIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this, question)); } mergeReturns(retVal,outALetDefExpIR(node, question)); return retVal; }
public void caseALetDefExpIR(ALetDefExpIR node) throws AnalysisException { SStmIR enclosingStm = transAssistant.getEnclosingStm(node, "let def expression"); SExpIR exp = node.getExp(); transAssistant.replaceNodeWith(node, exp); ABlockStmIR topBlock = new ABlockStmIR(); ABlockStmIR current = topBlock; for (AVarDeclIR local : node.getLocalDefs()) { ABlockStmIR tmp = new ABlockStmIR(); tmp.getLocalDefs().add(local.clone()); current.getStatements().add(tmp); current = tmp; } transAssistant.replaceNodeWith(enclosingStm, topBlock); topBlock.getStatements().add(enclosingStm); exp.apply(this); topBlock.apply(this); topBlock.setScoped(transAssistant.getInfo().getStmAssistant().isScoped(topBlock)); }