[llvm] [BOLT][DWARF] Fix --dwarf-output-path (PR #71886)

Maksim Panchenko via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 10 10:45:47 PST 2023


================
@@ -440,6 +440,9 @@ getDWOName(llvm::DWARFUnit &CU,
   assert(!DWOName.empty() &&
          "DW_AT_dwo_name/DW_AT_GNU_dwo_name does not exists.");
   if (!opts::DwarfOutputPath.empty()) {
+    auto Pos = DWOName.rfind("/");
+    if (Pos != std::string::npos)
+      DWOName = DWOName.substr(Pos + 1);
----------------
maksfb wrote:

Can you use `sys::path::filename()`?

https://github.com/llvm/llvm-project/pull/71886


More information about the llvm-commits mailing list