[Lldb-commits] [lldb] [lldb] Fix build after FileSpec::GetDirectory() ConstString removal (PR #207073)

Sylvestre Ledru via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 1 12:58:20 PDT 2026


https://github.com/sylvestre created https://github.com/llvm/llvm-project/pull/207073

FileSpec::GetDirectory() now returns llvm::StringRef instead of ConstString, so the .GetStringRef() call no longer compiles.

Regressed by f9b5264523b1 ("[lldb] Remove ConstString getters from FileSpec", #206802).

>From 0b99e65a6ffd4689b451e19df4b8250dd4b20fab Mon Sep 17 00:00:00 2001
From: Sylvestre Ledru <sylvestre at debian.org>
Date: Wed, 1 Jul 2026 21:57:39 +0200
Subject: [PATCH] [lldb] Fix build after FileSpec::GetDirectory() ConstString
 removal

FileSpec::GetDirectory() now returns llvm::StringRef instead of
ConstString, so the .GetStringRef() call no longer compiles.

Regressed by f9b5264523b1 ("[lldb] Remove ConstString getters from
FileSpec", #206802).
---
 lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp
index 3827750d2f489..fc0620428a7bd 100644
--- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp
+++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp
@@ -272,8 +272,7 @@ BuildModulesSection(Process &process, FileSpec directory) {
     FileSpec path_to_copy_module = directory;
     path_to_copy_module.AppendPathComponent("modules");
     path_to_copy_module.AppendPathComponent(system_path);
-    sys::fs::create_directories(
-        path_to_copy_module.GetDirectory().GetStringRef());
+    sys::fs::create_directories(path_to_copy_module.GetDirectory());
 
     if (std::error_code ec =
             llvm::sys::fs::copy_file(file, path_to_copy_module.GetPath()))



More information about the lldb-commits mailing list