Lines Matching refs:cg
146 static void lto_add_attrs(lto_code_gen_t cg) { in DEFINE_SIMPLE_CONVERSION_FUNCTIONS()
147 LTOCodeGenerator *CG = unwrap(cg); in DEFINE_SIMPLE_CONVERSION_FUNCTIONS()
281 lto_code_gen_t cg) { in lto_module_create_in_codegen_context() argument
285 unwrap(cg)->getContext(), mem, length, Options, path); in lto_module_create_in_codegen_context()
316 void lto_codegen_set_diagnostic_handler(lto_code_gen_t cg, in lto_codegen_set_diagnostic_handler() argument
319 unwrap(cg)->setDiagnosticHandler(diag_handler, ctxt); in lto_codegen_set_diagnostic_handler()
342 void lto_codegen_dispose(lto_code_gen_t cg) { delete unwrap(cg); } in lto_codegen_dispose() argument
344 bool lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod) { in lto_codegen_add_module() argument
345 return !unwrap(cg)->addModule(unwrap(mod)); in lto_codegen_add_module()
348 void lto_codegen_set_module(lto_code_gen_t cg, lto_module_t mod) { in lto_codegen_set_module() argument
349 unwrap(cg)->setModule(std::unique_ptr<LTOModule>(unwrap(mod))); in lto_codegen_set_module()
352 bool lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model debug) { in lto_codegen_set_debug_model() argument
353 unwrap(cg)->setDebugInfo(debug); in lto_codegen_set_debug_model()
357 bool lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model model) { in lto_codegen_set_pic_model() argument
360 unwrap(cg)->setCodePICModel(Reloc::Static); in lto_codegen_set_pic_model()
363 unwrap(cg)->setCodePICModel(Reloc::PIC_); in lto_codegen_set_pic_model()
366 unwrap(cg)->setCodePICModel(Reloc::DynamicNoPIC); in lto_codegen_set_pic_model()
369 unwrap(cg)->setCodePICModel(None); in lto_codegen_set_pic_model()
376 void lto_codegen_set_cpu(lto_code_gen_t cg, const char *cpu) { in lto_codegen_set_cpu() argument
377 return unwrap(cg)->setCpu(cpu); in lto_codegen_set_cpu()
380 void lto_codegen_set_assembler_path(lto_code_gen_t cg, const char *path) { in lto_codegen_set_assembler_path() argument
384 void lto_codegen_set_assembler_args(lto_code_gen_t cg, const char **args, in lto_codegen_set_assembler_args() argument
389 void lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, in lto_codegen_add_must_preserve_symbol() argument
391 unwrap(cg)->addMustPreserveSymbol(symbol); in lto_codegen_add_must_preserve_symbol()
394 static void maybeParseOptions(lto_code_gen_t cg) { in maybeParseOptions() argument
396 unwrap(cg)->parseCodeGenDebugOptions(); in maybeParseOptions()
397 lto_add_attrs(cg); in maybeParseOptions()
402 bool lto_codegen_write_merged_modules(lto_code_gen_t cg, const char *path) { in lto_codegen_write_merged_modules() argument
403 maybeParseOptions(cg); in lto_codegen_write_merged_modules()
404 return !unwrap(cg)->writeMergedModules(path); in lto_codegen_write_merged_modules()
407 const void *lto_codegen_compile(lto_code_gen_t cg, size_t *length) { in lto_codegen_compile() argument
408 maybeParseOptions(cg); in lto_codegen_compile()
409 LibLTOCodeGenerator *CG = unwrap(cg); in lto_codegen_compile()
419 bool lto_codegen_optimize(lto_code_gen_t cg) { in lto_codegen_optimize() argument
420 maybeParseOptions(cg); in lto_codegen_optimize()
421 return !unwrap(cg)->optimize(DisableVerify, DisableInline, DisableGVNLoadPRE, in lto_codegen_optimize()
425 const void *lto_codegen_compile_optimized(lto_code_gen_t cg, size_t *length) { in lto_codegen_compile_optimized() argument
426 maybeParseOptions(cg); in lto_codegen_compile_optimized()
427 LibLTOCodeGenerator *CG = unwrap(cg); in lto_codegen_compile_optimized()
435 bool lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) { in lto_codegen_compile_to_file() argument
436 maybeParseOptions(cg); in lto_codegen_compile_to_file()
437 return !unwrap(cg)->compile_to_file( in lto_codegen_compile_to_file()
442 void lto_codegen_debug_options(lto_code_gen_t cg, const char *opt) { in lto_codegen_debug_options() argument
443 unwrap(cg)->setCodeGenDebugOptions(opt); in lto_codegen_debug_options()
448 void lto_codegen_set_should_internalize(lto_code_gen_t cg, in lto_codegen_set_should_internalize() argument
450 unwrap(cg)->setShouldInternalize(ShouldInternalize); in lto_codegen_set_should_internalize()
453 void lto_codegen_set_should_embed_uselists(lto_code_gen_t cg, in lto_codegen_set_should_embed_uselists() argument
455 unwrap(cg)->setShouldEmbedUselists(ShouldEmbedUselists); in lto_codegen_set_should_embed_uselists()
468 void thinlto_codegen_dispose(thinlto_code_gen_t cg) { delete unwrap(cg); } in thinlto_codegen_dispose() argument
470 void thinlto_codegen_add_module(thinlto_code_gen_t cg, const char *Identifier, in thinlto_codegen_add_module() argument
472 unwrap(cg)->addModule(Identifier, StringRef(Data, Length)); in thinlto_codegen_add_module()
475 void thinlto_codegen_process(thinlto_code_gen_t cg) { unwrap(cg)->run(); } in thinlto_codegen_process() argument
477 unsigned int thinlto_module_get_num_objects(thinlto_code_gen_t cg) { in thinlto_module_get_num_objects() argument
478 return unwrap(cg)->getProducedBinaries().size(); in thinlto_module_get_num_objects()
480 LTOObjectBuffer thinlto_module_get_object(thinlto_code_gen_t cg, in thinlto_module_get_object() argument
482 assert(index < unwrap(cg)->getProducedBinaries().size() && "Index overflow"); in thinlto_module_get_object()
483 auto &MemBuffer = unwrap(cg)->getProducedBinaries()[index]; in thinlto_module_get_object()
488 void thinlto_codegen_disable_codegen(thinlto_code_gen_t cg, in thinlto_codegen_disable_codegen() argument
490 unwrap(cg)->disableCodeGen(disable); in thinlto_codegen_disable_codegen()
493 void thinlto_codegen_set_codegen_only(thinlto_code_gen_t cg, in thinlto_codegen_set_codegen_only() argument
495 unwrap(cg)->setCodeGenOnly(CodeGenOnly); in thinlto_codegen_set_codegen_only()
512 void thinlto_codegen_add_must_preserve_symbol(thinlto_code_gen_t cg, in thinlto_codegen_add_must_preserve_symbol() argument
514 unwrap(cg)->preserveSymbol(StringRef(Name, Length)); in thinlto_codegen_add_must_preserve_symbol()
517 void thinlto_codegen_add_cross_referenced_symbol(thinlto_code_gen_t cg, in thinlto_codegen_add_cross_referenced_symbol() argument
519 unwrap(cg)->crossReferenceSymbol(StringRef(Name, Length)); in thinlto_codegen_add_cross_referenced_symbol()
522 void thinlto_codegen_set_cpu(thinlto_code_gen_t cg, const char *cpu) { in thinlto_codegen_set_cpu() argument
523 return unwrap(cg)->setCpu(cpu); in thinlto_codegen_set_cpu()
526 void thinlto_codegen_set_cache_dir(thinlto_code_gen_t cg, in thinlto_codegen_set_cache_dir() argument
528 return unwrap(cg)->setCacheDir(cache_dir); in thinlto_codegen_set_cache_dir()
531 void thinlto_codegen_set_cache_pruning_interval(thinlto_code_gen_t cg, in thinlto_codegen_set_cache_pruning_interval() argument
533 return unwrap(cg)->setCachePruningInterval(interval); in thinlto_codegen_set_cache_pruning_interval()
536 void thinlto_codegen_set_cache_entry_expiration(thinlto_code_gen_t cg, in thinlto_codegen_set_cache_entry_expiration() argument
538 return unwrap(cg)->setCacheEntryExpiration(expiration); in thinlto_codegen_set_cache_entry_expiration()
542 thinlto_code_gen_t cg, unsigned Percentage) { in thinlto_codegen_set_final_cache_size_relative_to_available_space() argument
543 return unwrap(cg)->setMaxCacheSizeRelativeToAvailableSpace(Percentage); in thinlto_codegen_set_final_cache_size_relative_to_available_space()
546 void thinlto_codegen_set_savetemps_dir(thinlto_code_gen_t cg, in thinlto_codegen_set_savetemps_dir() argument
548 return unwrap(cg)->setSaveTempsDir(save_temps_dir); in thinlto_codegen_set_savetemps_dir()
551 lto_bool_t thinlto_codegen_set_pic_model(thinlto_code_gen_t cg, in thinlto_codegen_set_pic_model() argument
555 unwrap(cg)->setCodePICModel(Reloc::Static); in thinlto_codegen_set_pic_model()
558 unwrap(cg)->setCodePICModel(Reloc::PIC_); in thinlto_codegen_set_pic_model()
561 unwrap(cg)->setCodePICModel(Reloc::DynamicNoPIC); in thinlto_codegen_set_pic_model()
564 unwrap(cg)->setCodePICModel(None); in thinlto_codegen_set_pic_model()