@Test public void testNoUnwrapWithDeclClash2() throws Exception { final String program = "void main() { { int x; } float x; }"; final TranslationUnit tu = ParseHelper.parse(program); List<UnwrapReductionOpportunity> ops = UnwrapReductionOpportunities .findOpportunities(MakeShaderJobFromFragmentShader.make(tu), new ReducerContext(false, ShadingLanguageVersion.GLSL_440, new SameValueRandom(false, 0), new IdGenerator())); assertEquals(0, ops.size()); }
static List<UnwrapReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(item -> findOpportunitiesForShader(item, context)) .reduce(Arrays.asList(), ListConcat::concatenate); }
UnwrapReductionOpportunities extends ReductionOpportunitiesBase<UnwrapReductionOpportunity> { static List<UnwrapReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(item -> findOpportunitiesForShader(item, context)) .reduce(Arrays.asList(), ListConcat::concatenate); } }
UnwrapReductionOpportunities extends ReductionOpportunitiesBase<UnwrapReductionOpportunity> { static List<UnwrapReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(item -> findOpportunitiesForShader(item, context)) .reduce(Arrays.asList(), ListConcat::concatenate); } private  UnwrapReductionOpportunities(TranslationUnit tu, ReducerContext context); }
UnwrapReductionOpportunities extends ReductionOpportunitiesBase<UnwrapReductionOpportunity> { static List<UnwrapReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(item -> findOpportunitiesForShader(item, context)) .reduce(Arrays.asList(), ListConcat::concatenate); } private  UnwrapReductionOpportunities(TranslationUnit tu, ReducerContext context); @Override void visitIfStmt(IfStmt ifStmt); @Override void visitForStmt(ForStmt forStmt); @Override void visitDoStmt(DoStmt doStmt); }
UnwrapReductionOpportunities extends ReductionOpportunitiesBase<UnwrapReductionOpportunity> { static List<UnwrapReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(item -> findOpportunitiesForShader(item, context)) .reduce(Arrays.asList(), ListConcat::concatenate); } private  UnwrapReductionOpportunities(TranslationUnit tu, ReducerContext context); @Override void visitIfStmt(IfStmt ifStmt); @Override void visitForStmt(ForStmt forStmt); @Override void visitDoStmt(DoStmt doStmt);  }