Skip to content

[NFC][LLVM] Apply std::move to object being pushed back in findSymbolCommon #135290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

shafik
Copy link
Collaborator

@shafik shafik commented Apr 11, 2025

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

…Common

Static analysis found that we could move LineInfo into the Result vector
instead of just copying it.
@shafik shafik changed the title [NFC][LLVM] Apply std::move to object being pushed back in findSymbol… [NFC][LLVM] Apply std::move to object being pushed back in findSymbolCommon Apr 11, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 11, 2025

@llvm/pr-subscribers-debuginfo

@llvm/pr-subscribers-llvm-binary-utilities

Author: Shafik Yaghmour (shafik)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/135290.diff

1 Files Affected:

  • (modified) llvm/lib/DebugInfo/Symbolize/Symbolize.cpp (+1-1)
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));
     }
   }
 

Copy link
Collaborator

@jh7370 jh7370 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shafik shafik merged commit eb68b91 into llvm:main Apr 11, 2025
14 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 11, 2025

LLVM Buildbot has detected a new failure on builder lldb-x86_64-debian running on lldb-x86_64-debian while building llvm at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/162/builds/20065

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
PASS: lldb-api :: tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py (120 of 2826)
PASS: lldb-api :: functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py (121 of 2826)
PASS: lldb-api :: tools/lldb-dap/server/TestDAP_server.py (122 of 2826)
PASS: lldb-api :: lang/cpp/virtual-functions/TestCppVirtualFunctions.py (123 of 2826)
PASS: lldb-api :: tools/lldb-dap/memory/TestDAP_memory.py (124 of 2826)
PASS: lldb-api :: lang/c/step-target/TestStepTarget.py (125 of 2826)
PASS: lldb-api :: tools/lldb-server/TestGdbRemote_qThreadStopInfo.py (126 of 2826)
PASS: lldb-api :: functionalities/data-formatter/data-formatter-stl/generic/unordered/TestDataFormatterGenericUnordered.py (127 of 2826)
PASS: lldb-api :: functionalities/thread/concurrent_events/TestConcurrentManyCrash.py (128 of 2826)
PASS: lldb-api :: functionalities/load_after_attach/TestLoadAfterAttach.py (129 of 2826)
FAIL: lldb-api :: functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py (130 of 2826)
******************** TEST 'lldb-api :: functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py' FAILED ********************
Script:
--
/usr/bin/python3 /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/./lib --env LLVM_INCLUDE_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/include --env LLVM_TOOLS_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/./bin --arch x86_64 --build-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex --lldb-module-cache-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/lldb --compiler /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/clang --dsymutil /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/worker/2.0.1/lldb-x86_64-debian/build/./bin --lldb-obj-root /home/worker/2.0.1/lldb-x86_64-debian/build/tools/lldb --lldb-libs-dir /home/worker/2.0.1/lldb-x86_64-debian/build/./lib -t /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/functionalities/thread/thread_specific_break_plus_condition -p TestThreadSpecificBpPlusCondition.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 21.0.0git (https://github.com/llvm/llvm-project.git revision eb68b914dd7f1926daf9cfab19b85765f2a60700)
  clang revision eb68b914dd7f1926daf9cfab19b85765f2a60700
  llvm revision eb68b914dd7f1926daf9cfab19b85765f2a60700
Skipping the following test categories: ['libc++', 'dsym', 'gmodules', 'debugserver', 'objc']

--
Command Output (stderr):
--
Change dir to: /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/functionalities/thread/thread_specific_break_plus_condition
UNSUPPORTED: LLDB (/home/worker/2.0.1/lldb-x86_64-debian/build/bin/clang-x86_64) :: test_python_dsym (TestThreadSpecificBpPlusCondition.ThreadSpecificBreakPlusConditionTestCase.test_python_dsym) (test case does not fall in any category of interest for this run) 
runCmd: settings clear -all

output: 

runCmd: settings set symbols.enable-external-lookup false

output: 

runCmd: settings set target.inherit-tcc true

output: 

runCmd: settings set target.disable-aslr false

output: 

runCmd: settings set target.detach-on-error false

output: 

bcardosolopes added a commit to bcardosolopes/llvm-project that referenced this pull request Apr 12, 2025
* origin/main:
  [mlir][vector] Prevent folding non memref-type gather into maskedload (llvm#135371)
  [mlir][SMT] remove custom forall/exists builder because of asan memory leak
  [bazel] Fix a typo (llvm#135460)
  [bazel] Add support for SMT Dialect (llvm#135454)
  [clang] ASTImporter: fix SubstNonTypeTemplateParmExpr source location (llvm#135450)
  [RISCV] Don't fold offsets into auipc if offset is larger than the reference global variable. (llvm#135297)
  [gn] port d1fd977
  [NFC][LLVM] Apply std::move to object being pushed back in findSymbolCommon (llvm#135290)
  [AMDGPU] Teach iterative schedulers about IGLP (llvm#134953)
@shafik
Copy link
Collaborator Author

shafik commented Apr 14, 2025

Failure does not look related and subsequent builds look good. So maybe a flaky test.

var-const pushed a commit to ldionne/llvm-project that referenced this pull request Apr 17, 2025
…Common (llvm#135290)

Static analysis found that we could move LineInfo into the Result vector
instead of just copying it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants