[PATCH] D124842: [NFC][CUDA][HIP] rework mangling number for aux target

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 4 08:27:36 PDT 2022


yaxunl marked an inline comment as done.
yaxunl added inline comments.


================
Comment at: clang/lib/AST/ASTContext.cpp:11770-11778
+  if (!LangOpts.CUDA || LangOpts.CUDAIsDevice) {
+    assert(!ForAuxTarget && "Only CUDA/HIP host compilation supports mangling "
+                            "number for aux target");
     return Res;
+  }
 
   // CUDA/HIP host compilation encodes host and device mangling numbers
----------------
tra wrote:
> Nit: I'd rephrase it as :
> ```
> if (LangOpts.CUDA && !LangOpts.CUDAIsDevice) {
>     Res = ForAuxTarget ? Res >> 16 : Res & 0xFFFF; 
> } else {
>     assert(!ForAuxTarget && "Only CUDA/HIP host compilation supports mangling number for aux target");
> }
> return Res > 1 ? Res : 1;
> ```
will do when committing.


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

https://reviews.llvm.org/D124842



More information about the cfe-commits mailing list