Skip to content

Commit 28e7bc6

Browse files
authored
Merge pull request swiftlang#32801 from rintaro/ide-completion-test-reusingastcontext
[swift-ide-test] Add indicator of "reusing ASTContext" to the result
2 parents d1a54a5 + 0b5dbb1 commit 28e7bc6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/swift-ide-test/swift-ide-test.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,7 @@ static int doBatchCodeCompletion(const CompilerInvocation &InitInvok,
11981198

11991199
PrintingDiagnosticConsumer PrintDiags;
12001200
auto completionStart = std::chrono::high_resolution_clock::now();
1201+
bool wasASTContextReused = false;
12011202
bool isSuccess = CompletionInst.performOperation(
12021203
Invocation, /*Args=*/{}, FileSystem, completionBuffer.get(), Offset,
12031204
/*EnableASTCaching=*/true, Error,
@@ -1217,11 +1218,15 @@ static int doBatchCodeCompletion(const CompilerInvocation &InitInvok,
12171218

12181219
auto *SF = CI.getCodeCompletionFile();
12191220
performCodeCompletionSecondPass(*SF, *callbacksFactory);
1221+
wasASTContextReused = reusingASTContext;
12201222
});
12211223
auto completionEnd = std::chrono::high_resolution_clock::now();
12221224
auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(
12231225
completionEnd - completionStart);
1224-
llvm::errs() << "Elapsed: " << elapsed.count() << " msec\n";
1226+
llvm::errs() << "Elapsed: " << elapsed.count() << " msec";
1227+
if (wasASTContextReused)
1228+
llvm::errs() << " (reusing ASTContext)";
1229+
llvm::errs() << "\n";
12251230
OS.flush();
12261231

12271232
if (OutputDir.empty()) {

0 commit comments

Comments
 (0)