/** * Creates a deep clone of this {@link AMapletExpIR} 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 AMapletExpIR} node */ public AMapletExpIR clone(Map<INode,INode> oldToNewMap) { AMapletExpIR node = new AMapletExpIR( _sourceNode, _tag, _metaData, cloneNode(_type, oldToNewMap), cloneNode(_left, oldToNewMap), cloneNode(_right, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Returns a deep clone of this {@link AMapletExpIR} node. * @return a deep clone of this {@link AMapletExpIR} node */ public AMapletExpIR clone() { return new AMapletExpIR( _sourceNode, _tag, _metaData, cloneNode(_type), cloneNode(_left), cloneNode(_right) ); }
@Override public SExpIR caseAMapletExp(AMapletExp node, IRInfo question) throws AnalysisException { PType type = node.getType(); PExp left = node.getLeft(); PExp right = node.getRight(); STypeIR typeCg = type.apply(question.getTypeVisitor(), question); SExpIR leftCg = left.apply(question.getExpVisitor(), question); SExpIR rightCg = right.apply(question.getExpVisitor(), question); AMapletExpIR maplet = new AMapletExpIR(); maplet.setType(typeCg); maplet.setLeft(leftCg); maplet.setRight(rightCg); return maplet; }