/// 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); }
/// 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); }
// 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()); } }
/// 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; }
/// 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; }
/// 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); }
// // 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); }
// // sets the cpu to generate code for // void lto_codegen_set_cpu(lto_code_gen_t cg, const char* cpu) { return cg->setCpu(cpu); }
// // 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); }
// // 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); }
bool lto_codegen_link_gathered_modules_and_dispose(lto_code_gen_t cg) { return cg->linkGatheredModulesAndDispose(sLastErrorString); }
// @LOCALMOD-BEGIN void lto_codegen_gather_module_for_link(lto_code_gen_t cg, lto_module_t mod) { cg->gatherModuleForLinking(mod); }
/// 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); }
/// 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); }
// // 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); }
// // 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); }
// // 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); }
// // 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); }
// // 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); }
// // 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); }
/// 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); }
// // 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); }
void lto_codegen_add_dso_symbol(lto_code_gen_t cg, const char *symbol) { cg->addDSOSymbol(symbol); }