|
30 | 30 | #include <type_traits>
|
31 | 31 | #include <utility>
|
32 | 32 |
|
33 |
| -#ifdef _LIBCXXABI_COMPILER_CLANG |
| 33 | +#if defined(__clang__) |
34 | 34 | #pragma clang diagnostic push
|
35 | 35 | #pragma clang diagnostic ignored "-Wunused-template"
|
36 | 36 | #endif
|
@@ -199,8 +199,7 @@ class Node {
|
199 | 199 |
|
200 | 200 | Prec Precedence : 6;
|
201 | 201 |
|
202 |
| - // FIXME: Make these protected. |
203 |
| -public: |
| 202 | +protected: |
204 | 203 | /// Tracks if this node has a component on its right side, in which case we
|
205 | 204 | /// need to call printRight.
|
206 | 205 | Cache RHSComponentCache : 2;
|
@@ -254,6 +253,9 @@ class Node {
|
254 | 253 | Kind getKind() const { return K; }
|
255 | 254 |
|
256 | 255 | Prec getPrecedence() const { return Precedence; }
|
| 256 | + Cache getRHSComponentCache() const { return RHSComponentCache; } |
| 257 | + Cache getArrayCache() const { return ArrayCache; } |
| 258 | + Cache getFunctionCache() const { return FunctionCache; } |
257 | 259 |
|
258 | 260 | virtual bool hasRHSComponentSlow(OutputBuffer &) const { return false; }
|
259 | 261 | virtual bool hasArraySlow(OutputBuffer &) const { return false; }
|
@@ -423,8 +425,8 @@ class QualType final : public Node {
|
423 | 425 |
|
424 | 426 | public:
|
425 | 427 | 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()), |
428 | 430 | Quals(Quals_), Child(Child_) {}
|
429 | 431 |
|
430 | 432 | Qualifiers getQuals() const { return Quals; }
|
@@ -553,8 +555,8 @@ struct AbiTagAttr : Node {
|
553 | 555 | std::string_view Tag;
|
554 | 556 |
|
555 | 557 | 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()), |
558 | 560 | Base(Base_), Tag(Tag_) {}
|
559 | 561 |
|
560 | 562 | template<typename Fn> void match(Fn F) const { F(Base, Tag); }
|
@@ -614,7 +616,7 @@ class PointerType final : public Node {
|
614 | 616 |
|
615 | 617 | public:
|
616 | 618 | PointerType(const Node *Pointee_)
|
617 |
| - : Node(KPointerType, Pointee_->RHSComponentCache), |
| 619 | + : Node(KPointerType, Pointee_->getRHSComponentCache()), |
618 | 620 | Pointee(Pointee_) {}
|
619 | 621 |
|
620 | 622 | const Node *getPointee() const { return Pointee; }
|
@@ -698,7 +700,7 @@ class ReferenceType : public Node {
|
698 | 700 |
|
699 | 701 | public:
|
700 | 702 | ReferenceType(const Node *Pointee_, ReferenceKind RK_)
|
701 |
| - : Node(KReferenceType, Pointee_->RHSComponentCache), |
| 703 | + : Node(KReferenceType, Pointee_->getRHSComponentCache()), |
702 | 704 | Pointee(Pointee_), RK(RK_) {}
|
703 | 705 |
|
704 | 706 | template<typename Fn> void match(Fn F) const { F(Pointee, RK); }
|
@@ -741,7 +743,7 @@ class PointerToMemberType final : public Node {
|
741 | 743 |
|
742 | 744 | public:
|
743 | 745 | PointerToMemberType(const Node *ClassType_, const Node *MemberType_)
|
744 |
| - : Node(KPointerToMemberType, MemberType_->RHSComponentCache), |
| 746 | + : Node(KPointerToMemberType, MemberType_->getRHSComponentCache()), |
745 | 747 | ClassType(ClassType_), MemberType(MemberType_) {}
|
746 | 748 |
|
747 | 749 | template<typename Fn> void match(Fn F) const { F(ClassType, MemberType); }
|
@@ -1382,16 +1384,14 @@ class ParameterPack final : public Node {
|
1382 | 1384 | public:
|
1383 | 1385 | ParameterPack(NodeArray Data_) : Node(KParameterPack), Data(Data_) {
|
1384 | 1386 | 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; })) |
1388 | 1389 | 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; })) |
1392 | 1392 | 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; |
1395 | 1395 | }))
|
1396 | 1396 | RHSComponentCache = Cache::No;
|
1397 | 1397 | }
|
@@ -5947,7 +5947,7 @@ struct ManglingParser : AbstractManglingParser<ManglingParser<Alloc>, Alloc> {
|
5947 | 5947 |
|
5948 | 5948 | DEMANGLE_NAMESPACE_END
|
5949 | 5949 |
|
5950 |
| -#ifdef _LIBCXXABI_COMPILER_CLANG |
| 5950 | +#if defined(__clang__) |
5951 | 5951 | #pragma clang diagnostic pop
|
5952 | 5952 | #endif
|
5953 | 5953 |
|
|
0 commit comments