[PATCH] D124220: [OpenMP] Add options to only compile the host or device when offloading

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 27 14:40:55 PDT 2022


tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.

LGTM with a minor nit.



================
Comment at: clang/lib/Driver/Driver.cpp:4230
+  // compile action to embed it in. If preprocessing only ignore embedding.
+  if ((!isa<CompileJobAction>(HostAction) && PL.back() != phases::Preprocess) ||
+      HostOnly)
----------------
Nit: `(!isa<CompileJobAction>(HostAction) && PL.back() != phases::Preprocess)` -> `!(isa<CompileJobAction>(HostAction) || PL.back() == phases::Preprocess)`

It's a bit easier to understand that way, IMO. We could also return early if `HostOnly` is set and make this condition simpler.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124220



More information about the cfe-commits mailing list