]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Context: move seen_split_dwarf
authorThomas Otto <thomas.otto@pdv-fs.de>
Fri, 24 Jan 2020 18:59:21 +0000 (19:59 +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 807ddbe586040bd3f459602bf5d189db17982dd7..9d8e0079914d8005a049d482844e6f65c02167a9 100644 (file)
@@ -1169,7 +1169,7 @@ to_cache(Context& ctx,
     args_add(args, i_tmpfile);
   }
 
-  if (seen_split_dwarf) {
+  if (ctx.args_info.seen_split_dwarf) {
     // Remove any pre-existing .dwo file since we want to check if the compiler
     // produced one, intentionally not using x_unlink or tmp_unlink since we're
     // not interested in logging successful deletions or failures due to
@@ -1353,7 +1353,7 @@ to_cache(Context& ctx,
   if (ctx.args_info.generating_diagnostics) {
     result_file_map.emplace(FileType::diagnostic, ctx.args_info.output_dia);
   }
-  if (seen_split_dwarf && Stat::stat(ctx.args_info.output_dwo)) {
+  if (ctx.args_info.seen_split_dwarf && Stat::stat(ctx.args_info.output_dwo)) {
     // Only copy .dwo file if it was created by the compiler (GCC and Clang
     // behave differently e.g. for "-gsplit-dwarf -g1").
     result_file_map.emplace(FileType::dwarf_object, ctx.args_info.output_dwo);
@@ -1663,7 +1663,7 @@ hash_common_info(Context& ctx,
     }
   }
 
-  if (ctx.args_info.generating_dependencies || seen_split_dwarf) {
+  if (ctx.args_info.generating_dependencies || ctx.args_info.seen_split_dwarf) {
     // The output object file name is part of the .d file, so include the path
     // in the hash if generating dependencies.
     //
@@ -2081,7 +2081,7 @@ from_cache(Context& ctx,
   ResultFileMap result_file_map;
   if (ctx.args_info.output_obj != "/dev/null") {
     result_file_map.emplace(FileType::object, ctx.args_info.output_obj);
-    if (seen_split_dwarf) {
+    if (ctx.args_info.seen_split_dwarf) {
       result_file_map.emplace(FileType::dwarf_object, ctx.args_info.output_dwo);
     }
   }
@@ -3571,8 +3571,6 @@ cc_reset(void)
   free_and_nullify(cpp_stderr);
   free_and_nullify(stats_file);
   output_is_precompiled_header = false;
-
-  seen_split_dwarf = false;
 }
 
 // Make a copy of stderr that will not be cached, so things like distcc can
@@ -3707,7 +3705,6 @@ do_cache_compilation(Context& ctx, char* argv[])
     failed(); // stats_update is called in cc_process_args.
   }
 
-  seen_split_dwarf = ctx.args_info.seen_split_dwarf;
   profile_arcs = ctx.args_info.profile_arcs;
   profile_dir = x_strdup(ctx.args_info.profile_dir.c_str());
 
index d86fb63b1c8e82095acc9d2ad409ecb289fd92ed..af867bf971872396c08ffbfdc5785e3b59dce772 100644 (file)
@@ -58,9 +58,6 @@ char** ignore_headers;
 // Size of headers to ignore list.
 size_t ignore_headers_len;
 
-// Have we seen -gsplit-dwarf?
-bool seen_split_dwarf;
-
 // Is the compiler being asked to output coverage data (.gcda) at runtime?
 bool profile_arcs;
 
index 1da4b01c791654a7cd3d1195e5a4ad493fb1944d..351a09b4dcc0ce24535f2edac75e9b143699d002 100644 (file)
@@ -54,8 +54,6 @@ extern char** ignore_headers;
 
 extern size_t ignore_headers_len;
 
-extern bool seen_split_dwarf;
-
 extern bool profile_arcs;
 
 extern char* profile_dir;
index 9fd5f48068b490be8836725b8e7efd972ad85403..60d9636a4d2043312f643e002eaada0ef59dcd07 100644 (file)
@@ -84,7 +84,6 @@ cc_process_args(Context& ctx,
                                  extra_args_to_hash,
                                  compiler_args);
 
-  seen_split_dwarf = ctx.args_info.seen_split_dwarf;
   profile_arcs = ctx.args_info.profile_arcs;
   profile_dir = x_strdup(ctx.args_info.profile_dir.c_str());