@Test public void testNoInliningWithNameShadowing1() throws Exception { final String program = "void main() { int x; { int x = x; x; } }"; final TranslationUnit tu = ParseHelper.parse(program); List<SimplifyExprReductionOpportunity> ops = InlineInitializerReductionOpportunities .findOpportunities(MakeShaderJobFromFragmentShader.make(tu), new ReducerContext(true, ShadingLanguageVersion.ESSL_100, new RandomWrapper(0), new IdGenerator())); assertEquals(0, ops.size()); }
static List<SimplifyExprReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(item -> findOpportunitiesForShader(item, context)) .reduce(Arrays.asList(), ListConcat::concatenate); }
InlineInitializerReductionOpportunities extends ReductionOpportunitiesBase<SimplifyExprReductionOpportunity> { static List<SimplifyExprReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(item -> findOpportunitiesForShader(item, context)) .reduce(Arrays.asList(), ListConcat::concatenate); } }
InlineInitializerReductionOpportunities extends ReductionOpportunitiesBase<SimplifyExprReductionOpportunity> { static List<SimplifyExprReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(item -> findOpportunitiesForShader(item, context)) .reduce(Arrays.asList(), ListConcat::concatenate); } private  InlineInitializerReductionOpportunities(
        TranslationUnit tu,
        ReducerContext context); }
InlineInitializerReductionOpportunities extends ReductionOpportunitiesBase<SimplifyExprReductionOpportunity> { static List<SimplifyExprReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(item -> findOpportunitiesForShader(item, context)) .reduce(Arrays.asList(), ListConcat::concatenate); } private  InlineInitializerReductionOpportunities(
        TranslationUnit tu,
        ReducerContext context); @Override void visitVariableIdentifierExpr(VariableIdentifierExpr variableIdentifierExpr); }
InlineInitializerReductionOpportunities extends ReductionOpportunitiesBase<SimplifyExprReductionOpportunity> { static List<SimplifyExprReductionOpportunity> findOpportunities( ShaderJob shaderJob, ReducerContext context) { return shaderJob.getShaders() .stream() .map(item -> findOpportunitiesForShader(item, context)) .reduce(Arrays.asList(), ListConcat::concatenate); } private  InlineInitializerReductionOpportunities(
        TranslationUnit tu,
        ReducerContext context); @Override void visitVariableIdentifierExpr(VariableIdentifierExpr variableIdentifierExpr);  }