private PatternInfo extractPatternInfo(AVarDeclIR decl) { STypeIR type = decl.getType(); SPatternIR pattern = decl.getPattern(); SExpIR actualValue = decl.getExp(); return new PatternInfo(type, pattern, actualValue); }
@Override public void inAVarDeclIR(AVarDeclIR node) throws AnalysisException { STypeIR nodeType = node.getType(); SExpIR exp = node.getExp(); handleVarExp(nodeType, exp); if (exp == null) { return; } handleExp(exp, nodeType); }
/** * Called by the {@link AVarDeclIR} node from {@link AVarDeclIR#apply(IIsaAnalysis)}. * @param node the calling {@link AVarDeclIR} node */ public void caseAVarDeclIR(AVarDeclIR node) throws AnalysisException { _visitedNodes.add(node); inAVarDeclIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { node.getPattern().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outAVarDeclIR(node); }
/** * Called by the {@link AVarDeclIR} node from {@link AVarDeclIR#apply(IAnalysis)}. * @param node the calling {@link AVarDeclIR} node */ public void caseAVarDeclIR(AVarDeclIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAVarDeclIR(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { node.getPattern().apply(this, question); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this, question); } outAVarDeclIR(node, question); }
/** * Called by the {@link AVarDeclIR} node from {@link AVarDeclIR#apply(IAnalysis)}. * @param node the calling {@link AVarDeclIR} node */ public void caseAVarDeclIR(AVarDeclIR node) throws AnalysisException { _visitedNodes.add(node); inAVarDeclIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { node.getPattern().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outAVarDeclIR(node); }
@Override public void inAVarDeclIR(AVarDeclIR node) throws AnalysisException { SExpIR exp = node.getExp(); if (exp != null) { exp.apply(this); } STypeIR type = node.getType(); if (castNotNeeded(exp, type)) { return; } if (!(type instanceof AUnionTypeIR)) { correctTypes(exp, type); } }
/** * Called by the {@link AVarDeclIR} node from {@link AVarDeclIR#apply(IAnalysis)}. * @param node the calling {@link AVarDeclIR} node */ public A caseAVarDeclIR(AVarDeclIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAVarDeclIR(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { mergeReturns(retVal,node.getPattern().apply(this)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this)); } mergeReturns(retVal,outAVarDeclIR(node)); return retVal; }
/** * Called by the {@link AVarDeclIR} node from {@link AVarDeclIR#apply(IAnalysis)}. * @param node the calling {@link AVarDeclIR} node */ public A caseAVarDeclIR(AVarDeclIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAVarDeclIR(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { mergeReturns(retVal,node.getPattern().apply(this, question)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this, question)); } mergeReturns(retVal,outAVarDeclIR(node, question)); return retVal; }
private void initSuccessVar(PatternBlockData patternData, SExpIR initExp, ABlockStmIR patternBlock) { if (patternData.getSuccessVarDecl().getExp() instanceof AUndefinedExpIR) { patternData.getSuccessVarDecl().setExp(initExp); } else { AAssignToExpStmIR successVarAssignment = new AAssignToExpStmIR(); successVarAssignment.setTarget(patternData.getSuccessVar().clone()); successVarAssignment.setExp(initExp); patternBlock.getStatements().add(successVarAssignment); } }
ABlockStmIR patternHandlingBlock = consPatternHandlingInIterationBlock(nextElementDecl, tag, nextElementDecl.getExp());
if (getInfo().getExpAssistant().isUndefined(node.getExp()))