@@ -249,17 +249,8 @@ class alignas(8) Expr {
249249 NumArgLabels : 16
250250 );
251251
252- SWIFT_INLINE_BITFIELD_FULL (UnresolvedMemberExpr, Expr, 1 +1 +1 +16 ,
253- // / Whether the UnresolvedMemberExpr has arguments.
254- HasArguments : 1 ,
255- // / Whether the UnresolvedMemberExpr also has source locations for the
256- // / argument label.
257- HasArgLabelLocs : 1 ,
258- // / Whether the last argument is a trailing closure.
259- HasTrailingClosure : 1 ,
260- : NumPadBits,
261- // / # of argument labels stored after the UnresolvedMemberExpr.
262- NumArgLabels : 16
252+ SWIFT_INLINE_BITFIELD_FULL (UnresolvedMemberExpr, Expr, 2 ,
253+ FunctionRefKind : 2
263254 );
264255
265256 SWIFT_INLINE_BITFIELD (OverloadSetRefExpr, Expr, 2 ,
@@ -1841,71 +1832,35 @@ class DynamicSubscriptExpr final
18411832// / member, which is to be resolved with context sensitive type information into
18421833// / bar.foo. These always have unresolved type.
18431834class UnresolvedMemberExpr final
1844- : public Expr,
1845- public TrailingCallArguments<UnresolvedMemberExpr> {
1835+ : public Expr {
18461836 SourceLoc DotLoc;
18471837 DeclNameLoc NameLoc;
18481838 DeclNameRef Name;
1849- Expr *Argument;
1850-
1851- UnresolvedMemberExpr (SourceLoc dotLoc, DeclNameLoc nameLoc,
1852- DeclNameRef name, Expr *argument,
1853- ArrayRef<Identifier> argLabels,
1854- ArrayRef<SourceLoc> argLabelLocs,
1855- bool hasTrailingClosure,
1856- bool implicit);
18571839
18581840public:
1859- // / Create a new unresolved member expression with no arguments.
1860- static UnresolvedMemberExpr *create (ASTContext &ctx, SourceLoc dotLoc,
1861- DeclNameLoc nameLoc, DeclNameRef name,
1862- bool implicit);
1863-
1864- // / Create a new unresolved member expression.
1865- static UnresolvedMemberExpr *create (ASTContext &ctx, SourceLoc dotLoc,
1866- DeclNameLoc nameLoc, DeclNameRef name,
1867- SourceLoc lParenLoc,
1868- ArrayRef<Expr *> args,
1869- ArrayRef<Identifier> argLabels,
1870- ArrayRef<SourceLoc> argLabelLocs,
1871- SourceLoc rParenLoc,
1872- ArrayRef<TrailingClosure> trailingClosures,
1873- bool implicit);
1841+ UnresolvedMemberExpr (SourceLoc dotLoc, DeclNameLoc nameLoc, DeclNameRef name,
1842+ bool implicit)
1843+ : Expr(ExprKind::UnresolvedMember, implicit), DotLoc(dotLoc),
1844+ NameLoc (nameLoc), Name(name) {}
18741845
18751846 DeclNameRef getName () const { return Name; }
18761847 DeclNameLoc getNameLoc () const { return NameLoc; }
18771848 SourceLoc getDotLoc () const { return DotLoc; }
1878- Expr *getArgument () const { return Argument; }
1879- void setArgument (Expr *argument) { Argument = argument; }
18801849
1881- // / Whether this reference has arguments.
1882- bool hasArguments () const {
1883- return Bits.UnresolvedMemberExpr .HasArguments ;
1884- }
1885-
1886- unsigned getNumArguments () const {
1887- return Bits.UnresolvedMemberExpr .NumArgLabels ;
1888- }
1889-
1890- bool hasArgumentLabelLocs () const {
1891- return Bits.UnresolvedMemberExpr .HasArgLabelLocs ;
1892- }
1850+ SourceLoc getLoc () const { return NameLoc.getBaseNameLoc (); }
18931851
1894- // / Whether this call with written with a trailing closure.
1895- bool hasTrailingClosure () const {
1896- return Bits.UnresolvedMemberExpr .HasTrailingClosure ;
1897- }
1852+ SourceLoc getStartLoc () const { return DotLoc; }
1853+ SourceLoc getEndLoc () const { return NameLoc.getSourceRange ().End ; }
18981854
1899- // / Return the index of the unlabeled trailing closure argument.
1900- Optional<unsigned > getUnlabeledTrailingClosureIndex () const {
1901- return getArgument ()->getUnlabeledTrailingClosureIndexOfPackedArgument ();
1855+ // / Retrieve the kind of function reference.
1856+ FunctionRefKind getFunctionRefKind () const {
1857+ return static_cast <FunctionRefKind>(
1858+ Bits.UnresolvedMemberExpr .FunctionRefKind );
19021859 }
19031860
1904- SourceLoc getLoc () const { return NameLoc.getBaseNameLoc (); }
1905-
1906- SourceLoc getStartLoc () const { return DotLoc; }
1907- SourceLoc getEndLoc () const {
1908- return (Argument ? Argument->getEndLoc () : NameLoc.getSourceRange ().End );
1861+ // / Set the kind of function reference.
1862+ void setFunctionRefKind (FunctionRefKind refKind) {
1863+ Bits.UnresolvedMemberExpr .FunctionRefKind = static_cast <unsigned >(refKind);
19091864 }
19101865
19111866 static bool classof (const Expr *E) {
0 commit comments