[clang] [clang][NFCI] Clarify ownership of PragmaHandlers (PR #117703)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 26 09:01:09 PST 2024


AaronBallman wrote:

I think the preprocessor is what owns the pragma handlers and the parser is what gets to observe them, right? Because the preprocessor is part of the clangLex library (and it needs to have pragma handlers to be able to process pp-tokens) and clangParse is built on top of clangLex. So I think that means the preprocessor is what should manage the memory for these and hold the unique_ptr, and the parser should just get a reference to the pragma handler so there's no lifetime to manage (because we know clangLex outlives clangParse anyway)?

https://github.com/llvm/llvm-project/pull/117703


More information about the cfe-commits mailing list