/** * 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) ); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof AXorBoolBinaryExpIR) { return toString().equals(o.toString()); } return false; }
/** * Called by the {@link AXorBoolBinaryExpIR} node from {@link AXorBoolBinaryExpIR#apply(IIsaAnalysis)}. * @param node the calling {@link AXorBoolBinaryExpIR} node */ public void caseAXorBoolBinaryExpIR(AXorBoolBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); inAXorBoolBinaryExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outAXorBoolBinaryExpIR(node); }
@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; }
/** * Called by the {@link AXorBoolBinaryExpIR} node from {@link AXorBoolBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AXorBoolBinaryExpIR} node */ public void caseAXorBoolBinaryExpIR(AXorBoolBinaryExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAXorBoolBinaryExpIR(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this, question); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this, question); } outAXorBoolBinaryExpIR(node, question); }
/** * Called by the {@link AXorBoolBinaryExpIR} node from {@link AXorBoolBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AXorBoolBinaryExpIR} node */ public void caseAXorBoolBinaryExpIR(AXorBoolBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); inAXorBoolBinaryExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outAXorBoolBinaryExpIR(node); }
/** * 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; }
/** * Called by the {@link AXorBoolBinaryExpIR} node from {@link AXorBoolBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AXorBoolBinaryExpIR} node */ public A caseAXorBoolBinaryExpIR(AXorBoolBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAXorBoolBinaryExpIR(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { mergeReturns(retVal,node.getLeft().apply(this)); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this)); } mergeReturns(retVal,outAXorBoolBinaryExpIR(node)); return retVal; }
/** * Called by the {@link AXorBoolBinaryExpIR} node from {@link AXorBoolBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AXorBoolBinaryExpIR} node */ public A caseAXorBoolBinaryExpIR(AXorBoolBinaryExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAXorBoolBinaryExpIR(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { mergeReturns(retVal,node.getLeft().apply(this, question)); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this, question)); } mergeReturns(retVal,outAXorBoolBinaryExpIR(node, question)); return retVal; }