[Lldb-commits] [lldb] 8e757c6 - Fix conversion error to Expected

Thomas Preud'homme via lldb-commits lldb-commits at lists.llvm.org
Wed May 25 12:51:19 PDT 2022


Author: Thomas Preud'homme
Date: 2022-05-25T20:51:14+01:00
New Revision: 8e757c6b500dc18f0cc5a7c027682ac2aacf8eb0

URL: https://github.com/llvm/llvm-project/commit/8e757c6b500dc18f0cc5a7c027682ac2aacf8eb0
DIFF: https://github.com/llvm/llvm-project/commit/8e757c6b500dc18f0cc5a7c027682ac2aacf8eb0.diff

LOG: Fix conversion error to Expected

On Ubuntu 18.04 with GCC 7.5 Intel trace code fails to build due to
failure to convert from
lldb_private::process_linux::IntelPTPerThreadProcessTraceUP to
Expected<lldb_private::process_linux::IntelPTPerThreadProcessTraceUP>.
This commit explicitely marks those unique_ptr values as being moved
which fixes the conversion error.

Reviewed By: wallace

Differential Revision: https://reviews.llvm.org/D126402

Added: 
    

Modified: 
    lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp
    lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp b/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp
index 9abfc190bf68..154e1d9b0ad1 100644
--- a/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp
+++ b/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp
@@ -78,7 +78,7 @@ IntelPTPerThreadProcessTrace::Start(const TraceIntelPTStartRequest &request,
     error = joinErrors(std::move(error), trace->TraceStart(tid));
   if (error)
     return std::move(error);
-  return trace;
+  return std::move(trace);
 }
 
 Error IntelPTCollector::TraceStart(const TraceIntelPTStartRequest &request) {

diff  --git a/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp b/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
index 9b10919839b5..047ce471149f 100644
--- a/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
+++ b/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
@@ -318,7 +318,7 @@ Expected<IntelPTSingleBufferTraceUP> IntelPTSingleBufferTrace::Start(
     }
     IntelPTSingleBufferTraceUP trace_up(
         new IntelPTSingleBufferTrace(std::move(*perf_event), initial_state));
-    return trace_up;
+    return std::move(trace_up);
   } else {
     return perf_event.takeError();
   }


        


More information about the lldb-commits mailing list