[Lldb-commits] [lldb] de20436 - [lldb] Consume the located result by rvalue reference (NFC) (#217667)

via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 20 08:55:46 PDT 2026


Author: Jonas Devlieghere
Date: 2026-08-20T15:55:41Z
New Revision: de2043643c2ad34e99fd75718f368b53123376df

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

LOG: [lldb] Consume the located result by rvalue reference (NFC) (#217667)

FinishSearch consumes the Expected it is handed, either taking the error
out of it or moving what the search found into the binary spec, and its
caller already hands over ownership with an explicit move. Taking it by
value move constructs 1.5 kB for nothing, where the signature can say
the same thing and copy nothing.

Reported by Coverity (CID 1685297).

Assisted-by: Claude

Added: 
    

Modified: 
    lldb/source/Core/DynamicLoader.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Core/DynamicLoader.cpp b/lldb/source/Core/DynamicLoader.cpp
index 9420c5fd27def..7eaf329766c2a 100644
--- a/lldb/source/Core/DynamicLoader.cpp
+++ b/lldb/source/Core/DynamicLoader.cpp
@@ -278,7 +278,7 @@ PrepareSearch(Target &target, DynamicLoader::BinarySpec &bin_spec) {
 
 /// The module is not registered with the Target until LoadBinaryInTarget.
 static void FinishSearch(DynamicLoader::BinarySpec &bin_spec,
-                         llvm::Expected<SymbolLocator::Result> located) {
+                         llvm::Expected<SymbolLocator::Result> &&located) {
   if (!located) {
     // Loading a binary that was never found already reports that, so a bare
     // not-found error would only say it a second time. Any other error says


        


More information about the lldb-commits mailing list