Skip to content

Commit f53d12b

Browse files
committed
[lldb] Resolve imports before manipulating AST
Imports need to be resolved before the SwiftASTManipulator is run, as it can query interface types.
1 parent 9af1072 commit f53d12b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,13 @@ static llvm::Expected<ParsedExpression> ParseAndImport(
12801280
// inserting them in.
12811281
swift_ast_context->AddDebuggerClient(external_lookup);
12821282

1283+
if (swift_ast_context->HasErrors())
1284+
return make_error<SwiftASTContextError>();
1285+
1286+
// Resolve the file's imports, including the implicit ones returned from
1287+
// GetImplicitImports.
1288+
swift::performImportResolution(*source_file);
1289+
12831290
if (swift_ast_context->HasErrors())
12841291
return make_error<SwiftASTContextError>();
12851292

@@ -1331,11 +1338,6 @@ static llvm::Expected<ParsedExpression> ParseAndImport(
13311338
stack_frame_sp.reset();
13321339
}
13331340

1334-
swift::performImportResolution(*source_file);
1335-
1336-
if (swift_ast_context->HasErrors())
1337-
return make_error<SwiftASTContextError>();
1338-
13391341
// Cache the source file's imports such that they're accessible to future
13401342
// expression evaluations.
13411343
{

0 commit comments

Comments
 (0)