From 94eb8b3aeed6fee0cc0ad7a0c9f4fd024470ceb4 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Mon, 5 May 2025 13:39:06 -0700 Subject: [PATCH] [OpenMP][NFC] Use temporary instead of local to take advantage of move semantics Static analysis flagged MapnamesName because we could move it into createOffloadMapnames. I just replaced the local with a direct call to createPlatformSpecificName at the function argument location. --- llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp index be05f01c94603..468a4da9ac13a 100644 --- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp +++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp @@ -8397,9 +8397,8 @@ Error OpenMPIRBuilder::emitOffloadingArrays( // The information types are only built if provided. if (!CombinedInfo.Names.empty()) { - std::string MapnamesName = createPlatformSpecificName({"offload_mapnames"}); - auto *MapNamesArrayGbl = - createOffloadMapnames(CombinedInfo.Names, MapnamesName); + auto *MapNamesArrayGbl = createOffloadMapnames( + CombinedInfo.Names, createPlatformSpecificName({"offload_mapnames"})); Info.RTArgs.MapNamesArray = MapNamesArrayGbl; Info.EmitDebug = true; } else {