Skip to content

[NFC][cxxabi] Apply cp-to-llvm.sh #101970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions llvm/include/llvm/Demangle/ItaniumDemangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <type_traits>
#include <utility>

#ifdef _LIBCXXABI_COMPILER_CLANG
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-template"
#endif
Expand Down Expand Up @@ -199,8 +199,7 @@ class Node {

Prec Precedence : 6;

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

Prec getPrecedence() const { return Precedence; }
Cache getRHSComponentCache() const { return RHSComponentCache; }
Cache getArrayCache() const { return ArrayCache; }
Cache getFunctionCache() const { return FunctionCache; }

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

public:
QualType(const Node *Child_, Qualifiers Quals_)
: Node(KQualType, Child_->RHSComponentCache,
Child_->ArrayCache, Child_->FunctionCache),
: Node(KQualType, Child_->getRHSComponentCache(), Child_->getArrayCache(),
Child_->getFunctionCache()),
Quals(Quals_), Child(Child_) {}

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

AbiTagAttr(Node *Base_, std::string_view Tag_)
: Node(KAbiTagAttr, Base_->RHSComponentCache, Base_->ArrayCache,
Base_->FunctionCache),
: Node(KAbiTagAttr, Base_->getRHSComponentCache(), Base_->getArrayCache(),
Base_->getFunctionCache()),
Base(Base_), Tag(Tag_) {}

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

public:
PointerType(const Node *Pointee_)
: Node(KPointerType, Pointee_->RHSComponentCache),
: Node(KPointerType, Pointee_->getRHSComponentCache()),
Pointee(Pointee_) {}

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

public:
ReferenceType(const Node *Pointee_, ReferenceKind RK_)
: Node(KReferenceType, Pointee_->RHSComponentCache),
: Node(KReferenceType, Pointee_->getRHSComponentCache()),
Pointee(Pointee_), RK(RK_) {}

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

public:
PointerToMemberType(const Node *ClassType_, const Node *MemberType_)
: Node(KPointerToMemberType, MemberType_->RHSComponentCache),
: Node(KPointerToMemberType, MemberType_->getRHSComponentCache()),
ClassType(ClassType_), MemberType(MemberType_) {}

template<typename Fn> void match(Fn F) const { F(ClassType, MemberType); }
Expand Down Expand Up @@ -1382,16 +1384,14 @@ class ParameterPack final : public Node {
public:
ParameterPack(NodeArray Data_) : Node(KParameterPack), Data(Data_) {
ArrayCache = FunctionCache = RHSComponentCache = Cache::Unknown;
if (std::all_of(Data.begin(), Data.end(), [](Node* P) {
return P->ArrayCache == Cache::No;
}))
if (std::all_of(Data.begin(), Data.end(),
[](Node *P) { return P->getArrayCache() == Cache::No; }))
ArrayCache = Cache::No;
if (std::all_of(Data.begin(), Data.end(), [](Node* P) {
return P->FunctionCache == Cache::No;
}))
if (std::all_of(Data.begin(), Data.end(),
[](Node *P) { return P->getFunctionCache() == Cache::No; }))
FunctionCache = Cache::No;
if (std::all_of(Data.begin(), Data.end(), [](Node* P) {
return P->RHSComponentCache == Cache::No;
if (std::all_of(Data.begin(), Data.end(), [](Node *P) {
return P->getRHSComponentCache() == Cache::No;
}))
RHSComponentCache = Cache::No;
}
Expand Down Expand Up @@ -5947,7 +5947,7 @@ struct ManglingParser : AbstractManglingParser<ManglingParser<Alloc>, Alloc> {

DEMANGLE_NAMESPACE_END

#ifdef _LIBCXXABI_COMPILER_CLANG
#if defined(__clang__)
#pragma clang diagnostic pop
#endif

Expand Down
Loading