[PATCH] D124842: [NFC][CUDA][HIP] rework mangling number for aux target
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 3 11:12:43 PDT 2022
tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.
LGTM.
================
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
----------------
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;
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124842/new/
https://reviews.llvm.org/D124842
More information about the cfe-commits
mailing list