From: Joel Rosdahl Date: Sun, 2 Jun 2024 12:42:10 +0000 (+0200) Subject: refactor: Convert ArgsInfo::output_dwo to fs::path X-Git-Tag: v4.11~119 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4022911d0f827bc755aa343f813c04e70f00ac1f;p=thirdparty%2Fccache.git refactor: Convert ArgsInfo::output_dwo to fs::path --- diff --git a/src/ccache/ArgsInfo.hpp b/src/ccache/ArgsInfo.hpp index 84d2635c..5b231c32 100644 --- a/src/ccache/ArgsInfo.hpp +++ b/src/ccache/ArgsInfo.hpp @@ -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; diff --git a/src/ccache/argprocessing.cpp b/src/ccache/argprocessing.cpp index 9e9673cd..e2c05c7e 100644 --- a/src/ccache/argprocessing.cpp +++ b/src/ccache/argprocessing.cpp @@ -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"); } } diff --git a/src/ccache/ccache.cpp b/src/ccache/ccache.cpp index a461072d..b2fb27bf 100644 --- a/src/ccache/ccache.cpp +++ b/src/ccache/ccache.cpp @@ -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); }