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 @@ -445,6 +445,14 @@ } }; +#ifdef _MSC_VER +// Workaround for MSVC++ bug (Version 2017, 15.8.9) - w/o this forward +// declaration, the friend declaration in ObjCProtoName below has no effect +// and leads to compilation error when ObjCProtoName::Protocol private field +// is accessed in PointerType::printLeft. +class PointerType; +#endif // _MSC_VER + class ObjCProtoName : public Node { const Node *Ty; StringView Protocol; @@ -1199,7 +1207,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 +2065,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 +2096,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;