[NFC][CUDA][HIP] rework mangling number for aux target
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Tue, 3 May 2022 11:48:37 +0000 (07:48 -0400)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Wed, 4 May 2022 17:05:33 +0000 (13:05 -0400)
commit62501bc45a2fb4980725baccf48576cf9b45cd4d
tree3ea24bc0602b52fa24d995b5ff14bb007c5eb56a
parent1cd13e6e9851b8c933603f6bd0236690b4f0df90
[NFC][CUDA][HIP] rework mangling number for aux target

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.

Reviewed by: Artem Belevich, Reid Kleckner

Differential Revision: https://reviews.llvm.org/D124842
clang/include/clang/AST/ASTContext.h
clang/include/clang/AST/Mangle.h
clang/lib/AST/ASTContext.cpp
clang/lib/AST/ItaniumMangle.cpp
clang/lib/AST/MicrosoftMangle.cpp
clang/lib/CodeGen/CGCUDANV.cpp