@@ -108,8 +108,9 @@ class UnqualifiedLookup {
108
108
// /
109
109
// / If the current DeclContext is nested in a function body, the SourceLoc
110
110
// / is used to determine which declarations in that body are visible.
111
- UnqualifiedLookup (const char * dummy, DeclName Name, DeclContext *DC, LazyResolver *TypeResolver,
112
- SourceLoc Loc = SourceLoc(), Options options = Options());
111
+ UnqualifiedLookup (const char *dummy, DeclName Name, DeclContext *DC,
112
+ LazyResolver *TypeResolver, SourceLoc Loc = SourceLoc(),
113
+ Options options = Options());
113
114
UnqualifiedLookup (DeclName Name, DeclContext *DC, LazyResolver *TypeResolver,
114
115
SourceLoc Loc = SourceLoc(), Options options = Options());
115
116
@@ -127,14 +128,18 @@ class UnqualifiedLookup {
127
128
128
129
// / Get the result as a single type, or a null type if that fails.
129
130
TypeDecl *getSingleTypeResult ();
131
+
132
+ public: // for exp debugging
133
+ SourceFile const *recordedSF = nullptr ;
134
+ DeclName recordedName;
135
+ bool recordedIsCascadingUse = false ;
130
136
};
131
137
132
138
inline UnqualifiedLookup::Options operator |(UnqualifiedLookup::Flags flag1,
133
139
UnqualifiedLookup::Flags flag2) {
134
140
return UnqualifiedLookup::Options (flag1) | flag2;
135
141
}
136
142
137
-
138
143
// / This class implements and represents the result of performing
139
144
// / unqualified lookup (i.e. lookup for a plain identifier).
140
145
class ExpUnqualifiedLookup {
@@ -147,8 +152,9 @@ inline UnqualifiedLookup::Options operator|(UnqualifiedLookup::Flags flag1,
147
152
// /
148
153
// / If the current DeclContext is nested in a function body, the SourceLoc
149
154
// / is used to determine which declarations in that body are visible.
150
- ExpUnqualifiedLookup (DeclName Name, DeclContext *DC, LazyResolver *TypeResolver,
151
- SourceLoc Loc = SourceLoc(), Options options = Options());
155
+ ExpUnqualifiedLookup (DeclName Name, DeclContext *DC,
156
+ LazyResolver *TypeResolver, SourceLoc Loc = SourceLoc(),
157
+ Options options = Options());
152
158
153
159
SmallVector<LookupResultEntry, 4 > Results;
154
160
// / The index of the first result that isn't from the innermost scope
@@ -186,6 +192,27 @@ inline UnqualifiedLookup::Options operator|(UnqualifiedLookup::Flags flag1,
186
192
}
187
193
188
194
bool verifyEqual (const UnqualifiedLookup &) const ;
195
+
196
+ public: // for exp debugging
197
+ SourceFile const *recordedSF = nullptr ;
198
+ DeclName recordedName;
199
+ bool recordedIsCascadingUse = false ;
200
+
201
+ using LookupDecls = SmallVector<NominalTypeDecl *, 2 >;
202
+ enum class ScopeLookupResult { next, stop, finished };
203
+ struct PerScopeLookupState {
204
+ ScopeLookupResult result;
205
+ DeclContext *nextDC;
206
+ LookupDecls foundDecls;
207
+ DeclContext *BaseDC;
208
+ DeclContext *MetaBaseDC;
209
+ Optional<bool > isCascadingUse;
210
+ GenericParamList *GenericParams;
211
+
212
+ void dump () const ;
213
+ };
214
+ std::vector<PerScopeLookupState> breadcrumbs;
215
+ void dumpBreadcrumbs () const ;
189
216
};
190
217
191
218
// / Describes the reason why a certain declaration is visible.
0 commit comments