]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Context: move arch_args
authorThomas Otto <thomas.otto@pdv-fs.de>
Sat, 25 Jan 2020 09:40:47 +0000 (10:40 +0100)
committerThomas Otto <thomas.otto@pdv-fs.de>
Mon, 17 Feb 2020 20:38:59 +0000 (21:38 +0100)
src/ccache.cpp
src/legacy_globals.cpp
src/legacy_globals.hpp

index 7d4f5764e2a9a91f1550c7193203b65e725726de..3b01c1875f0c074cffb7d39330e8b7920a84a897 100644 (file)
@@ -1927,9 +1927,9 @@ calculate_result_name(Context& ctx,
   }
 
   // Adding -arch to hash since cpp output is affected.
-  for (size_t i = 0; i < arch_args_size; ++i) {
+  for (size_t i = 0; i < ctx.args_info.arch_args_size; ++i) {
     hash_delimiter(hash, "-arch");
-    hash_string(hash, arch_args[i]);
+    hash_string(hash, ctx.args_info.arch_args[i]);
   }
 
   struct digest* result_name = NULL;
@@ -1998,16 +1998,17 @@ calculate_result_name(Context& ctx,
     }
   } else {
     assert(preprocessor_args);
-    if (arch_args_size == 0) {
+    if (ctx.args_info.arch_args_size == 0) {
       result_name = get_result_name_from_cpp(ctx, preprocessor_args, hash);
       cc_log("Got result name from preprocessor");
     } else {
       args_add(preprocessor_args, "-arch");
-      for (size_t i = 0; i < arch_args_size; ++i) {
-        args_add(preprocessor_args, arch_args[i]);
+      for (size_t i = 0; i < ctx.args_info.arch_args_size; ++i) {
+        args_add(preprocessor_args, ctx.args_info.arch_args[i]);
         result_name = get_result_name_from_cpp(ctx, preprocessor_args, hash);
-        cc_log("Got result name from preprocessor with -arch %s", arch_args[i]);
-        if (i != arch_args_size - 1) {
+        cc_log("Got result name from preprocessor with -arch %s",
+               ctx.args_info.arch_args[i]);
+        if (i != ctx.args_info.arch_args_size - 1) {
           free(result_name);
           result_name = NULL;
         }
@@ -3684,11 +3685,6 @@ do_cache_compilation(Context& ctx, char* argv[])
     failed(); // stats_update is called in cc_process_args.
   }
 
-  arch_args_size = ctx.args_info.arch_args_size;
-  for (size_t i = 0; i < ctx.args_info.arch_args_size; ++i) {
-    arch_args[i] = x_strdup(ctx.args_info.arch_args[i]);
-  }
-
   MTR_END("main", "process_args");
 
   if (ctx.config.depend_mode()
index 468ed6d8e26536320145ebc17dbf26f7baa39940..51088f4a2580e7e13e07976577785eaea04bc40c 100644 (file)
 
 #include "legacy_globals.hpp"
 
-// The original argument list.
-extern struct args* orig_args;
-struct args* orig_args = nullptr;
-
-// Array for storing -arch options.
-size_t arch_args_size = 0;
-char* arch_args[MAX_ARCH_ARGS] = {nullptr};
-
 // Name (represented as a struct digest) of the file containing the cached
 // result.
 struct digest* cached_result_name;
index fb0bd27c0622fb4e0763f9231e99f7a44d1b3223..bc51d2249bd7ca6b258684b876f667595e73db2f 100644 (file)
 
 extern unsigned lock_staleness_limit;
 
-#define MAX_ARCH_ARGS 10
-extern size_t arch_args_size;
-extern char* arch_args[MAX_ARCH_ARGS];
-
 extern struct digest* cached_result_name;
 
 extern char* cached_result_path;