aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/ExtractAPI/DeclarationFragments.cpp
AgeCommit message (Collapse)AuthorFilesLines
2022-12-13[clang][ExtractAPI] Add support for single symbol SGF and libclang supportDaniel Grumberg1-13/+18
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-08-08[clang] LLVM_FALLTHROUGH => [[fallthrough]]. NFCFangrui Song1-1/+1
With C++17 there is no Clang pedantic warning or MSVC C5051. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D131346
2022-07-27[clang][ExtractAPI] Add a space between type and name in property ↵Daniel Grumberg1-0/+1
declaration fragments Differential Revision: https://reviews.llvm.org/D130583
2022-04-07[clang][ExtractAPI] Fix declaration fragments for ObjC methodsZixu Wang1-8/+9
Objective-C methods selector parts should be considered as identifiers. Depends on D123259 Differential Revision: https://reviews.llvm.org/D123261
2022-04-07[clang][ExtractAPI] Fix appendSpace in DeclarationFragmentsZixu Wang1-2/+2
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-06[clang][extract-api] Add Objective-C Category supportZixu Wang1-0/+19
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[clang][extract-api] Add support for typedefsDaniel Grumberg1-4/+44
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-03-30[clang][extract-api] Add support for macrosDaniel Grumberg1-0/+38
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-29[clang][extract-api] Add Objective-C protocol supportZixu Wang1-0/+29
Add support for Objective-C protocol declarations in ExtractAPI. Depends on D122446 Differential Revision: https://reviews.llvm.org/D122511
2022-03-29[clang][extract-api] Add Objective-C interface supportZixu Wang1-12/+198
Add support for Objective-C interface declarations in ExtractAPI. Depends on D122495 Differential Revision: https://reviews.llvm.org/D122446
2022-03-23[clang][extract-api] Add struct supportZixu Wang1-0/+24
- 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[clang][extract-api] Add enum supportZixu Wang1-0/+29
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-22[clang][extract-api] Refactor ExtractAPI and improve docsZixu Wang1-0/+433
- 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