public SExpIR consAndExp(SExpIR left, SExpIR right) { AAndBoolBinaryExpIR andExp = new AAndBoolBinaryExpIR(); andExp.setType(new ABoolBasicTypeIR()); andExp.setLeft(left); andExp.setRight(right); return andExp; }
/** * Called by the {@link AAndBoolBinaryExpIR} node from {@link AAndBoolBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AAndBoolBinaryExpIR} node */ public void caseAAndBoolBinaryExpIR(AAndBoolBinaryExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAAndBoolBinaryExpIR(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); } outAAndBoolBinaryExpIR(node, question); }
/** * Returns a deep clone of this {@link AAndBoolBinaryExpIR} node. * @return a deep clone of this {@link AAndBoolBinaryExpIR} node */ public AAndBoolBinaryExpIR clone() { return new AAndBoolBinaryExpIR( _sourceNode, _tag, _metaData, cloneNode(_type), cloneNode(_left), cloneNode(_right) ); }
AAndBoolBinaryExpIR newpred = new AAndBoolBinaryExpIR(); newpred.setLeft(node.getPerSyncs().get(foundplace).getPred().clone()); newpred.setRight(guard); node.getPerSyncs().get(foundplace).setPred(newpred); AAndBoolBinaryExpIR newpred = new AAndBoolBinaryExpIR(); newpred.setLeft(node.getPerSyncs().get(foundplace).getPred().clone()); newpred.setRight(equalzero); node.getPerSyncs().get(foundplace).setPred(newpred);
protected AIfStmIR consAndExpCheck(AAndBoolBinaryExpIR node, String andResultVarName) { SExpIR left = node.getLeft().clone(); SExpIR right = node.getRight().clone(); AIfStmIR leftCheck = new AIfStmIR(); leftCheck.setIfExp(left); AIfStmIR rightCheck = new AIfStmIR(); rightCheck.setIfExp(right); AAssignToExpStmIR assignAndVar = new AAssignToExpStmIR(); assignAndVar.setTarget(transAssistant.consBoolCheck(andResultVarName, false)); assignAndVar.setExp(transAssistant.getInfo().getAssistantManager().getExpAssistant().consBoolLiteral(true)); rightCheck.setThenStm(assignAndVar); leftCheck.setThenStm(rightCheck); return leftCheck; }
@Override public SExpIR caseAAndBooleanBinaryExp(AAndBooleanBinaryExp node, IRInfo question) throws AnalysisException { return question.getExpAssistant().handleBinaryExp(node, new AAndBoolBinaryExpIR(), question); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof AAndBoolBinaryExpIR) { return toString().equals(o.toString()); } return false; }
/** * Called by the {@link AAndBoolBinaryExpIR} node from {@link AAndBoolBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AAndBoolBinaryExpIR} node */ public void caseAAndBoolBinaryExpIR(AAndBoolBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); inAAndBoolBinaryExpIR(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); } outAAndBoolBinaryExpIR(node); }
public AAndBoolBinaryExpIR extendAndExp(ARecordDeclIR record, AFieldDeclIR field, SExpIR previous, String paramName) throws AnalysisException { // By recursively calling this method an "and chain" of field // comparisons can be constructed: fieldComp1 && fieldComp2 && fieldComp3 .... AAndBoolBinaryExpIR nextAnd = new AAndBoolBinaryExpIR(); nextAnd.setType(new ABoolBasicTypeIR()); nextAnd.setLeft(previous); nextAnd.setRight(consFieldComparison(record, field, paramName)); return nextAnd; }
/** * Creates a deep clone of this {@link AAndBoolBinaryExpIR} 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 AAndBoolBinaryExpIR} node */ public AAndBoolBinaryExpIR clone(Map<INode,INode> oldToNewMap) { AAndBoolBinaryExpIR node = new AAndBoolBinaryExpIR( _sourceNode, _tag, _metaData, cloneNode(_type, oldToNewMap), cloneNode(_left, oldToNewMap), cloneNode(_right, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link AAndBoolBinaryExpIR} node from {@link AAndBoolBinaryExpIR#apply(IIsaAnalysis)}. * @param node the calling {@link AAndBoolBinaryExpIR} node */ public void caseAAndBoolBinaryExpIR(AAndBoolBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); inAAndBoolBinaryExpIR(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); } outAAndBoolBinaryExpIR(node); }
AAndBoolBinaryExpIR andExpTopCg = new AAndBoolBinaryExpIR(); andExpTopCg.setType(new ABoolBasicTypeIR()); andExpTopCg.setLeft(exps.get(0).apply(question.getExpVisitor(), question)); AAndBoolBinaryExpIR nextAndExpCg = new AAndBoolBinaryExpIR(); nextAndExpCg.setType(new ABoolBasicTypeIR()); nextAndExpCg.setLeft(nextExpCg); previousAndExpCg.setRight(nextAndExpCg); previousAndExpCg = nextAndExpCg; previousAndExpCg.setRight(exps.get(exps.size() - 1).apply(question.getExpVisitor(), question));
/** * Called by the {@link AAndBoolBinaryExpIR} node from {@link AAndBoolBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AAndBoolBinaryExpIR} node */ public A caseAAndBoolBinaryExpIR(AAndBoolBinaryExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAAndBoolBinaryExpIR(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,outAAndBoolBinaryExpIR(node, question)); return retVal; }
/** * Called by the {@link AAndBoolBinaryExpIR} node from {@link AAndBoolBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AAndBoolBinaryExpIR} node */ public A caseAAndBoolBinaryExpIR(AAndBoolBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAAndBoolBinaryExpIR(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,outAAndBoolBinaryExpIR(node)); return retVal; }