示例#1
0
文件: lto.cpp 项目: 7heaven/softart
/// 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.cpp 项目: 7heaven/softart
/// 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
文件: lto.cpp 项目: compnerd/llvm
// 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.cpp 项目: 7heaven/softart
/// 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.cpp 项目: 7heaven/softart
/// 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.cpp 项目: compnerd/llvm
/// 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
文件: lto.cpp 项目: marmalade/llvm
void lto_codegen_add_dso_symbol(lto_code_gen_t cg, const char *symbol) {
  cg->addDSOSymbol(symbol);
}