Commit Graph

10 Commits

Author SHA1 Message Date
Zixu Wang 4048aad85a [clang][ExtractAPI] Fix declaration fragments for ObjC methods
Objective-C methods selector parts should be considered as identifiers.

Depends on D123259

Differential Revision: https://reviews.llvm.org/D123261
2022-04-07 10:22:41 -07:00
Zixu Wang fe2c77a006 [clang][ExtractAPI] Fix appendSpace in DeclarationFragments
There is a bug in `DeclarationFragments::appendSpace` where the space
character is added to a local copy of the last fragment.

Differential Revision: https://reviews.llvm.org/D123259
2022-04-07 09:17:30 -07:00
Zixu Wang 178aad9b94 [clang][extract-api] Add Objective-C Category support
Add (partial) support for Objective-C category records in ExtractAPI.
The current ExtractAPI collects everything for an Objective-C category,
but not fully serialized in the SymbolGraphSerializer. Categories
extending external interfaces are disgarded during serialization, and
categories extending known interfaces are merged (all members surfaced)
into the interfaces.

Differential Revision: https://reviews.llvm.org/D122774
2022-04-06 12:00:12 -07:00
Daniel Grumberg 9fc45ca00a [clang][extract-api] Add support for typedefs
Typedef records consist of the symbol associated with the underlying
TypedefDecl and a SymbolReference to the underlying type. Additionally
typedefs for anonymous TagTypes use the typedef'd name as the symbol
name in their respective records and USRs. As a result the declaration
fragments for the anonymous TagType are those for the associated
typedef. This means that when the user is defining a typedef to a
typedef to a anonymous type, we use a reference the anonymous TagType
itself and do not emit the typedef to the anonymous type in the
generated symbol graph, including in the type destination of further
typedef symbol records.

Differential Revision: https://reviews.llvm.org/D123019
2022-04-06 19:14:05 +01:00
Daniel Grumberg 529a0570f7 [clang][extract-api] Add support for macros
To achieve this we hook into the preprocessor during the
ExtractAPIAction and record definitions for macros that don't get
undefined during preprocessing.
2022-03-30 18:33:10 +01:00
Zixu Wang d1d34bafef [clang][extract-api] Add Objective-C protocol support
Add support for Objective-C protocol declarations in ExtractAPI.

Depends on D122446

Differential Revision: https://reviews.llvm.org/D122511
2022-03-29 14:44:49 -07:00
Zixu Wang 9b36e126fd [clang][extract-api] Add Objective-C interface support
Add support for Objective-C interface declarations in ExtractAPI.

Depends on D122495

Differential Revision: https://reviews.llvm.org/D122446
2022-03-29 14:29:39 -07:00
Zixu Wang 5bb5704c1b [clang][extract-api] Add struct support
- Add `StructFieldRecord` and `StructRecord` to store API information
  for structs
- Implement `VisitRecordDecl` in `ExtractAPIVisitor`
- Implement Symbol Graph serialization for struct records.
- Add test case for struct records.

Depends on D121873

Differential Revision: https://reviews.llvm.org/D122202
2022-03-23 09:45:06 -07:00
Zixu Wang 71b4c22612 [clang][extract-api] Add enum support
Add support for enum records
- Add `EnumConstantRecord` and `EnumRecord` to store API information for
  enums
- Implement `VisitEnumDecl` in `ExtractAPIVisitor`
- Implement serializatin for enum records and `MemberOf` relationship
- Add test case for enum records
- Few other improvements

Depends on D122160

Differential Revision: https://reviews.llvm.org/D121873
2022-03-23 09:41:21 -07:00
Zixu Wang 89f6b26f1b [clang][extract-api] Refactor ExtractAPI and improve docs
- The name SymbolGraph is inappropriate and confusing for the new library
  for clang-extract-api. Refactor and rename things to make it clear that
  ExtractAPI is the core functionality and SymbolGraph is one serializer
  for the API information.
- Add documentation comments to ExtractAPI classes and methods to improve
  readability and clearness of the ExtractAPI work.

Differential Revision: https://reviews.llvm.org/D122160
2022-03-22 13:21:57 -07:00