Skip to content

Commit 40b5467

Browse files
[NFC] Sync the two copies of ItaniumDemangle.h. (#19254)
Given that one of the methods is duplicated with upstream LLVM, it was removed and the one user of that method switched to the version that's already upstream.
1 parent 7fef530 commit 40b5467

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

libcxxabi/src/demangle/ItaniumDemangle.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,14 @@ class EnableIfAttr : public Node {
611611
}
612612
};
613613

614+
#ifdef _MSC_VER
615+
// Workaround for MSVC++ bug (Version 2017, 15.8.9) - w/o this forward
616+
// declaration, the friend declaration in ObjCProtoName below has no effect
617+
// and leads to compilation error when ObjCProtoName::Protocol private field
618+
// is accessed in PointerType::printLeft.
619+
class PointerType;
620+
#endif // _MSC_VER
621+
614622
class ObjCProtoName : public Node {
615623
const Node *Ty;
616624
std::string_view Protocol;
@@ -1234,6 +1242,8 @@ class BinaryFPType final : public Node {
12341242

12351243
template<typename Fn> void match(Fn F) const { F(Dimension); }
12361244

1245+
const Node *getDimension() const { return Dimension; }
1246+
12371247
void printLeft(OutputBuffer &OB) const override {
12381248
OB += "_Float";
12391249
Dimension->print(OB);
@@ -1547,7 +1557,7 @@ class TemplateArgs final : public Node {
15471557

15481558
template<typename Fn> void match(Fn F) const { F(Params, Requires); }
15491559

1550-
NodeArray getParams() { return Params; }
1560+
const NodeArray &getParams() const { return Params; }
15511561

15521562
void printLeft(OutputBuffer &OB) const override {
15531563
ScopedOverride<unsigned> LT(OB.GtIsGt, 0);
@@ -2453,6 +2463,9 @@ class EnumLiteral : public Node {
24532463
else
24542464
OB << Integer;
24552465
}
2466+
2467+
// Retrieves the string view of the integer value this node represents.
2468+
const std::string_view &getIntegerValue() const { return Integer; }
24562469
};
24572470

24582471
class IntegerLiteral : public Node {
@@ -2482,6 +2495,10 @@ class IntegerLiteral : public Node {
24822495
}
24832496

24842497
std::string_view value() const { return Value; }
2498+
2499+
// Retrieves the string view of the type string of the integer value this node
2500+
// represents.
2501+
const std::string_view &getType() const { return Type; }
24852502
};
24862503

24872504
class RequiresExpr : public Node {

llvm/include/llvm/Demangle/ItaniumDemangle.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ class BinaryFPType final : public Node {
12421242

12431243
template<typename Fn> void match(Fn F) const { F(Dimension); }
12441244

1245-
const Node *getDimension() const { return Dimension; } // INTEL
1245+
const Node *getDimension() const { return Dimension; }
12461246

12471247
void printLeft(OutputBuffer &OB) const override {
12481248
OB += "_Float";
@@ -2493,10 +2493,8 @@ class IntegerLiteral : public Node {
24932493
if (Type.size() <= 3)
24942494
OB += Type;
24952495
}
2496-
std::string_view value() const { return Value; }
24972496

2498-
// Retrieves the string view of the integer value represented by this node.
2499-
const std::string_view &getValue() const { return Value; }
2497+
std::string_view value() const { return Value; }
25002498

25012499
// Retrieves the string view of the type string of the integer value this node
25022500
// represents.

llvm/lib/SYCLLowerIR/ESIMD/LowerESIMD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ static APInt parseTemplateArg(id::FunctionEncoding *FE, unsigned int N,
808808
// Overwrite Ty with IntegerLiteral's size
809809
Ty = parsePrimitiveTypeString(StringRef(&*TyStr.begin(), TyStr.size()),
810810
Ctx);
811-
Val = ValL->getValue();
811+
Val = ValL->value();
812812
break;
813813
}
814814
case id::Node::KBoolExpr: {

0 commit comments

Comments
 (0)