diff --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h --- a/llvm/include/llvm/Demangle/ItaniumDemangle.h +++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h @@ -462,6 +462,8 @@ static_cast(Ty)->getName() == "objc_object"; } + const StringView &getProtocol() const { return Protocol; } + void printLeft(OutputStream &S) const override { Ty->print(S); S += "<"; @@ -497,7 +499,7 @@ } else { const auto *objcProto = static_cast(Pointee); s += "id<"; - s += objcProto->Protocol; + s += objcProto->getProtocol(); s += ">"; } } @@ -1199,7 +1201,7 @@ template void match(Fn F) const { F(Params); } - NodeArray getParams() { return Params; } + const NodeArray &getParams() const { return Params; } void printLeft(OutputStream &S) const override { S += "<"; @@ -2057,6 +2059,9 @@ else S << Integer; } + + // Retrieves the string view of the integer value this node represents. + const StringView &getIntegerValue() const { return Integer; } }; class IntegerLiteral : public Node { @@ -2085,6 +2090,13 @@ if (Type.size() <= 3) S += Type; } + + // Retrieves the string view of the integer value represented by this node. + const StringView &getValue() const { return Value; } + + // Retrieves the string view of the type string of the integer value this node + // represents. + const StringView &getType() const { return Type; } }; template struct FloatData;