CUDA/HIP needs to mangle for aux target. When mangling for aux target,
the mangler should use mangling number for aux target. Previously
in https://reviews.llvm.org/D122734 a state was introduced in
ASTContext to let the mangler get mangling number for aux target
from ASTContext. This patch removes that state from ASTConext
and add an IsAux member to MangleContext to indicate that
the mangle context is for aux target. This reflects the reality that
the mangle context is created for mangling aux target and makes
ASTContext cleaner.
Details
Details
- Reviewers
tra rnk - Commits
- rG62501bc45a2f: [NFC][CUDA][HIP] rework mangling number for aux target
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM.
clang/lib/AST/ASTContext.cpp | ||
---|---|---|
11770–11778 | 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; |
clang/lib/AST/ASTContext.cpp | ||
---|---|---|
11770–11778 | will do when committing. |
Nit: I'd rephrase it as :