[Openmp-commits] [PATCH] D109277: [OpenMP][libomptarget] Change internal return status to enum type

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Sep 5 15:24:48 PDT 2021


tianshilei1992 added inline comments.


================
Comment at: openmp/libomptarget/include/omptarget.h:29
+/// return error status
+enum __tgt_error : int32_t {
+  OFFLOAD_SUCCESS = 0,
----------------
grokos wrote:
> tianshilei1992 wrote:
> > What about `enum tgt_return_value : uint32_t`, and set `OFFLOAD_FAIL = ~0U`?
> `uint32_t` may sound nicer, but keep in mind that these values are used as return values for `__tgt_target_*` (clang/libomptarget) and `__tgt_rtl_*` (libomptarget/plugins) functions, whose signatures indicate that they should return `int` - not even `int32_t`. In this context, I think it's better to change the enum type to pure `int`.
Oh, you are right!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109277/new/

https://reviews.llvm.org/D109277



More information about the Openmp-commits mailing list