File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -268,18 +268,24 @@ ASTSourceFileScope::ASTSourceFileScope(SourceFile *SF,
268
268
scopeCreator(scopeCreator) {
269
269
if (auto enclosingSF = SF->getEnclosingSourceFile ()) {
270
270
SourceLoc parentLoc;
271
- auto macroRole = SF->getFulfilledMacroRole ();
272
-
273
- // Determine the parent source location based on the macro role.
274
- AbstractFunctionDecl *bodyForDecl = nullptr ;
275
271
276
272
if (SF->Kind == SourceFileKind::DefaultArgument) {
277
273
auto genInfo = *SF->getASTContext ().SourceMgr .getGeneratedSourceInfo (
278
274
*SF->getBufferID ());
279
275
parentLoc = ASTNode::getFromOpaqueValue (genInfo.astNode ).getStartLoc ();
280
- goto setParent;
276
+ if (auto parentScope =
277
+ findStartingScopeForLookup (enclosingSF, parentLoc)) {
278
+ parentAndWasExpanded.setPointer (
279
+ const_cast <ASTScopeImpl *>(parentScope));
280
+ }
281
+ return ;
281
282
}
282
283
284
+ auto macroRole = SF->getFulfilledMacroRole ();
285
+
286
+ // Determine the parent source location based on the macro role.
287
+ AbstractFunctionDecl *bodyForDecl = nullptr ;
288
+
283
289
switch (*macroRole) {
284
290
case MacroRole::Expression:
285
291
case MacroRole::Declaration:
@@ -309,7 +315,6 @@ ASTSourceFileScope::ASTSourceFileScope(SourceFile *SF,
309
315
}
310
316
}
311
317
312
- setParent:
313
318
if (auto parentScope = findStartingScopeForLookup (enclosingSF, parentLoc)) {
314
319
if (bodyForDecl) {
315
320
auto bodyScope = new (bodyForDecl->getASTContext ()) FunctionBodyScope (bodyForDecl);
You can’t perform that action at this time.
0 commit comments