-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[OpenMP][NFC] Use temporary instead of local to take advantage of move semantics #138582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OpenMP][NFC] Use temporary instead of local to take advantage of move semantics #138582
Conversation
…e 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/pr-subscribers-flang-openmp Author: Shafik Yaghmour (shafik) ChangesStatic analysis flagged Full diff: https://github.com/llvm/llvm-project/pull/138582.diff 1 Files Affected:
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 {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/19561 Here is the relevant piece of the build log for the reference
|
…e semantics (llvm#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.
Static analysis flagged
MapnamesName
because we could move it intocreateOffloadMapnames
. I just replaced the local with a direct call tocreatePlatformSpecificName
at the function argument location.