@@ -4787,9 +4787,12 @@ class CallExpr final : public ApplyExpr,
4787
4787
4788
4788
// / PrefixUnaryExpr - Prefix unary expressions like '!y'.
4789
4789
class PrefixUnaryExpr : public ApplyExpr {
4790
+ PrefixUnaryExpr (Expr *fn, Expr *operand, Type ty = Type())
4791
+ : ApplyExpr(ExprKind::PrefixUnary, fn, operand, /* implicit*/ false , ty) {}
4792
+
4790
4793
public:
4791
- PrefixUnaryExpr (Expr *Fn , Expr *Arg, Type Ty = Type())
4792
- : ApplyExpr(ExprKind::PrefixUnary, Fn, Arg, /* Implicit= */ false , Ty) {}
4794
+ static PrefixUnaryExpr * create (ASTContext &ctx , Expr *fn, Expr *operand,
4795
+ Type ty = Type());
4793
4796
4794
4797
SourceLoc getLoc () const { return getFn ()->getStartLoc (); }
4795
4798
@@ -4807,9 +4810,13 @@ class PrefixUnaryExpr : public ApplyExpr {
4807
4810
4808
4811
// / PostfixUnaryExpr - Postfix unary expressions like 'y!'.
4809
4812
class PostfixUnaryExpr : public ApplyExpr {
4813
+ PostfixUnaryExpr (Expr *fn, Expr *operand, Type ty = Type())
4814
+ : ApplyExpr(ExprKind::PostfixUnary, fn, operand, /* implicit*/ false , ty) {
4815
+ }
4816
+
4810
4817
public:
4811
- PostfixUnaryExpr (Expr *Fn , Expr *Arg, Type Ty = Type())
4812
- : ApplyExpr(ExprKind::PostfixUnary, Fn, Arg, /* Implicit= */ false , Ty) {}
4818
+ static PostfixUnaryExpr * create (ASTContext &ctx , Expr *fn, Expr *operand,
4819
+ Type ty = Type());
4813
4820
4814
4821
SourceLoc getLoc () const { return getFn ()->getStartLoc (); }
4815
4822
@@ -4877,15 +4884,19 @@ class SelfApplyExpr : public ApplyExpr {
4877
4884
// / is modeled as a DeclRefExpr or OverloadSetRefExpr on the method.
4878
4885
class DotSyntaxCallExpr : public SelfApplyExpr {
4879
4886
SourceLoc DotLoc;
4880
-
4881
- public:
4882
- DotSyntaxCallExpr (Expr *FnExpr, SourceLoc DotLoc, Expr *BaseExpr,
4883
- Type Ty = Type())
4884
- : SelfApplyExpr(ExprKind::DotSyntaxCall, FnExpr, BaseExpr, Ty),
4885
- DotLoc (DotLoc) {
4887
+
4888
+ DotSyntaxCallExpr (Expr *fnExpr, SourceLoc dotLoc, Expr *baseExpr,
4889
+ Type ty = Type())
4890
+ : SelfApplyExpr(ExprKind::DotSyntaxCall, fnExpr, baseExpr, ty),
4891
+ DotLoc (dotLoc) {
4886
4892
setImplicit (DotLoc.isInvalid ());
4887
4893
}
4888
4894
4895
+ public:
4896
+ static DotSyntaxCallExpr *create (ASTContext &ctx, Expr *fnExpr,
4897
+ SourceLoc dotLoc, Expr *baseExpr,
4898
+ Type ty = Type());
4899
+
4889
4900
SourceLoc getDotLoc () const { return DotLoc; }
4890
4901
4891
4902
SourceLoc getLoc () const ;
@@ -4901,9 +4912,12 @@ class DotSyntaxCallExpr : public SelfApplyExpr {
4901
4912
// / actual reference to function which returns the constructor is modeled
4902
4913
// / as a DeclRefExpr.
4903
4914
class ConstructorRefCallExpr : public SelfApplyExpr {
4915
+ ConstructorRefCallExpr (Expr *fnExpr, Expr *baseExpr, Type ty = Type())
4916
+ : SelfApplyExpr(ExprKind::ConstructorRefCall, fnExpr, baseExpr, ty) {}
4917
+
4904
4918
public:
4905
- ConstructorRefCallExpr (Expr *FnExpr , Expr *BaseExpr, Type Ty = Type())
4906
- : SelfApplyExpr(ExprKind::ConstructorRefCall, FnExpr, BaseExpr, Ty) {}
4919
+ static ConstructorRefCallExpr * create (ASTContext &ctx , Expr *fnExpr,
4920
+ Expr *baseExpr, Type ty = Type());
4907
4921
4908
4922
SourceLoc getLoc () const { return getFn ()->getLoc (); }
4909
4923
SourceLoc getStartLoc () const { return getBase ()->getStartLoc (); }
0 commit comments