summaryrefslogtreecommitdiff
path: root/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
AgeCommit message (Collapse)Author
2022-12-03[clang] Use std::nullopt instead of None (NFC)Kazu Hirata
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-08Fix duplicate word typos; NFCRageking8
This revision fixes typos where there are 2 consecutive words which are duplicated. There should be no code changes in this revision (only changes to comments and docs). Do let me know if there are any undesirable changes in this revision. Thanks.
2022-11-07Revert "Only add targetFallback if target is not in defined in current product"Daniel Grumberg
This was an accidental addition of a non-reviewed change. This reverts commit f63db9159bbbb0db98e13cb4440fdaa5c40e219b.
2022-11-07Only add targetFallback if target is not in defined in current productDaniel Grumberg
2022-11-07[clang][ExtractAPI] Add targetFallback to relationships in symbol graphDaniel Grumberg
Adds a 'targetFallback' field to relationships in symbol graph that contains the plain name of the relationship target. This is useful for clients when the relationship target symbol is not available. Differential Revision: https://reviews.llvm.org/D136455
2022-10-25[clang][ExtractAPI] Allow users to specify a list of symbols to ignoreDaniel Grumberg
Adds a `--extract-api-ignores=` command line option that allows users to provide a file containing a new line separated list of symbols to unconditionally ignore when extracting API information. Differential Revision: https://reviews.llvm.org/D136450
2022-08-19[clang][ExtractAPI] Record availability information on all platformsDaniel Grumberg
Currently ExtractAPI only emits availability information for the current platform. This makes it easy for clients to get all availability information for a given symbol in one invocation as opposed to having to invoke clang once per-platform and then merge the symbol-graphs. Differential Revision: https://reviews.llvm.org/D130918
2022-08-07clang: fix typo availbilityAarush Bhat
- Fixes [[ https://github.com/llvm/llvm-project/issues/56787 | #56787 ]]. I am fixing the spelling of availability. I am unsure if this change will have any side effects. If someone can help on how to check if it has any side effects, I can test those out as well. Reviewed By: inclyc Differential Revision: https://reviews.llvm.org/D131277
2022-08-01Fixed a number of typosGabriel Ravier
I went over the output of the following mess of a command: (ulimit -m 2000000; ulimit -v 2000000; git ls-files -z | parallel --xargs -0 cat | aspell list --mode=none --ignore-case | grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n | grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less) and proceeded to spend a few days looking at it to find probable typos and fixed a few hundred of them in all of the llvm project (note, the ones I found are not anywhere near all of them, but it seems like a good start). Differential Revision: https://reviews.llvm.org/D130827
2022-07-27[clang][ExtractAPI] Ensure that class properties have a kind of "Type Property"Daniel Grumberg
Generated symbol graphs should distinguish between type properties and instance properties. Differential Revision: https://reviews.llvm.org/D130581
2022-07-13[clang] Use value instead of getValue (NFC)Kazu Hirata
2022-06-25Revert "Don't use Optional::hasValue (NFC)"Kazu Hirata
This reverts commit aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.
2022-06-25Don't use Optional::hasValue (NFC)Kazu Hirata
2022-06-18[clang] Use value_or instead of getValueOr (NFC)Kazu Hirata
2022-05-25[clang][extract-api] Don't emit symbols prefixed with an underscoreDaniel Grumberg
These symbols are understood to not be used for client API consumption by convention so they should not appear in the generated symbol graph. Differential Revision: https://reviews.llvm.org/D125678
2022-04-11[clang][extract-api] Emit "functionSignature" in SGF for ObjC methods.Daniel Grumberg
- Split GlobalRecord into two distinct types to be able to introduce has_function_signature type trait. - Add has_function_signature type trait. - Serialize function signatures as part of serializeAPIRecord for records that are known to have a function signature. Differential Revision: https://reviews.llvm.org/D123304
2022-04-08[clang][extract-api] Emit "navigator" property of "name" in SymbolGraphDaniel Grumberg
Differential Revision: https://reviews.llvm.org/D123391
2022-04-06[clang][extract-api] Add Objective-C Category supportZixu Wang
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 Grumberg
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[clang][extract-api] Fix small issues with SymbolGraphSerializerDaniel Grumberg
This includes: - replacing "relationhips" with "relationships" - emitting the "pathComponents" property on symbols - emitting the "accessLevel" property on symbols Differential Revision: https://reviews.llvm.org/D123045
2022-03-30[clang][extract-api] Add support for macrosDaniel Grumberg
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 Wang
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 Wang
Add support for Objective-C interface declarations in ExtractAPI. Depends on D122495 Differential Revision: https://reviews.llvm.org/D122446
2022-03-29[clang][extract-api] Use correct language info from inputsZixu Wang
The current way of getting the `clang::Language` from `LangOptions` does not handle Objective-C correctly because `clang::Language::ObjC` does not correspond to any `LangStandard`. This patch passes the correct `Language` from the frontend input information. Differential Revision: https://reviews.llvm.org/D122495
2022-03-28Add HLSL Language Option and PreprocessorChris Bieneman
Bringing in HLSL as a language as well as language options for each of the HLSL language standards. While the HLSL language is unimplemented, this patch adds the HLSL-specific preprocessor defines which enables testing of the command line options through the driver. Reviewed By: pete, rnk Differential Revision: https://reviews.llvm.org/D122087
2022-03-24[NFC][clang][extract-api] Rename variableZixu Wang
Rename a local variable name to avoid potential ambiguity/conflict for some compilers.
2022-03-23[clang][extract-api] Add struct supportZixu Wang
- 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 Wang
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[clang][extract-api] Suppprt for the module name property in SymbolGraphDaniel Grumberg
Adds `--product-name=` flag to the clang driver. This gets forwarded to cc1 only when we are performing a ExtractAPI Action. This is used to populate the `name` field of the module object in the generated SymbolGraph. Differential Revision: https://reviews.llvm.org/D122141
2022-03-22[NFC][clang][extract-api] Use proper name string for Objective-C languageZixu Wang
Change the Symbol Graph serializer for ExtractAPI to use `objective-c` for the language name string for Objective-C, to align with clang frontend standards.
2022-03-22[clang][extract-api] Refactor ExtractAPI and improve docsZixu Wang
- 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