[PATCH] D139115: [clang][ExtractAPI] Add support for single symbol SGF

Daniel Grumberg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 9 14:44:34 PST 2022


dang marked an inline comment as done.
dang added inline comments.


================
Comment at: clang/include/clang/ExtractAPI/DeclarationFragments.h:91
+    /// The associated declaration, if applicable.
+    const Decl *Declaration;
+
----------------
zixuw wrote:
> Is the decl guaranteed to be available when `Fragment` is used?
> In our existing use case this might be fine as the serializer will be used while the AST is still alive. But this is actually the first thing that adds the dependency to the AST IIRC. So this makes the whole APISet dependent on the AST
Currently yes, the Decl is available as the APISet is not kept around beyond the lifetime of the AST. Nonetheless I agree that it is used in an unusual manner, to help traverse the AST in libclang as opposed to truly encoding information about the available APIs. I think if we introduce new clients of APISet we would need to add an extension mechanism to the visitation mechanism to enable use cases like this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139115



More information about the cfe-commits mailing list