[llvm] 4ea4d9c - Move FunctionInfo in addFunctionInfo rather than copying.

Simon Giesecke via llvm-commits llvm-commits at lists.llvm.org
Wed May 19 03:33:02 PDT 2021


Author: Simon Giesecke
Date: 2021-05-19T10:06:47Z
New Revision: 4ea4d9c066b6e6f24756538d3d366d559499be3d

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

LOG: Move FunctionInfo in addFunctionInfo rather than copying.

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

Added: 
    

Modified: 
    llvm/lib/DebugInfo/GSYM/GsymCreator.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp b/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
index 5c9c13883fb3..4e8a20b6a66a 100644
--- a/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
+++ b/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
@@ -314,7 +314,7 @@ uint32_t GsymCreator::insertString(StringRef S, bool Copy) {
 void GsymCreator::addFunctionInfo(FunctionInfo &&FI) {
   std::lock_guard<std::recursive_mutex> Guard(Mutex);
   Ranges.insert(FI.Range);
-  Funcs.emplace_back(FI);
+  Funcs.emplace_back(std::move(FI));
 }
 
 void GsymCreator::forEachFunctionInfo(


        


More information about the llvm-commits mailing list