@Test public void testBasic() throws Exception { final String shader = "#version 300 es\nvoid main() { int A[5]; int x = 17; A[x] = 2; }"; final String expected = "#version 300 es\nvoid main() { int A[5]; int x = 17; A[" + Constants.GLF_MAKE_IN_BOUNDS_INT + "(x, 5)] = 2; }"; final TranslationUnit tu = ParseHelper.parse(shader); MakeArrayAccessesInBounds.makeInBounds(tu); assertEquals(PrettyPrinterVisitor.prettyPrintAsString(ParseHelper.parse(expected)), PrettyPrinterVisitor.prettyPrintAsString(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);  }