From def3dd24b0db402a6592dc91f1b394861119618c Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Mon, 24 Nov 2025 12:00:02 +0100 Subject: [PATCH] Add pretty stack trace entry during indexing In case we hit a crash during indexing, this will make it easier to identify the crash as coming from indexing vs from compilation. --- clang/lib/Index/IndexingAction.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang/lib/Index/IndexingAction.cpp b/clang/lib/Index/IndexingAction.cpp index 25212ac6afb00..078f3a5c9dbbc 100644 --- a/clang/lib/Index/IndexingAction.cpp +++ b/clang/lib/Index/IndexingAction.cpp @@ -604,6 +604,7 @@ class IndexRecordASTConsumer : public ASTConsumer { } bool HandleTopLevelDecl(DeclGroupRef DG) override { + llvm::PrettyStackTraceFormat trace("indexing"); return IndexCtx->indexDeclGroupRef(DG); } @@ -612,6 +613,7 @@ class IndexRecordASTConsumer : public ASTConsumer { } void HandleTopLevelDeclInObjCContainer(DeclGroupRef DG) override { + llvm::PrettyStackTraceFormat trace("indexing"); IndexCtx->indexDeclGroupRef(DG); }