Merge pull request #75490 from ahoppen/swiftparser-on-deep-stack

[SourceKit] Run SwiftParser on a deep stack for the related identifiers request
This commit is contained in:
Alex Hoppen
2024-07-29 15:52:43 -07:00
committed by GitHub
4 changed files with 320 additions and 6 deletions

View File

@@ -174,13 +174,13 @@ namespace SourceKit {
void ASTUnit::Implementation::consumeAsync(SwiftASTConsumerRef ConsumerRef,
ASTUnitRef ASTRef) {
#if defined(_WIN32)
// Windows uses more up for stack space (why?) than macOS/Linux which
// causes stack overflows in a dispatch thread with 64k stack. Passing
// useDeepStack=true means it's given a _beginthreadex thread with an 8MB
// stack.
bool useDeepStack = true;
// Windows uses more up for stack space (why?) than macOS/Linux which
// causes stack overflows in a dispatch thread with 64k stack. Passing
// useDeepStack=true means it's given a _beginthreadex thread with an 8MB
// stack.
bool useDeepStack = true;
#else
bool useDeepStack = false;
bool useDeepStack = ConsumerRef->requiresDeepStack();
#endif
Queue.dispatch([ASTRef, ConsumerRef]{
SwiftASTConsumer &ASTConsumer = *ConsumerRef;