]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
refactor: Convert ArgsInfo::output_dwo to fs::path
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 2 Jun 2024 12:42:10 +0000 (14:42 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 30 Jun 2024 15:18:50 +0000 (17:18 +0200)
src/ccache/ArgsInfo.hpp
src/ccache/argprocessing.cpp
src/ccache/ccache.cpp

index 84d2635ce58f8c3695401db3ee330f522c7fd165..5b231c323aef7676cf0dc4bbf3d06829a7ba2d44 100644 (file)
@@ -63,7 +63,7 @@ struct ArgsInfo
   std::filesystem::path output_dia;
 
   // Split dwarf information (GCC 4.8 and up). Contains pathname if not empty.
-  std::string output_dwo;
+  std::filesystem::path output_dwo;
 
   // The path to the ipa clones (implicit when using -fdump-ipa-clones).
   std::string output_ipa;
index 9e9673cd94f74ed2b8c44409765c9219eb8410fa..e2c05c7ef2d3c0b07eb0a12c3e0209ad5ab1cad7 100644 (file)
@@ -1515,8 +1515,7 @@ process_args(Context& ctx)
       // we haven't seen the -gsplit-dwarf option.
       args_info.seen_split_dwarf = false;
     } else {
-      args_info.output_dwo =
-        util::pstr(util::with_extension(args_info.output_obj, ".dwo"));
+      args_info.output_dwo = util::with_extension(args_info.output_obj, ".dwo");
     }
   }
 
index a461072dc04cdce47de9924a365a0a3bad3f14e3..b2fb27bfc86a059eef28461913b0415a923b7597 100644 (file)
@@ -1164,8 +1164,8 @@ to_cache(Context& ctx,
     // produced one, intentionally not using x_unlink or tmp_unlink since we're
     // not interested in logging successful deletions or failures due to
     // nonexistent .dwo files.
-    if (unlink(ctx.args_info.output_dwo.c_str()) != 0 && errno != ENOENT
-        && errno != ESTALE) {
+    if (unlink(util::pstr(ctx.args_info.output_dwo).c_str()) != 0
+        && errno != ENOENT && errno != ESTALE) {
       LOG("Failed to unlink {}: {}", ctx.args_info.output_dwo, strerror(errno));
       return tl::unexpected(Statistic::bad_output_file);
     }