diff options
| author | Julie Hockett <juliehockett@google.com> | 2018-08-02 17:17:19 +0000 |
|---|---|---|
| committer | Julie Hockett <juliehockett@google.com> | 2018-08-02 17:17:19 +0000 |
| commit | 1f430693b18fdce5f0a1f21bc8c1740a8f51e523 (patch) | |
| tree | 7674ee3c9bce2379f0e479714a65c70349a20610 /clang-tools-extra/clang-doc/Serialize.h | |
| parent | 7563ebe391321ba396ca6e6d59d968b4fc1915f3 (diff) | |
| download | bcm5719-llvm-1f430693b18fdce5f0a1f21bc8c1740a8f51e523.tar.gz bcm5719-llvm-1f430693b18fdce5f0a1f21bc8c1740a8f51e523.zip | |
[clang-doc] Refactoring mapper to map by scope
The result of this adjusted mapper pass is that all Function and Enum
infos are absorbed into the info of their enclosing scope (i.e. the
class or namespace in which they are defined). Namespace and Record
infos are passed along to the final output, but the second pass creates
a reference to each in its parent scope. As a result, the top-level final
outputs are Namespaces and Records.
llvm-svn: 338738
Diffstat (limited to 'clang-tools-extra/clang-doc/Serialize.h')
| -rw-r--r-- | clang-tools-extra/clang-doc/Serialize.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/clang-tools-extra/clang-doc/Serialize.h b/clang-tools-extra/clang-doc/Serialize.h index 5181cf61be3..d89dac80922 100644 --- a/clang-tools-extra/clang-doc/Serialize.h +++ b/clang-tools-extra/clang-doc/Serialize.h @@ -28,16 +28,16 @@ namespace clang { namespace doc { namespace serialize { -std::string emitInfo(const NamespaceDecl *D, const FullComment *FC, - int LineNumber, StringRef File, bool PublicOnly); -std::string emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber, - StringRef File, bool PublicOnly); -std::string emitInfo(const EnumDecl *D, const FullComment *FC, int LineNumber, - StringRef File, bool PublicOnly); -std::string emitInfo(const FunctionDecl *D, const FullComment *FC, - int LineNumber, StringRef File, bool PublicOnly); -std::string emitInfo(const CXXMethodDecl *D, const FullComment *FC, - int LineNumber, StringRef File, bool PublicOnly); +std::unique_ptr<Info> emitInfo(const NamespaceDecl *D, const FullComment *FC, + int LineNumber, StringRef File, bool PublicOnly); +std::unique_ptr<Info> emitInfo(const RecordDecl *D, const FullComment *FC, + int LineNumber, StringRef File, bool PublicOnly); +std::unique_ptr<Info> emitInfo(const EnumDecl *D, const FullComment *FC, + int LineNumber, StringRef File, bool PublicOnly); +std::unique_ptr<Info> emitInfo(const FunctionDecl *D, const FullComment *FC, + int LineNumber, StringRef File, bool PublicOnly); +std::unique_ptr<Info> emitInfo(const CXXMethodDecl *D, const FullComment *FC, + int LineNumber, StringRef File, bool PublicOnly); // Function to hash a given USR value for storage. // As USRs (Unified Symbol Resolution) could be large, especially for functions @@ -46,6 +46,8 @@ std::string emitInfo(const CXXMethodDecl *D, const FullComment *FC, // memory (vs storing USRs directly). SymbolID hashUSR(llvm::StringRef USR); +std::string serialize(std::unique_ptr<Info> &I); + } // namespace serialize } // namespace doc } // namespace clang |

