}
File jimpleOutput = new File("target/jimple");
jimpleOutput.mkdirs();
GimpleCompiler compiler = new GimpleCompiler();
compiler.setJimpleOutputDirectory(jimpleDirectory);
compiler.setOutputDirectory(outputDirectory);
compiler.setPackageName(packageName);
compiler.setClassName(className);
compiler.addSootClassPaths(classPaths);
compiler.setVerbose(verbose);
compiler.getMethodTable().addMathLibrary();
compiler.getMethodTable().addCallTranslator(new RallocTranslator());
compiler.getMethodTable().addReferenceClass(Class.forName("org.renjin.appl.Appl"));
Class distributionsClass = Class.forName("org.renjin.stats.internals.Distributions");
compiler.getMethodTable().addReferenceClass(distributionsClass);
compiler.getMethodTable().addMethod("Rf_dbeta",distributionsClass,"dbeta");
compiler.getMethodTable().addMethod("Rf_pbeta",distributionsClass,"pbeta");
compiler.getMethodTable().addReferenceClass(RenjinCApi.class);
compiler.getMethodTable().addReferenceClass(Sort.class);
compiler.provideType("SEXP_T", new SimpleRecordType(new RealJimpleType(GnuSEXP.class)));
compiler.compile(units);
}
}