@Test public void testReturnsRemovedGlsl100For() throws Exception { final String program = "void foo() {" + " for(int i = 0; i < 10; i++) " + " if (i > 5) {" + " return;" + " }" + "}"; final String expected = "void foo() {" + " bool foo_has_returned = false;" + " for(int i = 0; i < 10; i++) {" + " if (foo_has_returned) {" + " break;" + " }" + " if (i > 5) {" + " foo_has_returned = true;" + " }" + " }" + "}"; final TranslationUnit tu = ParseHelper.parse(program); final FunctionDefinition fd = findFunctionDefinition(tu, "foo"); ReturnRemover.removeReturns(fd, ShadingLanguageVersion.ESSL_100); CompareAstsDuplicate.assertEqualAsts(expected, tu); }
public static void removeReturns(FunctionDefinition fd, ShadingLanguageVersion shadingLanguageVersion) throws CannotRemoveReturnsException { new ReturnRemover(fd, shadingLanguageVersion).doRemoveReturns(); }
ReturnRemover { public static void removeReturns(FunctionDefinition fd, ShadingLanguageVersion shadingLanguageVersion) throws CannotRemoveReturnsException { new ReturnRemover(fd, shadingLanguageVersion).doRemoveReturns(); } }
ReturnRemover { public static void removeReturns(FunctionDefinition fd, ShadingLanguageVersion shadingLanguageVersion) throws CannotRemoveReturnsException { new ReturnRemover(fd, shadingLanguageVersion).doRemoveReturns(); } private  ReturnRemover(FunctionDefinition fd, ShadingLanguageVersion shadingLanguageVersion); }
ReturnRemover { public static void removeReturns(FunctionDefinition fd, ShadingLanguageVersion shadingLanguageVersion) throws CannotRemoveReturnsException { new ReturnRemover(fd, shadingLanguageVersion).doRemoveReturns(); } private  ReturnRemover(FunctionDefinition fd, ShadingLanguageVersion shadingLanguageVersion); static void removeReturns(FunctionDefinition fd, ShadingLanguageVersion
      shadingLanguageVersion); }
ReturnRemover { public static void removeReturns(FunctionDefinition fd, ShadingLanguageVersion shadingLanguageVersion) throws CannotRemoveReturnsException { new ReturnRemover(fd, shadingLanguageVersion).doRemoveReturns(); } private  ReturnRemover(FunctionDefinition fd, ShadingLanguageVersion shadingLanguageVersion); static void removeReturns(FunctionDefinition fd, ShadingLanguageVersion
      shadingLanguageVersion);  }