@@ -131,14 +131,6 @@ class SILLocation {
131
131
return cast<T>(Node.get <typename base_type<T>::type*>());
132
132
}
133
133
134
- // / \brief Check if the corresponding source code location definitely points
135
- // / to the start of the AST node.
136
- bool alwaysPointsToStart () const { return KindData & (1 << PointsToStartBit);}
137
-
138
- // / \brief Check if the corresponding source code location definitely points
139
- // / to the end of the AST node.
140
- bool alwaysPointsToEnd () const { return KindData & (1 << PointsToEndBit); }
141
-
142
134
// SILLocation constructors.
143
135
SILLocation (LocationKind K) : KindData(K) {}
144
136
SILLocation (Stmt *S, LocationKind K) : ASTNode(S), KindData(K) {}
@@ -208,6 +200,14 @@ class SILLocation {
208
200
209
201
bool hasASTLocation () const { return !ASTNode.isNull (); }
210
202
203
+ // / \brief Check if the corresponding source code location definitely points
204
+ // / to the start of the AST node.
205
+ bool alwaysPointsToStart () const { return KindData & (1 << PointsToStartBit);}
206
+
207
+ // / \brief Check if the corresponding source code location definitely points
208
+ // / to the end of the AST node.
209
+ bool alwaysPointsToEnd () const { return KindData & (1 << PointsToEndBit); }
210
+
211
211
LocationKind getKind () const { return (LocationKind)(KindData & BaseMask); }
212
212
213
213
template <typename T>
@@ -340,21 +340,20 @@ class ImplicitReturnLocation : public SILLocation {
340
340
public:
341
341
342
342
ImplicitReturnLocation (AbstractClosureExpr *E)
343
- : SILLocation(E, ImplicitReturnKind) { pointToEnd (); }
343
+ : SILLocation(E, ImplicitReturnKind) { }
344
344
345
345
ImplicitReturnLocation (AbstractFunctionDecl *AFD)
346
- : SILLocation(AFD, ImplicitReturnKind) { pointToEnd (); }
346
+ : SILLocation(AFD, ImplicitReturnKind) { }
347
347
348
348
// / \brief Construct from a RegularLocation; preserve all special bits.
349
349
// /
350
350
// / Note, this can construct an implicit return for an arbitrary expression
351
351
// / (specifically, in case of auto-generated bodies).
352
352
static SILLocation getImplicitReturnLoc (SILLocation L) {
353
353
assert (L.isASTNode <Expr>() ||
354
- L.isASTNode <AbstractFunctionDecl >() ||
354
+ L.isASTNode <ValueDecl >() ||
355
355
(L.isNull () && L.isInTopLevel ()));
356
356
L.setKind (ImplicitReturnKind);
357
- L.pointToEnd ();
358
357
return L;
359
358
}
360
359
@@ -446,7 +445,7 @@ class MandatoryInlinedLocation : public SILLocation {
446
445
// / \brief Used on the instruction performing auto-generated cleanup such as
447
446
// / deallocs, destructor calls.
448
447
// /
449
- // / The cleanups are performed after completing the evaluztion of the AST Node
448
+ // / The cleanups are performed after completing the evaluation of the AST Node
450
449
// / wrapped inside the SILLocation. This location wraps the statement
451
450
// / representing the enclosing scope, for example, FuncDecl, ParenExpr. The
452
451
// / scope's end location points to the SourceLoc that shows when the operation
0 commit comments