@@ -43,6 +43,7 @@ using namespace ast_scope;
43
43
class LoggingASTScopeDeclConsumer
44
44
: public namelookup::AbstractASTScopeDeclConsumer {
45
45
private:
46
+ const int shouldLookInMembers = 0b10 ;
46
47
namelookup::AbstractASTScopeDeclConsumer *originalConsumer;
47
48
48
49
public:
@@ -69,21 +70,21 @@ class LoggingASTScopeDeclConsumer
69
70
// / \return true if the lookup should be stopped at this point.
70
71
bool consume (ArrayRef<ValueDecl *> values,
71
72
NullablePtr<DeclContext> baseDC = nullptr ) override {
72
- bool result = originalConsumer->consume (values, baseDC);
73
+ bool endOfLookup = originalConsumer->consume (values, baseDC);
73
74
74
75
for (auto value : values) {
75
76
if (auto sourceLoc = value->getLoc ()) {
76
77
recordedElements.push_back (BridgedConsumedLookupResult (
77
- value->getBaseIdentifier (), sourceLoc, result ));
78
+ value->getBaseIdentifier (), sourceLoc, endOfLookup ));
78
79
} else {
79
80
// If sourceLoc is unavailable, use location of it's parent.
80
81
recordedElements.push_back (BridgedConsumedLookupResult (
81
82
value->getBaseIdentifier (),
82
- value->getDeclContext ()->getAsDecl ()->getLoc (), result ));
83
+ value->getDeclContext ()->getAsDecl ()->getLoc (), endOfLookup ));
83
84
}
84
85
}
85
86
86
- return result ;
87
+ return endOfLookup ;
87
88
};
88
89
89
90
// / Look for members of a nominal type or extension scope.
@@ -93,19 +94,19 @@ class LoggingASTScopeDeclConsumer
93
94
// /
94
95
// / \return true if the lookup should be stopped at this point.
95
96
bool lookInMembers (const DeclContext *scopeDC) const override {
96
- bool result = originalConsumer->lookInMembers (scopeDC);
97
+ bool endOfLookup = originalConsumer->lookInMembers (scopeDC);
97
98
98
99
if (auto *extDecl = dyn_cast<ExtensionDecl>(scopeDC)) {
99
100
recordedElements.push_back (BridgedConsumedLookupResult (
100
101
Identifier (), extDecl->getExtendedTypeRepr ()->getLoc (),
101
- 0b10 + result ));
102
+ shouldLookInMembers + endOfLookup ));
102
103
} else {
103
104
recordedElements.push_back (BridgedConsumedLookupResult (
104
105
scopeDC->getSelfNominalTypeDecl ()->getBaseIdentifier (),
105
- scopeDC->getAsDecl ()->getLoc (), 0b10 + result ));
106
+ scopeDC->getAsDecl ()->getLoc (), shouldLookInMembers + endOfLookup ));
106
107
}
107
108
108
- return result ;
109
+ return endOfLookup ;
109
110
};
110
111
111
112
// / Called for local VarDecls that might not yet be in scope.
0 commit comments