The subheading for a destructor contained only the identifier. The tilde
must also be included as it is necessary to differentiate the destructor
from any constructors present.
rdar://129587608
Pointer types in function signatures must place the asterisk before the
identifier without a space in between. This patch removes the space and
also ensures that pointers to pointers are formatted correctly.
rdar://131780418
rdar://154533037
ObjC methods include a +/- prefix to indicate if they are a class or
instance method. This information is valuable, and must be included in
the navigator generated by ExtractAPI.
rdar://150870936
* Translate the following versions to 26.
* watchOS 12 -> 26
* visionOS 3 -> 26
* macos 16 -> 26
* iOS 19 -> 26
* tvOS 19 -> 26
* Emit diagnostics, but allow conversion when clients attempt to use
invalid gaps in OS versioning in availability.
* For target-triples, only allow "valid" versions for implicit
conversions.
fixes rdar://137214218
When 'typedef struct' decls are encountered, the records are combined if
the underlying type is either anonymous or has the same name as the
typedef. Extend this behavior to also combine records when the
underlying type has an underscored name that is equivalent to the
typedef name when the leading underscores are removed.
Resolves rdar://140298287
ExtractAPI's support for printing Objective-C category extensions from
other modules emits symbol graphs with an
`ExtendedModule@HostModule.symbols.json`. However, this is backwards
from existing symbol graph practices, causing issues when these symbol
graphs are consumed alongside symbol graphs generated with other tools
like Swift. This PR flips the naming scheme to be in line with existing
symbol graph tooling.
`RecordRecord::classOfKind` and `TagRecord::classofKind` didn't
correctly capture `RK_CXXClass` and derived variants, e.g.
`RK_ClassTemplate`. This materialized by anonymous C++ tag types not
being correctly detected when they need to be merged with another
record.
When an anonymous type has a typedef we normally use the typedef's name
in places where we expect a named identifier in the symbol graph. This
extends this logic to apply to subheadings.
rdar://136690614
Extension SGFs require the module system to be enabled in order to discover which module defines the extended external type.
This patch ensures the following:
- Associate symbols with their top level module name, and that only top level modules are considered as modules for emitting extension SGFs.
- Ensure we don't drop macro definitions that came from a submodule. To this end look at all defined macros in `PPCalbacks::EndOfMainFile` instead of relying on `PPCallbacks::MacroDefined` being called to detect a macro definition.
Add back missing includes and revert revert "[clang][ExtractAPI] Stop
dropping fields of nested anonymous record types when they aren't
attached to variable declaration (#104600)"
- Introduce primitives for removing records from `APISet` and managing
the record chain of `RecordContext`
- Detect nested anonymous record types and remove them from the `APISet`
after they have been fully traversed and transfer ownership of child
records to the parent context (if any)
Previously we only generated declaration fragments for template type
parameters/arguments, this adds supports for most other possible
template parameters/arguments.
rdar://127732598
This changes the handling of anonymous TagDecls to the following rules:
- If the TagDecl is embedded in the declaration for some VarDecl (this
is the only possibility for RecordDecls), then pretend the child decls
belong to the VarDecl
- If it's an EnumDecl proceed as we did previously, i.e., embed it in
the enclosing DeclContext.
Additionally this fixes a few issues with declaration fragments not
consistently including "{ ... }" for anonymous TagDecls. To make testing
these additions easier this patch fixes some text declaration fragments
merging issues and updates tests accordingly.
rdar://121436298
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.
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.
When generating declaration fragments for types that use typedefs to
pointer types ensure that we keep the user-defined typedef form instead
of desugaring the typedef.
rdar://102137655
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
As part of https://reviews.llvm.org/D154130 the logic of
LocationFileChecker changed slightly to try and get the absolute
external file path instead of the name as requested when the file was
openened which would be before VFS mappings in our usage. Ensure that we
only check against the name as requested instead of trying to generate
the external canonical file path.
rdar://115195433
Ensure that block types get represented correctly in declaration
fragments, as block parameter names are important for documentation
clients we need a separate system from getFragmentsForType in order to
have access to full ParmVarDecls for the parameters.
rdar://118257401
Other implementations of the symbol graph format use zero-based indices
for source locations, which causes problems when combined with clang's
current one-based indices. This commit sets ExtractAPI's symbol graph
output to use zero-based indices to align with other implementations.
rdar://107639783
getFragmentsForType resulted in a bool typeIdentifier fragment to be spelled "_Bool".
This fixes the spelling to be "bool" and checks it in C and C++.
Reviewed By: dang
Differential Revision: https://reviews.llvm.org/D158474
Refactor visitation for C++ record children by following the Visitor's CRTP.
Expand VisitCXXField, VisitCXXMethod for non-templates and introduce VisitCXXConstructor, VisitCXXDestructor.
Handle relationships by finding the parent's Record via USR from DeclContext.
Depends on D158029
Reviewed By: dang
Differential Revision: https://reviews.llvm.org/D158031
Visit and serialize C++ fields by checking if a var template's context is a CXXRecordDecl in VisitVarTemplateDecl.
Depends on D158027
Reviewed By: dang
Differential Revision: https://reviews.llvm.org/D158029
Visit and serialize method templates and template specializations. Introduces a new scheme of visiting child Decls via VisitCXXMethodDecl which will be followed in future patches for Fields and non-template methods.
Depends on D157579
Reviewed By: dang
Differential Revision: https://reviews.llvm.org/D158027
Add records, serialization for global function templates and their specializations
Depends on D157350
Reviewed By: dang
Differential Revision: https://reviews.llvm.org/D157579
Serialize global C++ variable templates and specializations.
Depends on D157076
Reviewed By: dang
Differential Revision: https://reviews.llvm.org/D157350
Add has_template template, DeclarationFragmentBuilder functions, and tests for class templates, specializations/partial specs, and concepts.
Depends on D157007
Reviewed By: dang
Differential Revision: https://reviews.llvm.org/D157076
Reintroduce D153557 with fix for use-after-free from f4de606ef271 and minor changes.
Reviewed By: dang
Differential Revision: https://reviews.llvm.org/D157007
Add new --emit-symbol-graph=<DIR> option which generates ExtractAPI symbol
graph information of .c/.m files on regular compilation job and put them in
the provided "DIR" directory.
Reviewed By: dang
Differential Revision: https://reviews.llvm.org/D152356