/** * Creates a deep clone of this {@link AXorBoolBinaryExpIR} 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 AXorBoolBinaryExpIR} node */ public AXorBoolBinaryExpIR clone(Map<INode,INode> oldToNewMap) { AXorBoolBinaryExpIR node = new AXorBoolBinaryExpIR( _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 AXorBoolBinaryExpIR} node. * @return a deep clone of this {@link AXorBoolBinaryExpIR} node */ public AXorBoolBinaryExpIR clone() { return new AXorBoolBinaryExpIR( _sourceNode, _tag, _metaData, cloneNode(_type), cloneNode(_left), cloneNode(_right) ); }
@Override public SExpIR caseAEquivalentBooleanBinaryExp( AEquivalentBooleanBinaryExp node, IRInfo question) throws AnalysisException { // A <=> B is constructed as !(A ^ B) STypeIR typeCg = node.getType().apply(question.getTypeVisitor(), question); SExpIR leftExpCg = node.getLeft().apply(question.getExpVisitor(), question); SExpIR rightExpCg = node.getRight().apply(question.getExpVisitor(), question); AXorBoolBinaryExpIR xorExp = new AXorBoolBinaryExpIR(); xorExp.setType(typeCg); xorExp.setLeft(leftExpCg); xorExp.setRight(rightExpCg); ANotUnaryExpIR notExp = new ANotUnaryExpIR(); notExp.setType(typeCg.clone()); notExp.setExp(question.getExpAssistant().isolateExpression(xorExp)); return notExp; }