[clang] [WIP] Implement `-dump-deserialized-declaration-ranges` flag. (PR #133910)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 3 07:16:35 PDT 2025


================
@@ -49,6 +51,135 @@ LLVM_INSTANTIATE_REGISTRY(FrontendPluginRegistry)
 
 namespace {
 
+/// Dumps deserialized declarations.
+class DeserializedDeclsLineRangePrinter : public DelegatingDeserializationListener, public ASTConsumer {
+public:
+  explicit DeserializedDeclsLineRangePrinter(SourceManager &SM, std::unique_ptr<llvm::raw_fd_ostream> OS)
+      : DelegatingDeserializationListener(nullptr, false), SM(SM), OS(std::move(OS)) {}
----------------
ilya-biryukov wrote:

SG! I have missed the fact the `ASTConsumer` can have a deserialization listener attached to it and there is logic in Clang to handle that. The approach SG.

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


More information about the cfe-commits mailing list