11 Commits

Author SHA1 Message Date
Daniel Grumberg
fa649df8e5
[clang][ExtractAPI] Flatten all enum cases from anonymous enums at top level (#93559)
rdar://128863241
2024-05-29 09:47:23 +01:00
Daniel Grumberg
e05c1b46d0
Reenable external categories (#87357)
Reenables b31414bf4f9898f7817a9fcf8a91f62ec26f3eaf.

Also adds a new warning for missing `--symbol-graph-dir` arg when
`--emit-extension-symbol-graphs` is provided. This also reverts the
commit that removed.
2024-04-03 10:18:05 +01:00
Daniel Grumberg
209a1e8dfd Revert "[clang][ExtractAPI] Add ability to create multiple symbol graphs (#86676)"
This failed the test suite due to missing DiagGroup for a new warning.

This reverts commit b31414bf4f9898f7817a9fcf8a91f62ec26f3eaf.
2024-04-02 15:34:52 +01:00
Daniel Grumberg
b31414bf4f
[clang][ExtractAPI] Add ability to create multiple symbol graphs (#86676)
This extends ExtractAPI to take into account symbols defined in categories to types defined in an external module.
This introduces 2 new command line flags, `--symbol-graph-dir=DIR` and `--emit-extension-symbol-graphs`, when used together this generates additional symbol graph files at `DIR/ExtendedModule@ProductName.symbols.json` for each external module that is extended in this way.

Additionally this makes some cleanups to tests to make them more resilient and cleans up the `APISet` data structure.
2024-04-02 15:03:46 +01:00
Sofía Rodríguez
3d4128f7ff
[clang][ExtractAPI] Record availability information only for the target platform (#76823)
Currently, ExtractAPI provides availability information for all
platforms within a given domain. With this change, we narrow down the
output to include availability details only for the specified target
platform, so users can generate the symbol graph with only the
availability information they need, omitting information of the other
platforms.

This change reverts the functionality introduced in
[`57c9780`](https://github.com/llvm/llvm-project/commit/57c9780).

rdar://120419037
2024-01-19 10:56:53 +00:00
Daniel Grumberg
142c3d9d14 [clang][ExtractAPI] Reland ExtractAPI for libclang improvements
This relands the changes that were originally introduced by:
- https://reviews.llvm.org/D146656
- https://reviews.llvm.org/D147138

This also fixes the leak that led to these changes being reverted

Differential Revision: https://reviews.llvm.org/D147234
2023-03-30 18:13:58 +01:00
Mitch Phillips
3be6c4d413 Revert "Revert "Revert ExtractAPI from https://reviews.llvm.org/D146656""
This reverts commit 79116475124112051625b1a0665e35c861bb13fd.

Broke the ASan bots. See more information in
https://reviews.llvm.org/rG79116475124112051625b1a0665e35c861bb13fd
2023-03-29 11:39:44 -07:00
Daniel Grumberg
7911647512 Revert "Revert ExtractAPI from https://reviews.llvm.org/D146656"
This reverts commit 158a431227a876306fe5838936413dd51588d0c6.
2023-03-29 10:51:13 +01:00
Daniel Grumberg
158a431227 Revert ExtractAPI from https://reviews.llvm.org/D146656 2023-03-27 22:12:36 +01:00
Daniel Grumberg
ea35740e7e [clang][ExtractAPI] Refactor ExtractAPIVisitor to make it more extensible
Use CRTP to enable creating statically dispatched subclasses of
ExtractAPIVisitor.
This enables adding extension points and customising the behavior more
easily.

This is used in CXExtractAPI.cpp to create a specialized visitor for
Libclang as well as streamlining the batch implementation in ExtractAPIConsumer.cpp
2023-03-27 17:24:10 +01:00
Daniel Grumberg
7a85192166 [clang][ExtractAPI] Add support for single symbol SGF and libclang support
This is mainly adding an entry point to `SymbolGraphSerializer` at
`serializeSingleSymbolSGF` and exposing the necessary data to make this
possible.  Additionaly there are some changes to how symbol kinds and
path components are serialized to make the usage more ergonomic in
`serializeSingleSymbolSGF`.

On the libclang side this introduces APIs to:
- create an APISet from a TU
- dispose of an APISet
- query an APISet for a single symbol SGF for a given USR.
- generate a single symbol SGF for a given CXCursor, this only traverses
the necessary AST nodes to construct the result as oppposed as going
through the entire AST.

Differential Revision: https://reviews.llvm.org/D139115
2022-12-13 11:18:11 +00:00