@Test public void testOutline4() throws Exception { String program = "int _GLF_outlined_1(int x, int y, int z) { if(_GLF_DEAD(false)) { } " + "return injectionSwitch.y * x + (x + y) + z; }" + "void main() { int a, b, c; y = _GLF_outlined_1(0, a, b + c); }"; TranslationUnit tu = ParseHelper.parse(program); List<OutlinedStatementReductionOpportunity> ops = OutlinedStatementReductionOpportunities .findOpportunities(MakeShaderJobFromFragmentShader.make(tu), new ReducerContext(false, ShadingLanguageVersion.ESSL_100, new RandomWrapper(0), new IdGenerator())); assertEquals(0, ops.size()); }
static List<OutlinedStatementReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(OutlinedStatementReductionOpportunities::findOpportunitiesForShader) .reduce(Collections.emptyList(), ListConcat::concatenate); }
OutlinedStatementReductionOpportunities extends StandardVisitor { static List<OutlinedStatementReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(OutlinedStatementReductionOpportunities::findOpportunitiesForShader) .reduce(Collections.emptyList(), ListConcat::concatenate); } }
OutlinedStatementReductionOpportunities extends StandardVisitor { static List<OutlinedStatementReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(OutlinedStatementReductionOpportunities::findOpportunitiesForShader) .reduce(Collections.emptyList(), ListConcat::concatenate); } private  OutlinedStatementReductionOpportunities(TranslationUnit tu); }
OutlinedStatementReductionOpportunities extends StandardVisitor { static List<OutlinedStatementReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(OutlinedStatementReductionOpportunities::findOpportunitiesForShader) .reduce(Collections.emptyList(), ListConcat::concatenate); } private  OutlinedStatementReductionOpportunities(TranslationUnit tu); @Override void visitExprStmt(ExprStmt exprStmt); }
OutlinedStatementReductionOpportunities extends StandardVisitor { static List<OutlinedStatementReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(OutlinedStatementReductionOpportunities::findOpportunitiesForShader) .reduce(Collections.emptyList(), ListConcat::concatenate); } private  OutlinedStatementReductionOpportunities(TranslationUnit tu); @Override void visitExprStmt(ExprStmt exprStmt);  }