예제 #1
0
파일: genlib.c 프로젝트: abingham/ponyc
bool genlib(compile_t* c, ast_t* program)
{
  if(!reachable_actors(c, program) ||
    !generate_actors(c, program) ||
    !genheader(c)
    )
    return false;

  const char* file_o = genobj(c);

  if(file_o == NULL)
    return false;

  if(c->opt->limit < PASS_ALL)
    return true;

  if(!link_lib(c, file_o))
    return false;

#ifdef PLATFORM_IS_WINDOWS
  _unlink(file_o);
#else
  unlink(file_o);
#endif

  return true;
}
예제 #2
0
파일: genlib.c 프로젝트: Theodus/ponyc
bool genlib(compile_t* c, ast_t* program)
{
  if(!reachable_actors(c, program) ||
    !gentypes(c) ||
    !genheader(c)
    )
    return false;

  plugin_visit_compile(c, c->opt);

  if(!genopt(c, true))
    return false;

  if(c->opt->runtimebc)
  {
    if(!codegen_merge_runtime_bitcode(c))
      return false;

    // Rerun the optimiser without the Pony-specific optimisation passes.
    // Inlining runtime functions can screw up these passes so we can't
    // run the optimiser only once after merging.
    if(!genopt(c, false))
      return false;
  }

  const char* file_o = genobj(c);

  if(file_o == NULL)
    return false;

  if(c->opt->limit < PASS_ALL)
    return true;

  if(!link_lib(c, file_o))
    return false;

#ifdef PLATFORM_IS_WINDOWS
  _unlink(file_o);
#else
  unlink(file_o);
#endif

  return true;
}