[PATCH] D18171: [CUDA][OpenMP] Create generic offload action

Samuel Antao via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 13 13:40:21 PDT 2016

sfantao added a comment.

Hi Art,

Thanks for the review! Addressed your comments in the last diff.

Thanks again,

Comment at: lib/Driver/Action.cpp:191-202
@@ +190,14 @@
+    const OffloadActionWorkTy &Work) const {
+  auto I = getInputs().begin();
+  auto E = getInputs().end();
+  if (I == E)
+    return;
+  // Skip host action
+  if (HostTC)
+    ++I;
+  auto TI = DevToolChains.begin();
+  for (; I != E; ++I, ++TI)
+    Work(*I, *TI, (*I)->getOffloadingArch());
tra wrote:
> You may want to add an assert that I and TI are both valid within the loop.
I added an assertion for `TI`. I didn't do that for `I` though, as it is the exit condition of the loop, so it will be always valid. Let me know if you still want me to add that.


More information about the cfe-commits mailing list