[PATCH] D158967: [clangd] Record the stack bottom before building AST

Younan Zhang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 28 08:23:51 PDT 2023


zyounan added a comment.

> According to documentation of noteBottomOfStack, those should be tied to thread creation, i.e. main and AsyncTaskRunner are two most common entry points for threads that do parsing.

Yeah, I was about to put this call there. But they both boil down to the single `ParsedAST::build()`, right? (Admittedly, this breaks the "encapsulation" if we say 'the build process for AST should not bring any other side effects besides the AST itself', and this doesn't adhere to the document that it should be created at the beginning of the thread/program.)

> Currently the code in CompilerInstance::ExecuteAction seems to acknowledge that there should be a fallback. I'm suggesting to move this fallback down to a function that actually runs parsing.

Upon the implementation, the result will be more accurate if it occurs earlier before diving into parsing. Maybe we can do both, that put this call at clangd site and libclang's `ASTFrontendAction::ExecuteAction`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158967/new/

https://reviews.llvm.org/D158967



More information about the cfe-commits mailing list