Lines Matching refs:cg

149 static void lto_add_attrs(lto_code_gen_t cg) {  in DEFINE_SIMPLE_CONVERSION_FUNCTIONS()
150 LTOCodeGenerator *CG = unwrap(cg); in DEFINE_SIMPLE_CONVERSION_FUNCTIONS()
287 lto_code_gen_t cg) { in lto_module_create_in_codegen_context() argument
292 unwrap(cg)->getContext(), mem, length, Options, StringRef(path)); in lto_module_create_in_codegen_context()
344 void lto_codegen_set_diagnostic_handler(lto_code_gen_t cg, in lto_codegen_set_diagnostic_handler() argument
347 unwrap(cg)->setDiagnosticHandler(diag_handler, ctxt); in lto_codegen_set_diagnostic_handler()
370 void lto_codegen_dispose(lto_code_gen_t cg) { delete unwrap(cg); } in lto_codegen_dispose() argument
372 bool lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod) { in lto_codegen_add_module() argument
373 return !unwrap(cg)->addModule(unwrap(mod)); in lto_codegen_add_module()
376 void lto_codegen_set_module(lto_code_gen_t cg, lto_module_t mod) { in lto_codegen_set_module() argument
377 unwrap(cg)->setModule(std::unique_ptr<LTOModule>(unwrap(mod))); in lto_codegen_set_module()
380 bool lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model debug) { in lto_codegen_set_debug_model() argument
381 unwrap(cg)->setDebugInfo(debug); in lto_codegen_set_debug_model()
385 bool lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model model) { in lto_codegen_set_pic_model() argument
388 unwrap(cg)->setCodePICModel(Reloc::Static); in lto_codegen_set_pic_model()
391 unwrap(cg)->setCodePICModel(Reloc::PIC_); in lto_codegen_set_pic_model()
394 unwrap(cg)->setCodePICModel(Reloc::DynamicNoPIC); in lto_codegen_set_pic_model()
397 unwrap(cg)->setCodePICModel(None); in lto_codegen_set_pic_model()
404 void lto_codegen_set_cpu(lto_code_gen_t cg, const char *cpu) { in lto_codegen_set_cpu() argument
405 return unwrap(cg)->setCpu(cpu); in lto_codegen_set_cpu()
408 void lto_codegen_set_assembler_path(lto_code_gen_t cg, const char *path) { in lto_codegen_set_assembler_path() argument
412 void lto_codegen_set_assembler_args(lto_code_gen_t cg, const char **args, in lto_codegen_set_assembler_args() argument
417 void lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, in lto_codegen_add_must_preserve_symbol() argument
419 unwrap(cg)->addMustPreserveSymbol(symbol); in lto_codegen_add_must_preserve_symbol()
422 static void maybeParseOptions(lto_code_gen_t cg) { in maybeParseOptions() argument
425 unwrap(cg)->parseCodeGenDebugOptions(); in maybeParseOptions()
426 lto_add_attrs(cg); in maybeParseOptions()
431 bool lto_codegen_write_merged_modules(lto_code_gen_t cg, const char *path) { in lto_codegen_write_merged_modules() argument
432 maybeParseOptions(cg); in lto_codegen_write_merged_modules()
433 return !unwrap(cg)->writeMergedModules(path); in lto_codegen_write_merged_modules()
436 const void *lto_codegen_compile(lto_code_gen_t cg, size_t *length) { in lto_codegen_compile() argument
437 maybeParseOptions(cg); in lto_codegen_compile()
438 LibLTOCodeGenerator *CG = unwrap(cg); in lto_codegen_compile()
446 bool lto_codegen_optimize(lto_code_gen_t cg) { in lto_codegen_optimize() argument
447 maybeParseOptions(cg); in lto_codegen_optimize()
448 return !unwrap(cg)->optimize(); in lto_codegen_optimize()
451 const void *lto_codegen_compile_optimized(lto_code_gen_t cg, size_t *length) { in lto_codegen_compile_optimized() argument
452 maybeParseOptions(cg); in lto_codegen_compile_optimized()
453 LibLTOCodeGenerator *CG = unwrap(cg); in lto_codegen_compile_optimized()
461 bool lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) { in lto_codegen_compile_to_file() argument
462 maybeParseOptions(cg); in lto_codegen_compile_to_file()
463 return !unwrap(cg)->compile_to_file(name); in lto_codegen_compile_to_file()
479 void lto_codegen_debug_options(lto_code_gen_t cg, const char *opt) { in lto_codegen_debug_options() argument
487 unwrap(cg)->setCodeGenDebugOptions(Options); in lto_codegen_debug_options()
490 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()
547 void thinlto_codegen_dispose(thinlto_code_gen_t cg) { delete unwrap(cg); } in thinlto_codegen_dispose() argument
549 void thinlto_codegen_add_module(thinlto_code_gen_t cg, const char *Identifier, in thinlto_codegen_add_module() argument
551 unwrap(cg)->addModule(Identifier, StringRef(Data, Length)); in thinlto_codegen_add_module()
554 void thinlto_codegen_process(thinlto_code_gen_t cg) { unwrap(cg)->run(); } in thinlto_codegen_process() argument
556 unsigned int thinlto_module_get_num_objects(thinlto_code_gen_t cg) { in thinlto_module_get_num_objects() argument
557 return unwrap(cg)->getProducedBinaries().size(); in thinlto_module_get_num_objects()
559 LTOObjectBuffer thinlto_module_get_object(thinlto_code_gen_t cg, in thinlto_module_get_object() argument
561 assert(index < unwrap(cg)->getProducedBinaries().size() && "Index overflow"); in thinlto_module_get_object()
562 auto &MemBuffer = unwrap(cg)->getProducedBinaries()[index]; in thinlto_module_get_object()
567 unsigned int thinlto_module_get_num_object_files(thinlto_code_gen_t cg) { in thinlto_module_get_num_object_files() argument
568 return unwrap(cg)->getProducedBinaryFiles().size(); in thinlto_module_get_num_object_files()
570 const char *thinlto_module_get_object_file(thinlto_code_gen_t cg, in thinlto_module_get_object_file() argument
572 assert(index < unwrap(cg)->getProducedBinaryFiles().size() && in thinlto_module_get_object_file()
574 return unwrap(cg)->getProducedBinaryFiles()[index].c_str(); in thinlto_module_get_object_file()
577 void thinlto_codegen_disable_codegen(thinlto_code_gen_t cg, in thinlto_codegen_disable_codegen() argument
579 unwrap(cg)->disableCodeGen(disable); in thinlto_codegen_disable_codegen()
582 void thinlto_codegen_set_codegen_only(thinlto_code_gen_t cg, in thinlto_codegen_set_codegen_only() argument
584 unwrap(cg)->setCodeGenOnly(CodeGenOnly); in thinlto_codegen_set_codegen_only()
600 void thinlto_codegen_add_must_preserve_symbol(thinlto_code_gen_t cg, in thinlto_codegen_add_must_preserve_symbol() argument
602 unwrap(cg)->preserveSymbol(StringRef(Name, Length)); in thinlto_codegen_add_must_preserve_symbol()
605 void thinlto_codegen_add_cross_referenced_symbol(thinlto_code_gen_t cg, in thinlto_codegen_add_cross_referenced_symbol() argument
607 unwrap(cg)->crossReferenceSymbol(StringRef(Name, Length)); in thinlto_codegen_add_cross_referenced_symbol()
610 void thinlto_codegen_set_cpu(thinlto_code_gen_t cg, const char *cpu) { in thinlto_codegen_set_cpu() argument
611 return unwrap(cg)->setCpu(cpu); in thinlto_codegen_set_cpu()
614 void thinlto_codegen_set_cache_dir(thinlto_code_gen_t cg, in thinlto_codegen_set_cache_dir() argument
616 return unwrap(cg)->setCacheDir(cache_dir); in thinlto_codegen_set_cache_dir()
619 void thinlto_codegen_set_cache_pruning_interval(thinlto_code_gen_t cg, in thinlto_codegen_set_cache_pruning_interval() argument
621 return unwrap(cg)->setCachePruningInterval(interval); in thinlto_codegen_set_cache_pruning_interval()
624 void thinlto_codegen_set_cache_entry_expiration(thinlto_code_gen_t cg, in thinlto_codegen_set_cache_entry_expiration() argument
626 return unwrap(cg)->setCacheEntryExpiration(expiration); in thinlto_codegen_set_cache_entry_expiration()
630 thinlto_code_gen_t cg, unsigned Percentage) { in thinlto_codegen_set_final_cache_size_relative_to_available_space() argument
631 return unwrap(cg)->setMaxCacheSizeRelativeToAvailableSpace(Percentage); in thinlto_codegen_set_final_cache_size_relative_to_available_space()
635 thinlto_code_gen_t cg, unsigned MaxSizeBytes) { in thinlto_codegen_set_cache_size_bytes() argument
636 return unwrap(cg)->setCacheMaxSizeBytes(MaxSizeBytes); in thinlto_codegen_set_cache_size_bytes()
640 thinlto_code_gen_t cg, unsigned MaxSizeMegabytes) { in thinlto_codegen_set_cache_size_megabytes() argument
643 return unwrap(cg)->setCacheMaxSizeBytes(MaxSizeBytes); in thinlto_codegen_set_cache_size_megabytes()
647 thinlto_code_gen_t cg, unsigned MaxSizeFiles) { in thinlto_codegen_set_cache_size_files() argument
648 return unwrap(cg)->setCacheMaxSizeFiles(MaxSizeFiles); in thinlto_codegen_set_cache_size_files()
651 void thinlto_codegen_set_savetemps_dir(thinlto_code_gen_t cg, in thinlto_codegen_set_savetemps_dir() argument
653 return unwrap(cg)->setSaveTempsDir(save_temps_dir); in thinlto_codegen_set_savetemps_dir()
656 void thinlto_set_generated_objects_dir(thinlto_code_gen_t cg, in thinlto_set_generated_objects_dir() argument
658 unwrap(cg)->setGeneratedObjectsDirectory(save_temps_dir); in thinlto_set_generated_objects_dir()
661 lto_bool_t thinlto_codegen_set_pic_model(thinlto_code_gen_t cg, in thinlto_codegen_set_pic_model() argument
665 unwrap(cg)->setCodePICModel(Reloc::Static); in thinlto_codegen_set_pic_model()
668 unwrap(cg)->setCodePICModel(Reloc::PIC_); in thinlto_codegen_set_pic_model()
671 unwrap(cg)->setCodePICModel(Reloc::DynamicNoPIC); in thinlto_codegen_set_pic_model()
674 unwrap(cg)->setCodePICModel(None); in thinlto_codegen_set_pic_model()