tra added inline comments.

================
Comment at: clang/lib/Driver/Driver.cpp:3173
+                  AssociatedOffloadKind);
+        AL.clear();
+        // Offload the host object to the host linker.
----------------
Doing `clear()` in a function intended to append looks suspicious.  
We may potentially discard whatever was in AL on entry to the function, plus 
whatever has been added per `DeviceLinkerInputs`. 

I wonder if a better API would be to return a new action list, instead of 
modifying one. 

At the very least I'd like to see a comment explaining what's going on here 
and, maybe, some assertions (e.g. if we expect AL to be empty on entry).


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

https://reviews.llvm.org/D116840

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

Reply via email to