[Openmp-commits] [PATCH] D84797: [NFC][OpenMP] Renamed all variable and function names in `target` to conformwith LLVM code standard

Ye Luo via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 28 13:56:00 PDT 2020


ye-luo added a comment.

Should be easy to address my comments and let us get this merged ASAP.



================
Comment at: openmp/libomptarget/src/device.h:202
   /// implementations ignore \p HstPtr.
-  void *data_alloc(int64_t Size, void *HstPtr = nullptr);
+  void *dataAlloc(int64_t Size, void *HstPtr = nullptr);
   /// Deallocates memory which \p TgtPtrBegin points at and returns
----------------
"Function names should be verb phrases (as they represent actions), and command-like function should be imperative. The name should be camel case, and start with a lower case letter (e.g. openFile() or isFoo())."

Since we are anyway changing the names. Let us fix them fully.
allocData
deleteData
Please also take this chance to rename
data_retrieve
data_exchange
as well. No good reason to leave these pains.


================
Comment at: openmp/libomptarget/src/omptarget.cpp:213
 
-static int32_t member_of(int64_t type) {
+static int32_t memberOf(int64_t type) {
   return ((type & OMP_TGT_MAPTYPE_MEMBER_OF) >> 48) - 1;
----------------
isMemberOf?


================
Comment at: openmp/libomptarget/src/private.h:29
+
 extern int target_data_update(DeviceTy &Device, int32_t arg_num,
                               void **args_base, void **args,
----------------
Let us kill the pain in one shot. It is just a few more `sed`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84797



More information about the Openmp-commits mailing list