Lines Matching refs:cg
159 static void lto_add_attrs(lto_code_gen_t cg) { in DEFINE_SIMPLE_CONVERSION_FUNCTIONS()
160 LTOCodeGenerator *CG = unwrap(cg); in DEFINE_SIMPLE_CONVERSION_FUNCTIONS()
300 lto_code_gen_t cg) { in lto_module_create_in_codegen_context() argument
305 unwrap(cg)->getContext(), mem, length, Options, StringRef(path)); in lto_module_create_in_codegen_context()
357 void lto_codegen_set_diagnostic_handler(lto_code_gen_t cg, in lto_codegen_set_diagnostic_handler() argument
360 unwrap(cg)->setDiagnosticHandler(diag_handler, ctxt); in lto_codegen_set_diagnostic_handler()
383 void lto_codegen_dispose(lto_code_gen_t cg) { delete unwrap(cg); } in lto_codegen_dispose() argument
385 bool lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod) { in lto_codegen_add_module() argument
386 return !unwrap(cg)->addModule(unwrap(mod)); in lto_codegen_add_module()
389 void lto_codegen_set_module(lto_code_gen_t cg, lto_module_t mod) { in lto_codegen_set_module() argument
390 unwrap(cg)->setModule(std::unique_ptr<LTOModule>(unwrap(mod))); in lto_codegen_set_module()
393 bool lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model debug) { in lto_codegen_set_debug_model() argument
394 unwrap(cg)->setDebugInfo(debug); in lto_codegen_set_debug_model()
398 bool lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model model) { in lto_codegen_set_pic_model() argument
401 unwrap(cg)->setCodePICModel(Reloc::Static); in lto_codegen_set_pic_model()
404 unwrap(cg)->setCodePICModel(Reloc::PIC_); in lto_codegen_set_pic_model()
407 unwrap(cg)->setCodePICModel(Reloc::DynamicNoPIC); in lto_codegen_set_pic_model()
410 unwrap(cg)->setCodePICModel(None); in lto_codegen_set_pic_model()
417 void lto_codegen_set_cpu(lto_code_gen_t cg, const char *cpu) { in lto_codegen_set_cpu() argument
418 return unwrap(cg)->setCpu(cpu); in lto_codegen_set_cpu()
421 void lto_codegen_set_assembler_path(lto_code_gen_t cg, const char *path) { in lto_codegen_set_assembler_path() argument
425 void lto_codegen_set_assembler_args(lto_code_gen_t cg, const char **args, in lto_codegen_set_assembler_args() argument
430 void lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, in lto_codegen_add_must_preserve_symbol() argument
432 unwrap(cg)->addMustPreserveSymbol(symbol); in lto_codegen_add_must_preserve_symbol()
435 static void maybeParseOptions(lto_code_gen_t cg) { in maybeParseOptions() argument
437 unwrap(cg)->parseCodeGenDebugOptions(); in maybeParseOptions()
438 lto_add_attrs(cg); in maybeParseOptions()
443 bool lto_codegen_write_merged_modules(lto_code_gen_t cg, const char *path) { in lto_codegen_write_merged_modules() argument
444 maybeParseOptions(cg); in lto_codegen_write_merged_modules()
445 return !unwrap(cg)->writeMergedModules(path); in lto_codegen_write_merged_modules()
448 const void *lto_codegen_compile(lto_code_gen_t cg, size_t *length) { in lto_codegen_compile() argument
449 maybeParseOptions(cg); in lto_codegen_compile()
450 LibLTOCodeGenerator *CG = unwrap(cg); in lto_codegen_compile()
460 bool lto_codegen_optimize(lto_code_gen_t cg) { in lto_codegen_optimize() argument
461 maybeParseOptions(cg); in lto_codegen_optimize()
462 return !unwrap(cg)->optimize(DisableVerify, DisableInline, DisableGVNLoadPRE, in lto_codegen_optimize()
466 const void *lto_codegen_compile_optimized(lto_code_gen_t cg, size_t *length) { in lto_codegen_compile_optimized() argument
467 maybeParseOptions(cg); in lto_codegen_compile_optimized()
468 LibLTOCodeGenerator *CG = unwrap(cg); in lto_codegen_compile_optimized()
476 bool lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) { in lto_codegen_compile_to_file() argument
477 maybeParseOptions(cg); in lto_codegen_compile_to_file()
478 return !unwrap(cg)->compile_to_file( in lto_codegen_compile_to_file()
483 void lto_codegen_debug_options(lto_code_gen_t cg, const char *opt) { in lto_codegen_debug_options() argument
489 unwrap(cg)->setCodeGenDebugOptions(Options); in lto_codegen_debug_options()
492 void lto_codegen_debug_options_array(lto_code_gen_t cg, in lto_codegen_debug_options_array() argument
497 unwrap(cg)->setCodeGenDebugOptions(makeArrayRef(Options)); in lto_codegen_debug_options_array()
502 void lto_codegen_set_should_internalize(lto_code_gen_t cg, in lto_codegen_set_should_internalize() argument
504 unwrap(cg)->setShouldInternalize(ShouldInternalize); in lto_codegen_set_should_internalize()
507 void lto_codegen_set_should_embed_uselists(lto_code_gen_t cg, in lto_codegen_set_should_embed_uselists() argument
509 unwrap(cg)->setShouldEmbedUselists(ShouldEmbedUselists); in lto_codegen_set_should_embed_uselists()
543 void thinlto_codegen_dispose(thinlto_code_gen_t cg) { delete unwrap(cg); } in thinlto_codegen_dispose() argument
545 void thinlto_codegen_add_module(thinlto_code_gen_t cg, const char *Identifier, in thinlto_codegen_add_module() argument
547 unwrap(cg)->addModule(Identifier, StringRef(Data, Length)); in thinlto_codegen_add_module()
550 void thinlto_codegen_process(thinlto_code_gen_t cg) { unwrap(cg)->run(); } in thinlto_codegen_process() argument
552 unsigned int thinlto_module_get_num_objects(thinlto_code_gen_t cg) { in thinlto_module_get_num_objects() argument
553 return unwrap(cg)->getProducedBinaries().size(); in thinlto_module_get_num_objects()
555 LTOObjectBuffer thinlto_module_get_object(thinlto_code_gen_t cg, in thinlto_module_get_object() argument
557 assert(index < unwrap(cg)->getProducedBinaries().size() && "Index overflow"); in thinlto_module_get_object()
558 auto &MemBuffer = unwrap(cg)->getProducedBinaries()[index]; in thinlto_module_get_object()
563 unsigned int thinlto_module_get_num_object_files(thinlto_code_gen_t cg) { in thinlto_module_get_num_object_files() argument
564 return unwrap(cg)->getProducedBinaryFiles().size(); in thinlto_module_get_num_object_files()
566 const char *thinlto_module_get_object_file(thinlto_code_gen_t cg, in thinlto_module_get_object_file() argument
568 assert(index < unwrap(cg)->getProducedBinaryFiles().size() && in thinlto_module_get_object_file()
570 return unwrap(cg)->getProducedBinaryFiles()[index].c_str(); in thinlto_module_get_object_file()
573 void thinlto_codegen_disable_codegen(thinlto_code_gen_t cg, in thinlto_codegen_disable_codegen() argument
575 unwrap(cg)->disableCodeGen(disable); in thinlto_codegen_disable_codegen()
578 void thinlto_codegen_set_codegen_only(thinlto_code_gen_t cg, in thinlto_codegen_set_codegen_only() argument
580 unwrap(cg)->setCodeGenOnly(CodeGenOnly); in thinlto_codegen_set_codegen_only()
597 void thinlto_codegen_add_must_preserve_symbol(thinlto_code_gen_t cg, in thinlto_codegen_add_must_preserve_symbol() argument
599 unwrap(cg)->preserveSymbol(StringRef(Name, Length)); in thinlto_codegen_add_must_preserve_symbol()
602 void thinlto_codegen_add_cross_referenced_symbol(thinlto_code_gen_t cg, in thinlto_codegen_add_cross_referenced_symbol() argument
604 unwrap(cg)->crossReferenceSymbol(StringRef(Name, Length)); in thinlto_codegen_add_cross_referenced_symbol()
607 void thinlto_codegen_set_cpu(thinlto_code_gen_t cg, const char *cpu) { in thinlto_codegen_set_cpu() argument
608 return unwrap(cg)->setCpu(cpu); in thinlto_codegen_set_cpu()
611 void thinlto_codegen_set_cache_dir(thinlto_code_gen_t cg, in thinlto_codegen_set_cache_dir() argument
613 return unwrap(cg)->setCacheDir(cache_dir); in thinlto_codegen_set_cache_dir()
616 void thinlto_codegen_set_cache_pruning_interval(thinlto_code_gen_t cg, in thinlto_codegen_set_cache_pruning_interval() argument
618 return unwrap(cg)->setCachePruningInterval(interval); in thinlto_codegen_set_cache_pruning_interval()
621 void thinlto_codegen_set_cache_entry_expiration(thinlto_code_gen_t cg, in thinlto_codegen_set_cache_entry_expiration() argument
623 return unwrap(cg)->setCacheEntryExpiration(expiration); in thinlto_codegen_set_cache_entry_expiration()
627 thinlto_code_gen_t cg, unsigned Percentage) { in thinlto_codegen_set_final_cache_size_relative_to_available_space() argument
628 return unwrap(cg)->setMaxCacheSizeRelativeToAvailableSpace(Percentage); in thinlto_codegen_set_final_cache_size_relative_to_available_space()
632 thinlto_code_gen_t cg, unsigned MaxSizeBytes) { in thinlto_codegen_set_cache_size_bytes() argument
633 return unwrap(cg)->setCacheMaxSizeBytes(MaxSizeBytes); in thinlto_codegen_set_cache_size_bytes()
637 thinlto_code_gen_t cg, unsigned MaxSizeMegabytes) { in thinlto_codegen_set_cache_size_megabytes() argument
640 return unwrap(cg)->setCacheMaxSizeBytes(MaxSizeBytes); in thinlto_codegen_set_cache_size_megabytes()
644 thinlto_code_gen_t cg, unsigned MaxSizeFiles) { in thinlto_codegen_set_cache_size_files() argument
645 return unwrap(cg)->setCacheMaxSizeFiles(MaxSizeFiles); in thinlto_codegen_set_cache_size_files()
648 void thinlto_codegen_set_savetemps_dir(thinlto_code_gen_t cg, in thinlto_codegen_set_savetemps_dir() argument
650 return unwrap(cg)->setSaveTempsDir(save_temps_dir); in thinlto_codegen_set_savetemps_dir()
653 void thinlto_set_generated_objects_dir(thinlto_code_gen_t cg, in thinlto_set_generated_objects_dir() argument
655 unwrap(cg)->setGeneratedObjectsDirectory(save_temps_dir); in thinlto_set_generated_objects_dir()
658 lto_bool_t thinlto_codegen_set_pic_model(thinlto_code_gen_t cg, in thinlto_codegen_set_pic_model() argument
662 unwrap(cg)->setCodePICModel(Reloc::Static); in thinlto_codegen_set_pic_model()
665 unwrap(cg)->setCodePICModel(Reloc::PIC_); in thinlto_codegen_set_pic_model()
668 unwrap(cg)->setCodePICModel(Reloc::DynamicNoPIC); in thinlto_codegen_set_pic_model()
671 unwrap(cg)->setCodePICModel(None); in thinlto_codegen_set_pic_model()