aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Bader <alexey.bader@intel.com>2022-08-01 08:06:38 -0700
committerAlexey Bader <alexey.bader@intel.com>2022-08-07 02:10:05 -0700
commitf0f1bcadc74fa5cd11a118673340ca3e9a8c0037 (patch)
tree82cd26d2a4bfe6ea8d625d4216783607e88df583
parentfdc950958ed0970159071cc4367a66149971586f (diff)
[demangler] Add getters for Qual/Vector/Pointer types
These are useful for downstream tool aligning the mangling of data types which differ between different languages/targets. Patch by Steffen Larsen <steffen.larsen@intel.com> Differential Revision: https://reviews.llvm.org/D130909
-rw-r--r--llvm/include/llvm/Demangle/ItaniumDemangle.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h
index 6d4f6222af44..796e979f445c 100644
--- a/llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -369,6 +369,10 @@ public:
VendorExtQualType(const Node *Ty_, StringView Ext_, const Node *TA_)
: Node(KVendorExtQualType), Ty(Ty_), Ext(Ext_), TA(TA_) {}
+ const Node *getTy() const { return Ty; }
+ StringView getExt() const { return Ext; }
+ const Node *getTA() const { return TA; }
+
template <typename Fn> void match(Fn F) const { F(Ty, Ext, TA); }
void printLeft(OutputBuffer &OB) const override {
@@ -417,6 +421,9 @@ public:
Child_->ArrayCache, Child_->FunctionCache),
Quals(Quals_), Child(Child_) {}
+ Qualifiers getQuals() const { return Quals; }
+ const Node *getChild() const { return Child; }
+
template<typename Fn> void match(Fn F) const { F(Child, Quals); }
bool hasRHSComponentSlow(OutputBuffer &OB) const override {
@@ -585,6 +592,8 @@ public:
: Node(KPointerType, Pointee_->RHSComponentCache),
Pointee(Pointee_) {}
+ const Node *getPointee() const { return Pointee; }
+
template<typename Fn> void match(Fn F) const { F(Pointee); }
bool hasRHSComponentSlow(OutputBuffer &OB) const override {
@@ -1070,6 +1079,9 @@ public:
VectorType(const Node *BaseType_, const Node *Dimension_)
: Node(KVectorType), BaseType(BaseType_), Dimension(Dimension_) {}
+ const Node *getBaseType() const { return BaseType; }
+ const Node *getDimension() const { return Dimension; }
+
template<typename Fn> void match(Fn F) const { F(BaseType, Dimension); }
void printLeft(OutputBuffer &OB) const override {