Skip to content

Commit bfdecea

Browse files
authored
[NFC][cxxabi] Apply cp-to-llvm.sh (#101970)
1 parent e4f3735 commit bfdecea

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

llvm/include/llvm/Demangle/ItaniumDemangle.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include <type_traits>
3131
#include <utility>
3232

33-
#ifdef _LIBCXXABI_COMPILER_CLANG
33+
#if defined(__clang__)
3434
#pragma clang diagnostic push
3535
#pragma clang diagnostic ignored "-Wunused-template"
3636
#endif
@@ -199,8 +199,7 @@ class Node {
199199

200200
Prec Precedence : 6;
201201

202-
// FIXME: Make these protected.
203-
public:
202+
protected:
204203
/// Tracks if this node has a component on its right side, in which case we
205204
/// need to call printRight.
206205
Cache RHSComponentCache : 2;
@@ -254,6 +253,9 @@ class Node {
254253
Kind getKind() const { return K; }
255254

256255
Prec getPrecedence() const { return Precedence; }
256+
Cache getRHSComponentCache() const { return RHSComponentCache; }
257+
Cache getArrayCache() const { return ArrayCache; }
258+
Cache getFunctionCache() const { return FunctionCache; }
257259

258260
virtual bool hasRHSComponentSlow(OutputBuffer &) const { return false; }
259261
virtual bool hasArraySlow(OutputBuffer &) const { return false; }
@@ -423,8 +425,8 @@ class QualType final : public Node {
423425

424426
public:
425427
QualType(const Node *Child_, Qualifiers Quals_)
426-
: Node(KQualType, Child_->RHSComponentCache,
427-
Child_->ArrayCache, Child_->FunctionCache),
428+
: Node(KQualType, Child_->getRHSComponentCache(), Child_->getArrayCache(),
429+
Child_->getFunctionCache()),
428430
Quals(Quals_), Child(Child_) {}
429431

430432
Qualifiers getQuals() const { return Quals; }
@@ -553,8 +555,8 @@ struct AbiTagAttr : Node {
553555
std::string_view Tag;
554556

555557
AbiTagAttr(Node *Base_, std::string_view Tag_)
556-
: Node(KAbiTagAttr, Base_->RHSComponentCache, Base_->ArrayCache,
557-
Base_->FunctionCache),
558+
: Node(KAbiTagAttr, Base_->getRHSComponentCache(), Base_->getArrayCache(),
559+
Base_->getFunctionCache()),
558560
Base(Base_), Tag(Tag_) {}
559561

560562
template<typename Fn> void match(Fn F) const { F(Base, Tag); }
@@ -614,7 +616,7 @@ class PointerType final : public Node {
614616

615617
public:
616618
PointerType(const Node *Pointee_)
617-
: Node(KPointerType, Pointee_->RHSComponentCache),
619+
: Node(KPointerType, Pointee_->getRHSComponentCache()),
618620
Pointee(Pointee_) {}
619621

620622
const Node *getPointee() const { return Pointee; }
@@ -698,7 +700,7 @@ class ReferenceType : public Node {
698700

699701
public:
700702
ReferenceType(const Node *Pointee_, ReferenceKind RK_)
701-
: Node(KReferenceType, Pointee_->RHSComponentCache),
703+
: Node(KReferenceType, Pointee_->getRHSComponentCache()),
702704
Pointee(Pointee_), RK(RK_) {}
703705

704706
template<typename Fn> void match(Fn F) const { F(Pointee, RK); }
@@ -741,7 +743,7 @@ class PointerToMemberType final : public Node {
741743

742744
public:
743745
PointerToMemberType(const Node *ClassType_, const Node *MemberType_)
744-
: Node(KPointerToMemberType, MemberType_->RHSComponentCache),
746+
: Node(KPointerToMemberType, MemberType_->getRHSComponentCache()),
745747
ClassType(ClassType_), MemberType(MemberType_) {}
746748

747749
template<typename Fn> void match(Fn F) const { F(ClassType, MemberType); }
@@ -1382,16 +1384,14 @@ class ParameterPack final : public Node {
13821384
public:
13831385
ParameterPack(NodeArray Data_) : Node(KParameterPack), Data(Data_) {
13841386
ArrayCache = FunctionCache = RHSComponentCache = Cache::Unknown;
1385-
if (std::all_of(Data.begin(), Data.end(), [](Node* P) {
1386-
return P->ArrayCache == Cache::No;
1387-
}))
1387+
if (std::all_of(Data.begin(), Data.end(),
1388+
[](Node *P) { return P->getArrayCache() == Cache::No; }))
13881389
ArrayCache = Cache::No;
1389-
if (std::all_of(Data.begin(), Data.end(), [](Node* P) {
1390-
return P->FunctionCache == Cache::No;
1391-
}))
1390+
if (std::all_of(Data.begin(), Data.end(),
1391+
[](Node *P) { return P->getFunctionCache() == Cache::No; }))
13921392
FunctionCache = Cache::No;
1393-
if (std::all_of(Data.begin(), Data.end(), [](Node* P) {
1394-
return P->RHSComponentCache == Cache::No;
1393+
if (std::all_of(Data.begin(), Data.end(), [](Node *P) {
1394+
return P->getRHSComponentCache() == Cache::No;
13951395
}))
13961396
RHSComponentCache = Cache::No;
13971397
}
@@ -5947,7 +5947,7 @@ struct ManglingParser : AbstractManglingParser<ManglingParser<Alloc>, Alloc> {
59475947

59485948
DEMANGLE_NAMESPACE_END
59495949

5950-
#ifdef _LIBCXXABI_COMPILER_CLANG
5950+
#if defined(__clang__)
59515951
#pragma clang diagnostic pop
59525952
#endif
59535953

0 commit comments

Comments
 (0)