tra accepted this revision.
tra added inline comments.
This revision is now accepted and ready to land.

================
Comment at: clang/lib/Driver/Driver.cpp:4396-4398
+  bool SingleDeviceOutput = !llvm::any_of(OffloadActions, [](Action *A) {
+    return A->getType() == types::TY_Nothing;
+  }) && isa<CompileJobAction>(HostAction);
----------------
jhuber6 wrote:
> tra wrote:
> > `any_of(A->getType() == types::TY_Nothing)` looks like a rather indirect 
> > way to infer that we have `-fsyntax-only`. Would there be any other 
> > legitimate case when we'd have `Ty_Nothing` actions?
> > 
> > 
> > 
> This is more or less how the existing pipeline handles it. We shouldn't 
> propagate `TY_Nothing` attributes regardless, `-fsyntax-only` just happens to 
> create them. So this is more correct I believe.
OK. Would it make sense to add a helper method with descriptive name? E.g. 
`hasValidOutput` so future readers do not have to guess what we're doing and 
why.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133161

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to