| 70 | }; |
| 71 | |
| 72 | class ArgumentProcessingState |
| 73 | { |
| 74 | public: |
| 75 | std::optional<std::string> found_c_opt; |
| 76 | std::optional<std::string> found_dc_opt; |
| 77 | bool found_S_opt = false; |
| 78 | bool found_analyze_opt = false; |
| 79 | bool found_pch = false; |
| 80 | bool found_fpch_preprocess = false; |
| 81 | bool found_Yu = false; |
| 82 | bool found_Yc = false; |
| 83 | fs::path found_Fp_file; |
| 84 | bool found_valid_Fp = false; |
| 85 | bool found_syntax_only = false; |
| 86 | ColorDiagnostics color_diagnostics = ColorDiagnostics::automatic; |
| 87 | std::unordered_map<std::string, std::vector<std::string>> xarch_args; |
| 88 | bool found_mf_opt = false; |
| 89 | bool found_wp_md_or_mmd_opt = false; |
| 90 | bool found_md_or_mmd_opt = false; |
| 91 | bool found_Wa_a_opt = false; |
| 92 | bool rewrite_FI_args = false; |
| 93 | |
| 94 | std::string explicit_language; // As specified with -x. |
| 95 | std::string input_charset_option; // -finput-charset=... |
| 96 | std::string last_seen_msvc_z_debug_option; // /Z7, /Zi or /ZI |
| 97 | |
| 98 | // Is the dependency file set via -Wp,-M[M]D,target or -MFtarget? |
| 99 | OutputDepOrigin output_dep_origin = OutputDepOrigin::none; |
| 100 | |
| 101 | // Arguments classified as input files. |
| 102 | std::vector<fs::path> input_files; |
| 103 | |
| 104 | // Whether to include the full command line in the hash. |
| 105 | bool hash_full_command_line = false; |
| 106 | |
| 107 | // Whether to include the actual CWD in the hash. |
| 108 | bool hash_actual_cwd = false; |
| 109 | |
| 110 | template<typename T> |
| 111 | void |
| 112 | add_common_arg(T&& arg) |
| 113 | { |
| 114 | m_preprocessor_args.push_back(std::forward<T>(arg)); |
| 115 | m_compiler_args.push_back(std::forward<T>(arg)); |
| 116 | } |
| 117 | |
| 118 | template<typename T> |
| 119 | void |
| 120 | add_compiler_only_arg(T&& arg) |
| 121 | { |
| 122 | m_compiler_args.push_back(std::forward<T>(arg)); |
| 123 | m_extra_args_to_hash.push_back(std::forward<T>(arg)); |
| 124 | } |
| 125 | |
| 126 | template<typename T> |
| 127 | void |
| 128 | add_compiler_only_arg_no_hash(T&& arg) |
| 129 | { |
nothing calls this directly
no outgoing calls
no test coverage detected