diff options
| author | Diego Astiazaran <diegoaat97@gmail.com> | 2019-08-16 00:10:49 +0000 |
|---|---|---|
| committer | Diego Astiazaran <diegoaat97@gmail.com> | 2019-08-16 00:10:49 +0000 |
| commit | ba3d595f93a45965adb4f47bfc57e28c00ba8942 (patch) | |
| tree | ee16fc68101e6222c8bb9cf10f93f994f74cf423 /clang-tools-extra/clang-doc/Representation.h | |
| parent | 76053297bd779ae13bd456c8ddbd405754ee39f2 (diff) | |
| download | bcm5719-llvm-ba3d595f93a45965adb4f47bfc57e28c00ba8942.tar.gz bcm5719-llvm-ba3d595f93a45965adb4f47bfc57e28c00ba8942.zip | |
[clang-doc] Serialize inherited attributes and methods
clang-doc now serializes the inherited attributes and methods, not only the name of the base class.
All inherited are tracked, if B:A and C:B, info of A is included in C.
This data is stored in attribute Bases in a RecordInfo.
Previously tracked inheritance data, stored in Parents and VParents, hasn't been removed to reduce review load.
Differential revision: https://reviews.llvm.org/D66238
llvm-svn: 369075
Diffstat (limited to 'clang-tools-extra/clang-doc/Representation.h')
| -rw-r--r-- | clang-tools-extra/clang-doc/Representation.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/clang-tools-extra/clang-doc/Representation.h b/clang-tools-extra/clang-doc/Representation.h index c61147ff91f..381ecd1fbe8 100644 --- a/clang-tools-extra/clang-doc/Representation.h +++ b/clang-tools-extra/clang-doc/Representation.h @@ -32,6 +32,7 @@ using SymbolID = std::array<uint8_t, 20>; struct Info; struct FunctionInfo; struct EnumInfo; +struct BaseRecordInfo; enum class InfoType { IT_default, @@ -345,15 +346,33 @@ struct RecordInfo : public SymbolInfo { llvm::SmallVector<Reference, 4> VirtualParents; // List of virtual base/parent records. - // Records are references because they will be properly - // documented in their own info, while the entirety of Functions and Enums are - // included here because they should not have separate documentation from - // their scope. + std::vector<BaseRecordInfo> + Bases; // List of base/parent records; this includes inherited methods and + // attributes + + // Records are references because they will be properly documented in their + // own info, while the entirety of Functions and Enums are included here + // because they should not have separate documentation from their scope. std::vector<Reference> ChildRecords; std::vector<FunctionInfo> ChildFunctions; std::vector<EnumInfo> ChildEnums; }; +struct BaseRecordInfo : public RecordInfo { + BaseRecordInfo() : RecordInfo() {} + BaseRecordInfo(SymbolID USR, StringRef Name, StringRef Path, bool IsVirtual, + AccessSpecifier Access, bool IsParent) + : RecordInfo(USR, Name, Path), IsVirtual(IsVirtual), Access(Access), + IsParent(IsParent) {} + + // Indicates if base corresponds to a virtual inheritance + bool IsVirtual = false; + // Access level associated with this inherited info (public, protected, + // private). + AccessSpecifier Access = AccessSpecifier::AS_public; + bool IsParent = false; // Indicates if this base is a direct parent +}; + // TODO: Expand to allow for documenting templating. // Info for types. struct EnumInfo : public SymbolInfo { |

