Skip to content

Commit

Permalink
[OpenMP] Fix build warnings
Browse files Browse the repository at this point in the history
```
llvm-project/openmp/libomptarget/src/private.h:260:9: warning: 'DEBUG_PREFIX' macro redefined [-Wmacro-redefined]
#define DEBUG_PREFIX GETNAME(TARGET_NAME)
        ^
llvm-project/openmp/libomptarget/include/ompt_device_callbacks.h:22:9: note: previous definition is here
#define DEBUG_PREFIX "OMPT"
        ^
1 warning generated.
```

```
llvm-project/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp:458:14: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
      return std::move(Err);
             ^
llvm-project/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp:458:14: note: remove std::move call here
      return std::move(Err);
             ^~~~~~~~~~   ~
llvm-project/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp:552:12: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
    return std::move(Err);
           ^
llvm-project/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp:552:12: note: remove std::move call here
    return std::move(Err);
           ^~~~~~~~~~   ~
2 warnings generated.
```

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D154787
  • Loading branch information
Shao-Ce SUN committed Jul 9, 2023
1 parent 5191214 commit 0484237
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ Error GenericDeviceTy::deinit() {

if (RPCHandle)
if (auto Err = RPCHandle->deinitDevice())
return std::move(Err);
return Err;

return deinitImpl();
}
Expand Down Expand Up @@ -549,7 +549,7 @@ Error GenericDeviceTy::setupRPCServer(GenericPluginTy &Plugin,
return Plugin::success();

if (auto Err = Server.initDevice(*this, Plugin.getGlobalHandler(), Image))
return std::move(Err);
return Err;

auto DeviceOrErr = Server.getDevice(*this);
if (!DeviceOrErr)
Expand Down
2 changes: 2 additions & 0 deletions openmp/libomptarget/src/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ struct TargetMemcpyArgsTy {
#endif

#define TARGET_NAME Libomptarget
#ifndef DEBUG_PREFIX
#define DEBUG_PREFIX GETNAME(TARGET_NAME)
#endif

////////////////////////////////////////////////////////////////////////////////
/// dump a table of all the host-target pointer pairs on failure
Expand Down

0 comments on commit 0484237

Please sign in to comment.