Skip to content

Commit 72df836

Browse files
committed
[NFC][cxxabi] Apply cp-to-llvm.sh
1 parent 04f6504 commit 72df836

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

llvm/include/llvm/Demangle/ItaniumDemangle.h

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "DemangleConfig.h"
2020
#include "StringViewExtras.h"
2121
#include "Utility.h"
22+
#include <__cxxabi_config.h>
2223
#include <algorithm>
2324
#include <cctype>
2425
#include <cstdio>
@@ -199,8 +200,7 @@ class Node {
199200

200201
Prec Precedence : 6;
201202

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

256256
Prec getPrecedence() const { return Precedence; }
257+
Cache getRHSComponentCache() const { return RHSComponentCache; }
258+
Cache getArrayCache() const { return ArrayCache; }
259+
Cache getFunctionCache() const { return FunctionCache; }
257260

258261
virtual bool hasRHSComponentSlow(OutputBuffer &) const { return false; }
259262
virtual bool hasArraySlow(OutputBuffer &) const { return false; }
@@ -423,8 +426,8 @@ class QualType final : public Node {
423426

424427
public:
425428
QualType(const Node *Child_, Qualifiers Quals_)
426-
: Node(KQualType, Child_->RHSComponentCache,
427-
Child_->ArrayCache, Child_->FunctionCache),
429+
: Node(KQualType, Child_->getRHSComponentCache(), Child_->getArrayCache(),
430+
Child_->getFunctionCache()),
428431
Quals(Quals_), Child(Child_) {}
429432

430433
Qualifiers getQuals() const { return Quals; }
@@ -553,8 +556,8 @@ struct AbiTagAttr : Node {
553556
std::string_view Tag;
554557

555558
AbiTagAttr(Node *Base_, std::string_view Tag_)
556-
: Node(KAbiTagAttr, Base_->RHSComponentCache, Base_->ArrayCache,
557-
Base_->FunctionCache),
559+
: Node(KAbiTagAttr, Base_->getRHSComponentCache(), Base_->getArrayCache(),
560+
Base_->getFunctionCache()),
558561
Base(Base_), Tag(Tag_) {}
559562

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

615618
public:
616619
PointerType(const Node *Pointee_)
617-
: Node(KPointerType, Pointee_->RHSComponentCache),
620+
: Node(KPointerType, Pointee_->getRHSComponentCache()),
618621
Pointee(Pointee_) {}
619622

620623
const Node *getPointee() const { return Pointee; }
@@ -698,7 +701,7 @@ class ReferenceType : public Node {
698701

699702
public:
700703
ReferenceType(const Node *Pointee_, ReferenceKind RK_)
701-
: Node(KReferenceType, Pointee_->RHSComponentCache),
704+
: Node(KReferenceType, Pointee_->getRHSComponentCache()),
702705
Pointee(Pointee_), RK(RK_) {}
703706

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

742745
public:
743746
PointerToMemberType(const Node *ClassType_, const Node *MemberType_)
744-
: Node(KPointerToMemberType, MemberType_->RHSComponentCache),
747+
: Node(KPointerToMemberType, MemberType_->getRHSComponentCache()),
745748
ClassType(ClassType_), MemberType(MemberType_) {}
746749

747750
template<typename Fn> void match(Fn F) const { F(ClassType, MemberType); }
@@ -1382,16 +1385,14 @@ class ParameterPack final : public Node {
13821385
public:
13831386
ParameterPack(NodeArray Data_) : Node(KParameterPack), Data(Data_) {
13841387
ArrayCache = FunctionCache = RHSComponentCache = Cache::Unknown;
1385-
if (std::all_of(Data.begin(), Data.end(), [](Node* P) {
1386-
return P->ArrayCache == Cache::No;
1387-
}))
1388+
if (std::all_of(Data.begin(), Data.end(),
1389+
[](Node *P) { return P->getArrayCache() == Cache::No; }))
13881390
ArrayCache = Cache::No;
1389-
if (std::all_of(Data.begin(), Data.end(), [](Node* P) {
1390-
return P->FunctionCache == Cache::No;
1391-
}))
1391+
if (std::all_of(Data.begin(), Data.end(),
1392+
[](Node *P) { return P->getFunctionCache() == Cache::No; }))
13921393
FunctionCache = Cache::No;
1393-
if (std::all_of(Data.begin(), Data.end(), [](Node* P) {
1394-
return P->RHSComponentCache == Cache::No;
1394+
if (std::all_of(Data.begin(), Data.end(), [](Node *P) {
1395+
return P->getRHSComponentCache() == Cache::No;
13951396
}))
13961397
RHSComponentCache = Cache::No;
13971398
}

0 commit comments

Comments
 (0)