Skip to content

Commit c956ed0

Browse files
authored
[OpenMP][NFC] Use temporary instead of local to take advantage of move semantics (#138582)
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.
1 parent 8b41551 commit c956ed0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8378,9 +8378,8 @@ Error OpenMPIRBuilder::emitOffloadingArrays(
83788378

83798379
// The information types are only built if provided.
83808380
if (!CombinedInfo.Names.empty()) {
8381-
std::string MapnamesName = createPlatformSpecificName({"offload_mapnames"});
8382-
auto *MapNamesArrayGbl =
8383-
createOffloadMapnames(CombinedInfo.Names, MapnamesName);
8381+
auto *MapNamesArrayGbl = createOffloadMapnames(
8382+
CombinedInfo.Names, createPlatformSpecificName({"offload_mapnames"}));
83848383
Info.RTArgs.MapNamesArray = MapNamesArrayGbl;
83858384
Info.EmitDebug = true;
83868385
} else {

0 commit comments

Comments
 (0)