diff options
author | Nathan Sidwell <nathan@acm.org> | 2022-03-29 16:19:18 +0300 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2022-04-01 15:19:34 +0300 |
commit | abffdd88767791ef6da4d2df7ec7ab158eb8b775 (patch) | |
tree | 47f14298cf9655e95081312c24ec955ef7db0559 /libcxxabi/src/demangle | |
parent | de70ff10e4f6f216212016097771bad46dd5b3cc (diff) |
[demangler] Fix node matchers
* Add instantiation tests to ItaniumDemangleTest, to make sure all
match functions provide constructor arguments to the provided functor.
* Fix the Node constructors that lost const qualification on arguments.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D122665
Diffstat (limited to 'libcxxabi/src/demangle')
-rw-r--r-- | libcxxabi/src/demangle/ItaniumDemangle.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libcxxabi/src/demangle/ItaniumDemangle.h b/libcxxabi/src/demangle/ItaniumDemangle.h index 4fc21817ee25..46b390bcd996 100644 --- a/libcxxabi/src/demangle/ItaniumDemangle.h +++ b/libcxxabi/src/demangle/ItaniumDemangle.h @@ -457,7 +457,7 @@ class PostfixQualifiedType final : public Node { const StringView Postfix; public: - PostfixQualifiedType(Node *Ty_, StringView Postfix_) + PostfixQualifiedType(const Node *Ty_, StringView Postfix_) : Node(KPostfixQualifiedType), Ty(Ty_), Postfix(Postfix_) {} template<typename Fn> void match(Fn F) const { F(Ty, Postfix); } @@ -1047,9 +1047,8 @@ class VectorType final : public Node { const Node *Dimension; public: - VectorType(const Node *BaseType_, Node *Dimension_) - : Node(KVectorType), BaseType(BaseType_), - Dimension(Dimension_) {} + VectorType(const Node *BaseType_, const Node *Dimension_) + : Node(KVectorType), BaseType(BaseType_), Dimension(Dimension_) {} template<typename Fn> void match(Fn F) const { F(BaseType, Dimension); } @@ -1846,7 +1845,8 @@ class EnclosingExpr : public Node { const StringView Postfix; public: - EnclosingExpr(StringView Prefix_, Node *Infix_, Prec Prec_ = Prec::Primary) + EnclosingExpr(StringView Prefix_, const Node *Infix_, + Prec Prec_ = Prec::Primary) : Node(KEnclosingExpr, Prec_), Prefix(Prefix_), Infix(Infix_) {} template <typename Fn> void match(Fn F) const { |