llvm.org GIT mirror llvm / 51e6c1d
[demangle] Special case clang's creative mangling of __uuidof expressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363752 91177308-0d34-0410-b5e6-96231b3b80d8 Erik Pilkington 30 days ago
1 changed file(s) with 31 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
8888 X(InitListExpr) \
8989 X(FoldExpr) \
9090 X(ThrowExpr) \
91 X(UUIDOfExpr) \
9192 X(BoolExpr) \
9293 X(IntegerCastExpr) \
9394 X(IntegerLiteral) \
18691870 void printLeft(OutputStream &S) const override {
18701871 S += "throw ";
18711872 Op->print(S);
1873 }
1874 };
1875
1876 // MSVC __uuidof extension, generated by clang in -fms-extensions mode.
1877 class UUIDOfExpr : public Node {
1878 Node *Operand;
1879 public:
1880 UUIDOfExpr(Node *Operand_) : Node(KUUIDOfExpr), Operand(Operand_) {}
1881
1882 template void match(Fn F) const { F(Operand); }
1883
1884 void printLeft(OutputStream &S) const override {
1885 S << "__uuidof(";
1886 Operand->print(S);
1887 S << ")";
18721888 }
18731889 };
18741890
46484664 case '9':
46494665 return getDerived().parseUnresolvedName();
46504666 }
4667
4668 if (consumeIf("u8__uuidoft")) {
4669 Node *Ty = getDerived().parseType();
4670 if (!Ty)
4671 return nullptr;
4672 return make(Ty);
4673 }
4674
4675 if (consumeIf("u8__uuidofz")) {
4676 Node *Ex = getDerived().parseExpr();
4677 if (!Ex)
4678 return nullptr;
4679 return make(Ex);
4680 }
4681
46514682 return nullptr;
46524683 }
46534684