[PATCH] D116840: [HIP] Fix device only linking for -fgpu-rdc
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 7 15:09:30 PST 2022
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
More information about the cfe-commits
mailing list