[PATCH] D130909: [demangler] Add getters for Qual/Vector/Pointer typesThese are useful for downstream tool aligning the mangling of data types which differ between different languages/targets.
Alexey Bader via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 1 08:33:17 PDT 2022
bader created this revision.
bader added reviewers: steffenlarsen, jcranmer-intel, urnathan.
Herald added a subscriber: ebevhan.
Herald added a project: All.
bader requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Patch by Steffen Larsen <steffen.larsen at intel.com>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D130909
Files:
llvm/include/llvm/Demangle/ItaniumDemangle.h
Index: llvm/include/llvm/Demangle/ItaniumDemangle.h
===================================================================
--- llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -369,6 +369,10 @@
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 @@
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 @@
: 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 @@
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 {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130909.449030.patch
Type: text/x-patch
Size: 1695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220801/5d7ec172/attachment.bin>
More information about the llvm-commits
mailing list