Move FunctionInfo in addFunctionInfo rather than copying.
authorSimon Giesecke <simon.giesecke@snowflake.com>
Fri, 14 May 2021 11:06:39 +0000 (11:06 +0000)
committerSimon Giesecke <simon.giesecke@snowflake.com>
Wed, 19 May 2021 10:06:47 +0000 (10:06 +0000)
Differential Revision: https://reviews.llvm.org/D102485

llvm/lib/DebugInfo/GSYM/GsymCreator.cpp

index 5c9c138..4e8a20b 100644 (file)
@@ -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(