public static ProcessResult executeLLVMBinary(File bitcodeFile,Object[] args){
  try {
    File objectFile=File.createTempFile(absolutePathToFileName(bitcodeFile),".o");
    objectFile.deleteOnExit();
    File executable=File.createTempFile(absolutePathToFileName(bitcodeFile),".out");
    executable.deleteOnExit();
    LLC.compileBitCodeToObjectFile(bitcodeFile,objectFile);
    GCC.compileObjectToMachineCode(objectFile,executable);
    StringBuilder commandBuilder=new StringBuilder(executable.getAbsolutePath());
    if (args != null) {
      for (int i=0; i < args.length; i++) {
        commandBuilder.append(" ");
        commandBuilder.append(args[i]);
      }
    }
    return ProcessUtil.executeNativeCommand(commandBuilder.toString());
  }
 catch (  Exception e) {
    throw new AssertionError(e);
  }
}

public static ProcessResult executeLLVMBinary ( File bitcodeFile , Object [ ] args ) { try { File objectFile = File . createTempFile ( absolutePathToFileName ( bitcodeFile ) , ".o" ) ; objectFile . deleteOnExit ( ) ; File executable = File . createTempFile ( absolutePathToFileName ( bitcodeFile ) , ".out" ) ; executable . deleteOnExit ( ) ; LLC . compileBitCodeToObjectFile ( bitcodeFile , objectFile ) ; GCC . compileObjectToMachineCode ( objectFile , executable ) ; StringBuilder commandBuilder = new StringBuilder ( executable . getAbsolutePath ( ) ) ; if ( args != null ) { for ( int i = 0 ; i < args . length ; i ++ ) { commandBuilder . append ( " " ) ; commandBuilder . append ( args [ i ] ) ; } } return ProcessUtil . executeNativeCommand ( commandBuilder . toString ( ) ) ; } catch ( Exception e ) { throw new AssertionError ( e ) ; } }
executes the bitcode file that is beforehand compiled by the native llvm compiler .
