@Test public void testMakeArrayParameterAccessInBounds1() throws Exception { final String shader = "#version 310 es\n" + "int foo(int A[3], int x) {\n" + " return A[x];\n" + "}\n" + "void main() {\n" + " int A[3];\n" + " foo(A, 7);\n" + "}\n"; final String expected = "#version 310 es\n" + "int foo(int A[3], int x) {\n" + " return A[" + Constants.GLF_MAKE_IN_BOUNDS_INT + "(x, 3)];\n" + "}\n" + "void main() {\n" + " int A[3];\n" + " foo(A, 7);\n" + "}\n"; final TranslationUnit tu = ParseHelper.parse(shader); MakeArrayAccessesInBounds.makeInBounds(tu); CompareAsts.assertEqualAsts(expected, tu); }
public static void makeInBounds(TranslationUnit tu) { new MakeArrayAccessesInBounds(new Typer(tu)).visit(tu); }
MakeArrayAccessesInBounds extends ScopeTrackingVisitor { public static void makeInBounds(TranslationUnit tu) { new MakeArrayAccessesInBounds(new Typer(tu)).visit(tu); } }
MakeArrayAccessesInBounds extends ScopeTrackingVisitor { public static void makeInBounds(TranslationUnit tu) { new MakeArrayAccessesInBounds(new Typer(tu)).visit(tu); } private  MakeArrayAccessesInBounds(Typer typer); }
MakeArrayAccessesInBounds extends ScopeTrackingVisitor { public static void makeInBounds(TranslationUnit tu) { new MakeArrayAccessesInBounds(new Typer(tu)).visit(tu); } private  MakeArrayAccessesInBounds(Typer typer); static void makeInBounds(TranslationUnit tu); static void makeInBounds(ShaderJob shaderJob); @Override void visitArrayIndexExpr(ArrayIndexExpr arrayIndexExpr); }
MakeArrayAccessesInBounds extends ScopeTrackingVisitor { public static void makeInBounds(TranslationUnit tu) { new MakeArrayAccessesInBounds(new Typer(tu)).visit(tu); } private  MakeArrayAccessesInBounds(Typer typer); static void makeInBounds(TranslationUnit tu); static void makeInBounds(ShaderJob shaderJob); @Override void visitArrayIndexExpr(ArrayIndexExpr arrayIndexExpr);  }