[PATCH] D148370: [Clang][Flang][OpenMP] Add loadOffloadInfoMetadata and createOffloadEntriesAndInfoMetadata into OMPIRBuilder's finalize and initialize

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 2 10:24:59 PDT 2023


jdoerfert added inline comments.


================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:1063
+  // Initialize Types used in OpenMPIRBuilder from OMPKinds.def as well as load
+  // offload metadata for device from an OpenMP host IR file.
+  OMPBuilder.initialize(CGM.getLangOpts().OpenMPIsDevice
----------------
Move the additional comment to the initialize function instead to explain what the argument is for.


================
Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:452
+
+  if (!HostFilePath.empty()) {
+    auto Buf = llvm::MemoryBuffer::getFile(HostFilePath);
----------------
early exit plz.


================
Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:453
+  if (!HostFilePath.empty()) {
+    auto Buf = llvm::MemoryBuffer::getFile(HostFilePath);
+    if (auto Err = Buf.getError())
----------------
No llvm::


================
Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:455
+    if (auto Err = Buf.getError())
+      assert(false && ("error opening host file from host file path inside of "
+                       "OpenMPIRBuilder" +
----------------
no assert false please. Use unreachable or report fatal error.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148370



More information about the cfe-commits mailing list