File tree Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -1766,6 +1766,8 @@ class CtorDtorName final : public Node {
1766
1766
1767
1767
template <typename Fn> void match (Fn F) const { F (Basename, IsDtor, Variant); }
1768
1768
1769
+ int getVariant () const { return Variant; }
1770
+
1769
1771
void printLeft (OutputBuffer &OB) const override {
1770
1772
if (IsDtor)
1771
1773
OB += " ~" ;
Original file line number Diff line number Diff line change @@ -127,6 +127,9 @@ struct ItaniumPartialDemangler {
127
127
// / If this symbol describes a constructor or destructor.
128
128
DEMANGLE_ABI bool isCtorOrDtor () const ;
129
129
130
+ // / If this symbol describes a constructor or destructor.
131
+ std::optional<int > getCtorOrDtorVariant () const ;
132
+
130
133
// / If this symbol describes a function.
131
134
DEMANGLE_ABI bool isFunction () const ;
132
135
Original file line number Diff line number Diff line change @@ -1766,6 +1766,8 @@ class CtorDtorName final : public Node {
1766
1766
1767
1767
template <typename Fn> void match (Fn F) const { F (Basename, IsDtor, Variant); }
1768
1768
1769
+ int getVariant () const { return Variant; }
1770
+
1769
1771
void printLeft (OutputBuffer &OB) const override {
1770
1772
if (IsDtor)
1771
1773
OB += " ~" ;
Original file line number Diff line number Diff line change @@ -560,13 +560,17 @@ bool ItaniumPartialDemangler::hasFunctionQualifiers() const {
560
560
}
561
561
562
562
bool ItaniumPartialDemangler::isCtorOrDtor () const {
563
+ return getCtorOrDtorVariant ().has_value ();
564
+ }
565
+
566
+ std::optional<int > ItaniumPartialDemangler::getCtorOrDtorVariant () const {
563
567
const Node *N = static_cast <const Node *>(RootNode);
564
568
while (N) {
565
569
switch (N->getKind ()) {
566
570
default :
567
- return false ;
571
+ return std::nullopt ;
568
572
case Node::KCtorDtorName:
569
- return true ;
573
+ return static_cast < const CtorDtorName *>(N)-> getVariant () ;
570
574
571
575
case Node::KAbiTagAttr:
572
576
N = static_cast <const AbiTagAttr *>(N)->Base ;
@@ -588,7 +592,7 @@ bool ItaniumPartialDemangler::isCtorOrDtor() const {
588
592
break ;
589
593
}
590
594
}
591
- return false ;
595
+ return std::nullopt ;
592
596
}
593
597
594
598
bool ItaniumPartialDemangler::isFunction () const {
You can’t perform that action at this time.
0 commit comments