Lines Matching refs:args

69 static HeaderFileType getOutputType(const InputArgList &args) {
71 Arg *outputArg = args.getLastArg(OPT_bundle, OPT_dylib, OPT_execute);
163 getSearchPaths(unsigned optionCode, InputArgList &args,
168 for (StringRef path : args::getStrings(args, optionCode)) {
187 if (args.hasArg(OPT_Z))
201 static std::vector<StringRef> getSystemLibraryRoots(InputArgList &args) {
203 for (const Arg *arg : args.filtered(OPT_syslibroot))
216 getLibrarySearchPaths(InputArgList &args, const std::vector<StringRef> &roots) {
217 return getSearchPaths(OPT_L, args, roots, {"/usr/lib", "/usr/local/lib"});
221 getFrameworkSearchPaths(InputArgList &args,
223 return getSearchPaths(OPT_F, args, roots,
227 static llvm::CachePruningPolicy getLTOCachePolicy(InputArgList &args) {
235 args.filtered(OPT_thinlto_cache_policy_eq, OPT_prune_interval_lto,
577 for (StringRef path : args::getLines(mbref))
746 static void setPlatformVersions(StringRef archName, const ArgList &args) {
749 for (const Arg *arg : args.filtered(OPT_platform_version)) {
798 static TargetInfo *createTargetInfo(InputArgList &args) {
799 StringRef archName = args.getLastArgValue(OPT_arch);
805 setPlatformVersions(archName, args);
821 getUndefinedSymbolTreatment(const ArgList &args) {
822 StringRef treatmentStr = args.getLastArgValue(OPT_undefined);
846 static ICFLevel getICFLevel(const ArgList &args) {
847 StringRef icfLevelStr = args.getLastArgValue(OPT_icf_eq);
867 static ObjCStubsMode getObjCStubsMode(const ArgList &args) {
868 const Arg *arg = args.getLastArg(OPT_objc_stubs_fast, OPT_objc_stubs_small);
918 static const char *getReproduceOption(InputArgList &args) {
919 if (const Arg *arg = args.getLastArg(OPT_reproduce))
925 static std::pair<StringRef, StringRef> getOldNewOptions(opt::InputArgList &args,
927 auto *arg = args.getLastArg(id);
940 getOldNewOptionsExtra(opt::InputArgList &args, unsigned id) {
941 auto [oldDir, second] = getOldNewOptions(args, id);
956 static uint32_t parseDylibVersion(const ArgList &args, unsigned id) {
957 const Arg *arg = args.getLastArg(id);
962 error(arg->getAsString(args) + ": only valid with -dylib");
968 error(arg->getAsString(args) + ": malformed version");
998 static std::vector<SectionAlign> parseSectAlign(const opt::InputArgList &args) {
1000 for (const Arg *arg : args.filtered(OPT_sectalign)) {
1070 static bool dataConstDefault(const InputArgList &args) {
1084 return !(args.hasArg(OPT_no_pie) && supportsNoPie());
1101 static bool shouldEmitChainedFixups(const InputArgList &args) {
1102 const Arg *arg = args.getLastArg(OPT_fixup_chains, OPT_no_fixup_chains);
1121 if (args.hasArg(OPT_preload)) {
1145 static bool shouldEmitRelativeMethodLists(const InputArgList &args) {
1146 const Arg *arg = args.getLastArg(OPT_objc_relative_method_lists,
1207 for (StringRef line : args::getLines(mbref)) {
1214 static void handleSymbolPatterns(InputArgList &args,
1218 for (const Arg *arg : args.filtered(singleOptionCode))
1220 for (const Arg *arg : args.filtered(listFileOptionCode))
1224 static void createFiles(const InputArgList &args) {
1231 for (const Arg *arg : args) {
1518 static SmallVector<StringRef, 0> getRuntimePaths(opt::InputArgList &args) {
1521 for (const Arg *arg : args.filtered(OPT_rpath)) {
1531 static SmallVector<StringRef, 0> getAllowableClients(opt::InputArgList &args) {
1534 for (const Arg *arg : args.filtered(OPT_allowable_client)) {
1578 ctx->e.logName = args::getFilenameWithoutExe(argsArr[0]);
1581 InputArgList args = parser.parse(*ctx, argsArr.slice(1));
1585 ctx->e.errorLimit = args::getInteger(args, OPT_error_limit_eq, 20);
1586 ctx->e.verbose = args.hasArg(OPT_verbose);
1588 if (args.hasArg(OPT_help_hidden)) {
1592 if (args.hasArg(OPT_help)) {
1596 if (args.hasArg(OPT_version)) {
1603 config->outputType = getOutputType(args);
1604 target = createTargetInfo(args);
1606 args.getLastArgValue(OPT_dependency_info));
1608 config->ltoo = args::getInteger(args, OPT_lto_O, 2);
1612 args::getInteger(args, OPT_lto_CGO, args::getCGOptLevel(config->ltoo));
1621 if (args.hasArg(OPT_pagezero_size)) {
1622 uint64_t pagezeroSize = args::getHex(args, OPT_pagezero_size, 0);
1642 config->osoPrefix = args.getLastArgValue(OPT_oso_prefix);
1667 bool pie = args.hasFlag(OPT_pie, OPT_no_pie, true);
1678 config->deadStrip = args.hasArg(OPT_dead_strip);
1680 config->systemLibraryRoots = getSystemLibraryRoots(args);
1681 if (const char *path = getReproduceOption(args)) {
1688 tar->append("response.txt", createResponseFile(args));
1695 if (auto *arg = args.getLastArg(OPT_threads_eq)) {
1704 if (auto *arg = args.getLastArg(OPT_thinlto_jobs_eq))
1709 for (const Arg *arg : args.filtered(OPT_u)) {
1714 for (const Arg *arg : args.filtered(OPT_U))
1717 config->mapFile = args.getLastArgValue(OPT_map);
1718 config->optimize = args::getInteger(args, OPT_O, 1);
1719 config->outputFile = args.getLastArgValue(OPT_o, "a.out");
1721 args.getLastArgValue(OPT_final_output, config->outputFile);
1722 config->astPaths = args.getAllArgValues(OPT_add_ast_path);
1723 config->headerPad = args::getHex(args, OPT_headerpad, /*Default=*/32);
1725 args.hasArg(OPT_headerpad_max_install_names);
1727 args.hasArg(OPT_print_dylib_search) || getenv("RC_TRACE_DYLIB_SEARCHING");
1728 config->printEachFile = args.hasArg(OPT_t);
1729 config->printWhyLoad = args.hasArg(OPT_why_load);
1730 config->omitDebugInfo = args.hasArg(OPT_S);
1731 config->errorForArchMismatch = args.hasArg(OPT_arch_errors_fatal);
1732 if (const Arg *arg = args.getLastArg(OPT_bundle_loader)) {
1738 for (auto *arg : args.filtered(OPT_dyld_env)) {
1749 if (const Arg *arg = args.getLastArg(OPT_umbrella)) {
1754 config->ltoObjPath = args.getLastArgValue(OPT_object_path_lto);
1755 config->ltoNewPmPasses = args.getLastArgValue(OPT_lto_newpm_passes);
1756 config->thinLTOCacheDir = args.getLastArgValue(OPT_cache_path_lto);
1757 config->thinLTOCachePolicy = getLTOCachePolicy(args);
1758 config->thinLTOEmitImportsFiles = args.hasArg(OPT_thinlto_emit_imports_files);
1759 config->thinLTOEmitIndexFiles = args.hasArg(OPT_thinlto_emit_index_files) ||
1760 args.hasArg(OPT_thinlto_index_only) ||
1761 args.hasArg(OPT_thinlto_index_only_eq);
1762 config->thinLTOIndexOnly = args.hasArg(OPT_thinlto_index_only) ||
1763 args.hasArg(OPT_thinlto_index_only_eq);
1764 config->thinLTOIndexOnlyArg = args.getLastArgValue(OPT_thinlto_index_only_eq);
1766 getOldNewOptions(args, OPT_thinlto_object_suffix_replace_eq);
1769 getOldNewOptionsExtra(args, OPT_thinlto_prefix_replace_eq);
1771 if (args.hasArg(OPT_thinlto_object_suffix_replace_eq))
1774 else if (args.hasArg(OPT_thinlto_prefix_replace_eq))
1784 args.hasFlag(OPT_warn_duplicate_rpath, OPT_no_warn_duplicate_rpath, true);
1785 config->runtimePaths = getRuntimePaths(args);
1786 config->allowableClients = getAllowableClients(args);
1787 config->allLoad = args.hasFlag(OPT_all_load, OPT_noall_load, false);
1788 config->archMultiple = args.hasArg(OPT_arch_multiple);
1789 config->applicationExtension = args.hasFlag(
1791 config->exportDynamic = args.hasArg(OPT_export_dynamic);
1792 config->forceLoadObjC = args.hasArg(OPT_ObjC);
1793 config->forceLoadSwift = args.hasArg(OPT_force_load_swift_libs);
1794 config->deadStripDylibs = args.hasArg(OPT_dead_strip_dylibs);
1795 config->demangle = args.hasArg(OPT_demangle);
1796 config->implicitDylibs = !args.hasArg(OPT_no_implicit_dylibs);
1798 args.hasFlag(OPT_function_starts, OPT_no_function_starts, true);
1800 args.hasFlag(OPT_data_in_code_info, OPT_no_data_in_code_info, true);
1801 config->emitChainedFixups = shouldEmitChainedFixups(args);
1803 config->emitChainedFixups || args.hasArg(OPT_init_offsets);
1804 config->emitRelativeMethodLists = shouldEmitRelativeMethodLists(args);
1805 config->icfLevel = getICFLevel(args);
1806 config->keepICFStabs = args.hasArg(OPT_keep_icf_stabs);
1808 args.hasFlag(OPT_deduplicate_strings, OPT_no_deduplicate_strings, true);
1809 config->dedupSymbolStrings = !args.hasArg(OPT_no_deduplicate_symbol_strings);
1810 config->deadStripDuplicates = args.hasArg(OPT_dead_strip_duplicates);
1811 config->warnDylibInstallName = args.hasFlag(
1813 config->ignoreOptimizationHints = args.hasArg(OPT_ignore_optimization_hints);
1814 config->callGraphProfileSort = args.hasFlag(
1816 config->printSymbolOrder = args.getLastArgValue(OPT_print_symbol_order_eq);
1819 config->objcStubsMode = getObjCStubsMode(args);
1820 config->ignoreAutoLink = args.hasArg(OPT_ignore_auto_link);
1821 for (const Arg *arg : args.filtered(OPT_ignore_auto_link_option))
1823 config->strictAutoLink = args.hasArg(OPT_strict_auto_link);
1824 config->ltoDebugPassManager = args.hasArg(OPT_lto_debug_pass_manager);
1826 args.getLastArgValue(OPT_codegen_data_generate_path);
1827 config->csProfileGenerate = args.hasArg(OPT_cs_profile_generate);
1828 config->csProfilePath = args.getLastArgValue(OPT_cs_profile_path);
1830 args.hasFlag(OPT_pgo_warn_mismatch, OPT_no_pgo_warn_mismatch, true);
1832 args.hasFlag(OPT_warn_thin_archive_missing_members,
1834 config->generateUuid = !args.hasArg(OPT_no_uuid);
1839 if (const Arg *arg = args.getLastArgNoClaim(OPT_call_graph_profile_sort))
1842 if (args.hasArg(OPT_irpgo_profile_sort) ||
1843 args.hasArg(OPT_irpgo_profile_sort_eq))
1846 if (const Arg *arg = args.getLastArg(OPT_irpgo_profile))
1849 if (const Arg *arg = args.getLastArg(OPT_irpgo_profile_sort)) {
1855 args.hasFlag(OPT_bp_compression_sort_startup_functions,
1857 if (const Arg *arg = args.getLastArg(OPT_bp_startup_sort)) {
1874 if (const Arg *arg = args.getLastArg(OPT_bp_compression_sort)) {
1890 config->bpVerboseSectionOrderer = args.hasArg(OPT_verbose_bp_section_orderer);
1892 for (const Arg *arg : args.filtered(OPT_alias)) {
1899 if (args.getLastArg(OPT_reproducible))
1905 args.hasFlag(OPT_encryptable, OPT_no_encryption,
1908 if (const Arg *arg = args.getLastArg(OPT_install_name)) {
1911 arg->getAsString(args) +
1926 config->clientName = args.getLastArgValue(OPT_client_name, getClientName());
1928 if (args.hasArg(OPT_mark_dead_strippable_dylib)) {
1935 if (const Arg *arg = args.getLastArg(OPT_static, OPT_dynamic))
1939 args.getLastArg(OPT_flat_namespace, OPT_twolevel_namespace))
1944 config->undefinedSymbolTreatment = getUndefinedSymbolTreatment(args);
1947 config->entry = symtab->addUndefined(args.getLastArgValue(OPT_e, "_main"),
1952 getLibrarySearchPaths(args, config->systemLibraryRoots);
1954 getFrameworkSearchPaths(args, config->systemLibraryRoots);
1956 args.getLastArg(OPT_search_paths_first, OPT_search_dylibs_first))
1961 parseDylibVersion(args, OPT_compatibility_version);
1962 config->dylibCurrentVersion = parseDylibVersion(args, OPT_current_version);
1965 args.hasFlag(OPT_data_const, OPT_no_data_const, dataConstDefault(args));
1977 for (const Arg *arg : args.filtered(OPT_rename_section)) {
1982 for (const Arg *arg : args.filtered(OPT_rename_segment)) {
1987 config->sectionAlignments = parseSectAlign(args);
1989 for (const Arg *arg : args.filtered(OPT_segprot)) {
2000 error("invalid argument '" + arg->getAsString(args) +
2004 error("invalid argument '" + arg->getAsString(args) +
2014 args.hasArg(OPT_no_exported_symbols) ||
2015 args.hasArgNoClaim(OPT_exported_symbol, OPT_exported_symbols_list);
2016 handleSymbolPatterns(args, config->exportedSymbols, OPT_exported_symbol,
2018 handleSymbolPatterns(args, config->unexportedSymbols, OPT_unexported_symbol,
2023 if (args.hasArg(OPT_no_exported_symbols) && !config->exportedSymbols.empty())
2037 args.filtered(OPT_x, OPT_non_global_symbols_no_strip_list,
2075 for (const Arg *arg : args.filtered(OPT_why_live))
2080 config->saveTemps = args.hasArg(OPT_save_temps);
2082 config->adhocCodesign = args.hasFlag(
2086 if (args.hasArg(OPT_v)) {
2102 config->timeTraceEnabled = args.hasArg(OPT_time_trace_eq);
2104 args::getInteger(args, OPT_time_trace_granularity_eq, 500);
2114 createFiles(args);
2128 for (const Arg *arg : args.filtered(OPT_sub_umbrella))
2132 for (const Arg *arg : args.filtered(OPT_sub_library))
2139 if (const Arg *arg = args.getLastArg(OPT_mcpu))
2143 for (const Arg *arg : args.filtered(OPT_mllvm)) {
2148 config->passPlugins = args::getStrings(args, OPT_load_pass_plugins);
2178 StringRef orderFile = args.getLastArgValue(OPT_order_file);
2187 for (const Arg *arg : args.filtered(OPT_sectcreate)) {
2196 for (const Arg *arg : args.filtered(OPT_add_empty_section)) {
2220 if (args.hasArg(OPT_check_category_conflicts))
2225 if (args.hasFlag(OPT_objc_category_merging, OPT_no_objc_category_merging,
2252 args.getLastArgValue(OPT_time_trace_eq).str(), config->outputFile));