[PATCH] D68746: [Clang][OpenMP Offload] Move offload registration code to the wrapper

Sergey Dmitriev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 10 14:34:14 PDT 2019


sdmitriev added inline comments.


================
Comment at: clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp:74
+  IntegerType *getSizeTTy() {
+    switch (M.getDataLayout().getPointerTypeSize(Type::getInt8PtrTy(C))) {
+    case 4u:
----------------
ABataev wrote:
> Same question as before: maybe better to make the size of size_t type a parameter of a tool?
As I remember you also had another suggestion - change size_t to intptr_t. That will eliminate the need to an additional parameter for size type. Will it be better?


================
Comment at: clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp:204
+    ImagesInits.reserve(Bufs.size());
+    for (const ArrayRef<char> &Buf : Bufs) {
+      auto *Data = ConstantDataArray::get(C, Buf);
----------------
ABataev wrote:
> No need for `const` and `&` here.
Right.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68746





More information about the cfe-commits mailing list