[llvm] [NFC][LLVM] Apply std::move to object being pushed back in findSymbol… (PR #135290)

Shafik Yaghmour via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 10 18:02:30 PDT 2025


https://github.com/shafik created https://github.com/llvm/llvm-project/pull/135290

…Common

Static analysis found that we could move LineInfo into the Result vector instead of just copying it.

>From f9dfcb826396fa49aac052677671c20601e87668 Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour <shafik.yaghmour at intel.com>
Date: Thu, 10 Apr 2025 17:58:27 -0700
Subject: [PATCH] [NFC][LLVM] Apply std::move to object being pushed back in
 findSymbolCommon

Static analysis found that we could move LineInfo into the Result vector
instead of just copying it.
---
 llvm/lib/DebugInfo/Symbolize/Symbolize.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
index b96f97a159243..d154f16f272bd 100644
--- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -257,7 +257,7 @@ LLVMSymbolizer::findSymbolCommon(const T &ModuleSpecifier, StringRef Symbol,
     if (LineInfo.FileName != DILineInfo::BadString) {
       if (Opts.Demangle)
         LineInfo.FunctionName = DemangleName(LineInfo.FunctionName, Info);
-      Result.push_back(LineInfo);
+      Result.push_back(std::move(LineInfo));
     }
   }
 



More information about the llvm-commits mailing list