Author: Shafik Yaghmour
Date: 2025-05-05T08:05:29-07:00
New Revision: 2df4be28f5f68cbd012d439360f3399335ea4bfb

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

LOG: [Clang][NFC] Use std::move for Detail in timeTraceMetadata (#138352)

Static analysis flagged the use of Detail because we were not using
std::move when returning values. Modified the returns to use std::move.

Added: 
    

Modified: 
    clang/lib/StaticAnalyzer/Core/CoreEngine.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp 
b/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
index 5c05c9c87f124..8ba304b3af0ca 100644
--- a/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
@@ -199,14 +199,15 @@ static llvm::TimeTraceMetadata timeTraceMetadata(const 
ExplodedNode *Pred,
   }
   auto SLoc = Loc.getSourceLocation();
   if (!SLoc)
-    return llvm::TimeTraceMetadata{Detail, ""};
+    return llvm::TimeTraceMetadata{std::move(Detail), ""};
   const auto &SM = Pred->getLocationContext()
                        ->getAnalysisDeclContext()
                        ->getASTContext()
                        .getSourceManager();
   auto Line = SM.getPresumedLineNumber(*SLoc);
   auto Fname = SM.getFilename(*SLoc);
-  return llvm::TimeTraceMetadata{Detail, Fname.str(), static_cast<int>(Line)};
+  return llvm::TimeTraceMetadata{std::move(Detail), Fname.str(),
+                                 static_cast<int>(Line)};
 }
 
 void CoreEngine::dispatchWorkItem(ExplodedNode *Pred, ProgramPoint Loc,


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to