[Openmp-commits] [PATCH] D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Sep 25 06:50:38 PDT 2019


ABataev added inline comments.


================
Comment at: clang/lib/Driver/Driver.cpp:3125
+    ActionList DeviceAL;
+    for (auto *SB : SpecializedBuilders) {
+      if (!SB->isValid())
----------------
User real type instead of `auto *`


================
Comment at: clang/lib/Driver/Driver.cpp:3434
   if (!LinkerInputs.empty()) {
+    if (auto *Wrapper = OffloadBuilder.makeHostLinkAction())
+      LinkerInputs.push_back(Wrapper);
----------------
`auto *`->real type


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6478
+
+  const auto &Triple = getToolChain().getEffectiveTriple();
+
----------------
`auto`->real type


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6490
+  // Add inputs.
+  for (const auto &I : Inputs) {
+    assert(I.isFilename() && "Invalid input.");
----------------
`auto`->real type


================
Comment at: clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp:72
+private:
+  IntegerType *getSizeTTy() {
+    switch (M.getDataLayout().getPointerTypeSize(Type::getInt8PtrTy(C))) {
----------------
Maybe better to get the size of `size_t` type from command line option rather than rely on some non-stable assumptions?


================
Comment at: clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp:203
+    ImagesInits.reserve(Bufs.size());
+    for (const ArrayRef<char> &Buf : Bufs) {
+      auto *Data = ConstantDataArray::get(C, Buf);
----------------
Just `ArrayRef<char>`, no need to make it `const ArrayRef<char> &`


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

https://reviews.llvm.org/D64943





More information about the Openmp-commits mailing list