[PATCH] D134189: [CUDA][HIP] Fix new driver crashing when using -save-temps in RDC-mode

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 19 12:02:21 PDT 2022


jhuber6 marked 3 inline comments as done.
jhuber6 added inline comments.


================
Comment at: clang/lib/Driver/Action.cpp:320
+    if (OKind & Mask)
+      DeviceOffloadKinds.push_back(OKind);
+}
----------------
tra wrote:
> It would be good to clear processed bits in `Mask` and then assert that it's zero after we're done. Otherwise it would be easy to miss handling a new offload kind if/when it gets added.
I was also considering just putting something like this next to the declarations since we already do this for the new driver as well.

```
constexpr OffloadKind[] DeviceOffloadingKinds = {OFK_OpenMP, OFK_Cuda, OFK_HIP};
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134189



More information about the cfe-commits mailing list