1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

[demangle] Special case clang's creative mangling of __uuidof expressions.

llvm-svn: 363752
This commit is contained in:
Erik Pilkington 2019-06-18 23:34:09 +00:00
parent a563756313
commit 624b96896e

View File

@ -89,6 +89,7 @@
X(InitListExpr) \
X(FoldExpr) \
X(ThrowExpr) \
X(UUIDOfExpr) \
X(BoolExpr) \
X(IntegerCastExpr) \
X(IntegerLiteral) \
@ -1873,6 +1874,21 @@ public:
}
};
// MSVC __uuidof extension, generated by clang in -fms-extensions mode.
class UUIDOfExpr : public Node {
Node *Operand;
public:
UUIDOfExpr(Node *Operand_) : Node(KUUIDOfExpr), Operand(Operand_) {}
template<typename Fn> void match(Fn F) const { F(Operand); }
void printLeft(OutputStream &S) const override {
S << "__uuidof(";
Operand->print(S);
S << ")";
}
};
class BoolExpr : public Node {
bool Value;
@ -4649,6 +4665,21 @@ Node *AbstractManglingParser<Derived, Alloc>::parseExpr() {
case '9':
return getDerived().parseUnresolvedName();
}
if (consumeIf("u8__uuidoft")) {
Node *Ty = getDerived().parseType();
if (!Ty)
return nullptr;
return make<UUIDOfExpr>(Ty);
}
if (consumeIf("u8__uuidofz")) {
Node *Ex = getDerived().parseExpr();
if (!Ex)
return nullptr;
return make<UUIDOfExpr>(Ex);
}
return nullptr;
}