Пример #1
0
/// lto_codegen_write_merged_modules - Writes a new file at the specified path
/// that contains the merged contents of all modules added so far. Returns true
/// on error (check lto_get_error_message() for details).
bool lto_codegen_write_merged_modules(lto_code_gen_t cg, const char *path) {
  if (!parsedOptions) {
    cg->parseCodeGenDebugOptions();
    parsedOptions = true;
  }
  return !cg->writeMergedModules(path, sLastErrorString);
}
Пример #2
0
/// lto_codegen_compile_to_file - Generates code for all added modules into one
/// native object file. The name of the file is written to name. Returns true on
/// error.
bool lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) {
  if (!parsedOptions) {
    cg->parseCodeGenDebugOptions();
    parsedOptions = true;
  }
  return !cg->compile_to_file(name, DisableOpt, DisableInline, DisableGVNLoadPRE,
                              sLastErrorString);
}
Пример #3
0
// Convert the subtarget features into a string to pass to LTOCodeGenerator.
static void lto_add_attrs(lto_code_gen_t cg) {
  if (MAttrs.size()) {
    std::string attrs;
    for (unsigned i = 0; i < MAttrs.size(); ++i) {
      if (i > 0)
        attrs.append(",");
      attrs.append(MAttrs[i]);
    }

    cg->setAttr(attrs.c_str());
  }
}
Пример #4
0
/// lto_codegen_set_pic_model - Sets what code model to generated. Returns true
/// on error (check lto_get_error_message() for details).
bool lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model model) {
  cg->setCodePICModel(model);
  return false;
}
Пример #5
0
/// lto_codegen_set_debug_model - Sets what if any format of debug info should
/// be generated. Returns true on error (check lto_get_error_message() for
/// details).
bool lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model debug) {
  cg->setDebugInfo(debug);
  return false;
}
Пример #6
0
/// lto_codegen_set_attr - Sets the attr to generate code for.
void lto_codegen_set_attr(lto_code_gen_t cg, const char *attr) {
  return cg->setAttr(attr);
}
Пример #7
0
//
// writes a new file at the specified path that contains the
// merged contents of all modules added so far.
// returns true on error (check lto_get_error_message() for details)
//
bool lto_codegen_write_merged_modules(lto_code_gen_t cg, const char* path)
{
  return cg->writeMergedModules(path, sLastErrorString);
}
Пример #8
0
//
// sets the cpu to generate code for
//
void lto_codegen_set_cpu(lto_code_gen_t cg, const char* cpu)
{
  return cg->setCpu(cpu);
}
Пример #9
0
//
// sets what if any format of debug info should be generated
// returns true on error (check lto_get_error_message() for details)
//
bool lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model debug)
{
    return cg->setDebugInfo(debug, sLastErrorString);
}
Пример #10
0
//
// Set the module format for the merged module
//
void lto_codegen_set_merged_module_output_format(lto_code_gen_t cg,
                                                 lto_output_format format)
{
  cg->setMergedModuleOutputFormat(format);
}
Пример #11
0
bool lto_codegen_link_gathered_modules_and_dispose(lto_code_gen_t cg) {
  return cg->linkGatheredModulesAndDispose(sLastErrorString);
}
Пример #12
0
// @LOCALMOD-BEGIN
void lto_codegen_gather_module_for_link(lto_code_gen_t cg, lto_module_t mod) {
  cg->gatherModuleForLinking(mod);
}
Пример #13
0
/// lto_codegen_set_internalize_strategy - Sets the strategy to use during
/// internalize.
void lto_codegen_set_internalize_strategy(lto_code_gen_t cg,
        lto_internalize_strategy strategy) {
    cg->setInternalizeStrategy(strategy);
}
Пример #14
0
/// Set a diagnostic handler.
void lto_codegen_set_diagnostic_handler(lto_code_gen_t cg,
                                        lto_diagnostic_handler_t diag_handler,
                                        void *ctxt) {
    cg->setDiagnosticHandler(diag_handler, ctxt);
}
Пример #15
0
//
// Set the module soname (for shared library bitcode)
//
void lto_codegen_set_merged_module_soname(lto_code_gen_t cg,
                                          const char* soname)
{
  cg->setMergedModuleSOName(soname);
}
Пример #16
0
//
// add an object module to the set of modules for which code will be generated
// returns true on error (check lto_get_error_message() for details)
//
bool lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod)
{
    return cg->addModule(mod, sLastErrorString);
}
Пример #17
0
//
// Add a library dependency to the linked bitcode module.
//
void lto_codegen_add_merged_module_library_dep(lto_code_gen_t cg,
                                               const char* soname)
{
  cg->addLibraryDep(soname);
}
Пример #18
0
//
// sets what code model to generated
// returns true on error (check lto_get_error_message() for details)
//
bool lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model model)
{
  return cg->setCodePICModel(model, sLastErrorString);
}
Пример #19
0
//
// Apply symbol wrapping in the linked bitcode module.
//
void lto_codegen_wrap_symbol_in_merged_module(lto_code_gen_t cg,
                                              const char* sym) {
  cg->wrapSymbol(sym);
}
Пример #20
0
//
// adds to a list of all global symbols that must exist in the final
// generated code.  If a function is not listed there, it might be
// inlined into every usage and optimized away.
//
void lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, const char* symbol)
{
  cg->addMustPreserveSymbol(symbol);
}
Пример #21
0
/// lto_codegen_compile_to_file - Generates code for all added modules into one
/// native object file. The name of the file is written to name. Returns true on
/// error.
bool lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) {
  return cg->compile_to_file(name, sLastErrorString);
}
Пример #22
0
//
// Used to pass extra options to the code generator
//
extern void
lto_codegen_debug_options(lto_code_gen_t cg, const char * opt)
{
  cg->setCodeGenDebugOptions(opt);
}
Пример #23
0
void lto_codegen_add_dso_symbol(lto_code_gen_t cg, const char *symbol) {
  cg->addDSOSymbol(symbol);
}