]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Context: move direct_i_file
authorThomas Otto <thomas.otto@pdv-fs.de>
Fri, 24 Jan 2020 19:13:41 +0000 (20:13 +0100)
committerThomas Otto <thomas.otto@pdv-fs.de>
Thu, 13 Feb 2020 22:51:43 +0000 (23:51 +0100)
src/ccache.cpp
src/legacy_globals.cpp
src/legacy_globals.hpp
unittest/test_argument_processing.cpp

index 6882717596ae5ebff75374a4ef186b9a9f5110cc..a85c2ed99823b172dcd45d224eef6f3080b73571 100644 (file)
@@ -1419,7 +1419,7 @@ get_result_name_from_cpp(Context& ctx, struct args* args, struct hash* hash)
   char* path_stderr = NULL;
   char* path_stdout = nullptr;
   int status;
-  if (direct_i_file) {
+  if (ctx.args_info.direct_i_file) {
     // We are compiling a .i or .ii file - that means we can skip the cpp stage
     // and directly form the correct i_tmpfile.
     path_stdout = x_strdup(ctx.args_info.input_file.c_str());
@@ -1469,14 +1469,14 @@ get_result_name_from_cpp(Context& ctx, struct args* args, struct hash* hash)
   }
 
   hash_delimiter(hash, "cppstderr");
-  if (!direct_i_file && !hash_file(hash, path_stderr)) {
+  if (!ctx.args_info.direct_i_file && !hash_file(hash, path_stderr)) {
     // Somebody removed the temporary file?
     stats_update(STATS_ERROR);
     cc_log("Failed to open %s: %s", path_stderr, strerror(errno));
     failed();
   }
 
-  if (direct_i_file) {
+  if (ctx.args_info.direct_i_file) {
     i_tmpfile = x_strdup(ctx.args_info.input_file.c_str());
   } else {
     // i_tmpfile needs the proper cpp_extension for the compiler to do its
@@ -3567,7 +3567,6 @@ cc_reset(void)
   g_included_files.clear();
   has_absolute_include_headers = false;
   i_tmpfile = NULL;
-  direct_i_file = false;
   free_and_nullify(cpp_stderr);
   free_and_nullify(stats_file);
   output_is_precompiled_header = false;
@@ -3705,7 +3704,6 @@ do_cache_compilation(Context& ctx, char* argv[])
     failed(); // stats_update is called in cc_process_args.
   }
 
-  direct_i_file = ctx.args_info.direct_i_file;
   output_is_precompiled_header = ctx.args_info.output_is_precompiled_header;
   profile_use = ctx.args_info.profile_use;
   profile_generate = ctx.args_info.profile_generate;
index 06d51a76289ec7698fd0fa98ffcf402b092428ff..28cb82d1b1328ed794d3c095ef3c694e591f0aa0 100644 (file)
@@ -61,9 +61,6 @@ size_t ignore_headers_len;
 // The name of the temporary preprocessed file.
 char* i_tmpfile;
 
-// Are we compiling a .i or .ii file directly?
-bool direct_i_file;
-
 // The name of the cpp stderr file.
 char* cpp_stderr;
 
index 2e5208278223cc05ce40e5fe1d727df9a56a84ad..6be4d932a21066adffe15ffff89db996ca221fac 100644 (file)
@@ -56,8 +56,6 @@ extern size_t ignore_headers_len;
 
 extern char* i_tmpfile;
 
-extern bool direct_i_file;
-
 extern char* cpp_stderr;
 
 extern char* manifest_stats_file;
index 914e771eff49e30924f26ce898e7ab52336f9f06..801980dea1567a8ca5d160d36490fa1c3c46a306 100644 (file)
@@ -84,7 +84,6 @@ cc_process_args(Context& ctx,
                                  extra_args_to_hash,
                                  compiler_args);
 
-  direct_i_file = ctx.args_info.direct_i_file;
   output_is_precompiled_header = ctx.args_info.output_is_precompiled_header;
   profile_use = ctx.args_info.profile_use;
   profile_generate = ctx.args_info.profile_generate;