/** * Creates a deep clone of this {@link ALetDefExpIR} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link ALetDefExpIR} node */ public ALetDefExpIR clone(Map<INode,INode> oldToNewMap) { ALetDefExpIR node = new ALetDefExpIR( _sourceNode, _tag, _metaData, cloneNode(_type, oldToNewMap), cloneList(_localDefs, oldToNewMap), cloneNode(_exp, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Returns a deep clone of this {@link ALetDefExpIR} node. * @return a deep clone of this {@link ALetDefExpIR} node */ public ALetDefExpIR clone() { return new ALetDefExpIR( _sourceNode, _tag, _metaData, cloneNode(_type), cloneList(_localDefs), cloneNode(_exp) ); }
@Override public SExpIR caseALetDefExp(ALetDefExp node, IRInfo question) throws AnalysisException { PType type = node.getType(); PExp exp = node.getExpression(); ALetDefExpIR letDefExp = new ALetDefExpIR(); question.getDeclAssistant().setFinalLocalDefs(node.getLocalDefs(), letDefExp.getLocalDefs(), question); STypeIR typeCg = type.apply(question.getTypeVisitor(), question); letDefExp.setType(typeCg); SExpIR expCg = exp.apply(question.getExpVisitor(), question); letDefExp.setExp(expCg); return letDefExp; }