@@ -778,6 +778,8 @@ class CXXStdInitializerListExpr : public Expr {
778
778
// /
779
779
// / This represents code like \c typeid(int) or \c typeid(*objPtr)
780
780
class CXXTypeidExpr : public Expr {
781
+ friend class ASTStmtReader ;
782
+
781
783
private:
782
784
llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
783
785
SourceRange Range;
@@ -818,22 +820,11 @@ class CXXTypeidExpr : public Expr {
818
820
assert (isTypeOperand () && " Cannot call getTypeOperand for typeid(expr)" );
819
821
return Operand.get <TypeSourceInfo *>();
820
822
}
821
-
822
- void setTypeOperandSourceInfo (TypeSourceInfo *TSI) {
823
- assert (isTypeOperand () && " Cannot call getTypeOperand for typeid(expr)" );
824
- Operand = TSI;
825
- }
826
-
827
823
Expr *getExprOperand () const {
828
824
assert (!isTypeOperand () && " Cannot call getExprOperand for typeid(type)" );
829
825
return static_cast <Expr*>(Operand.get <Stmt *>());
830
826
}
831
827
832
- void setExprOperand (Expr *E) {
833
- assert (!isTypeOperand () && " Cannot call getExprOperand for typeid(type)" );
834
- Operand = E;
835
- }
836
-
837
828
SourceLocation getBeginLoc () const LLVM_READONLY { return Range.getBegin (); }
838
829
SourceLocation getEndLoc () const LLVM_READONLY { return Range.getEnd (); }
839
830
SourceRange getSourceRange () const LLVM_READONLY { return Range; }
@@ -1000,6 +991,8 @@ class MSPropertySubscriptExpr : public Expr {
1000
991
// /
1001
992
// / This represents code like @c __uuidof(COMTYPE) or @c __uuidof(*comPtr)
1002
993
class CXXUuidofExpr : public Expr {
994
+ friend class ASTStmtReader ;
995
+
1003
996
private:
1004
997
llvm::PointerUnion<Stmt *, TypeSourceInfo *> Operand;
1005
998
StringRef UuidStr;
@@ -1038,22 +1031,11 @@ class CXXUuidofExpr : public Expr {
1038
1031
assert (isTypeOperand () && " Cannot call getTypeOperand for __uuidof(expr)" );
1039
1032
return Operand.get <TypeSourceInfo *>();
1040
1033
}
1041
-
1042
- void setTypeOperandSourceInfo (TypeSourceInfo *TSI) {
1043
- assert (isTypeOperand () && " Cannot call getTypeOperand for __uuidof(expr)" );
1044
- Operand = TSI;
1045
- }
1046
-
1047
1034
Expr *getExprOperand () const {
1048
1035
assert (!isTypeOperand () && " Cannot call getExprOperand for __uuidof(type)" );
1049
1036
return static_cast <Expr*>(Operand.get <Stmt *>());
1050
1037
}
1051
1038
1052
- void setExprOperand (Expr *E) {
1053
- assert (!isTypeOperand () && " Cannot call getExprOperand for __uuidof(type)" );
1054
- Operand = E;
1055
- }
1056
-
1057
1039
void setUuidStr (StringRef US) { UuidStr = US; }
1058
1040
StringRef getUuidStr () const { return UuidStr; }
1059
1041
0 commit comments