summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-doc/Serialize.h
diff options
context:
space:
mode:
authorJulie Hockett <juliehockett@google.com>2018-03-12 17:05:14 +0000
committerJulie Hockett <juliehockett@google.com>2018-03-12 17:05:14 +0000
commit93be22f418891473ffd4f67f54780b41605d9d16 (patch)
tree43f2116731f426524dede33fba21d4310cc2eedf /clang-tools-extra/clang-doc/Serialize.h
parentbe7daa3d50e8a65e6bba6b522768ca225b818c39 (diff)
downloadbcm5719-llvm-93be22f418891473ffd4f67f54780b41605d9d16.tar.gz
bcm5719-llvm-93be22f418891473ffd4f67f54780b41605d9d16.zip
Reland "[clang-doc] Setup clang-doc frontend framework"
There was a missing newline in the docs, and a static_assert that needed to be a normal assert. llvm-svn: 327295
Diffstat (limited to 'clang-tools-extra/clang-doc/Serialize.h')
-rw-r--r--clang-tools-extra/clang-doc/Serialize.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-doc/Serialize.h b/clang-tools-extra/clang-doc/Serialize.h
new file mode 100644
index 00000000000..5f13798bcdf
--- /dev/null
+++ b/clang-tools-extra/clang-doc/Serialize.h
@@ -0,0 +1,53 @@
+//===-- Serializer.h - ClangDoc Serializer ----------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the serializing functions fro the clang-doc tool. Given
+// a particular declaration, it collects the appropriate information and returns
+// a serialized bitcode string for the declaration.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_SERIALIZE_H
+#define LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_SERIALIZE_H
+
+#include "Representation.h"
+#include "clang/AST/AST.h"
+#include "clang/AST/CommentVisitor.h"
+#include <string>
+#include <vector>
+
+using namespace clang::comments;
+
+namespace clang {
+namespace doc {
+namespace serialize {
+
+std::string emitInfo(const NamespaceDecl *D, const FullComment *FC,
+ int LineNumber, StringRef File);
+std::string emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber,
+ StringRef File);
+std::string emitInfo(const EnumDecl *D, const FullComment *FC, int LineNumber,
+ StringRef File);
+std::string emitInfo(const FunctionDecl *D, const FullComment *FC,
+ int LineNumber, StringRef File);
+std::string emitInfo(const CXXMethodDecl *D, const FullComment *FC,
+ int LineNumber, StringRef File);
+
+// Function to hash a given USR value for storage.
+// As USRs (Unified Symbol Resolution) could be large, especially for functions
+// with long type arguments, we use 160-bits SHA1(USR) values to
+// guarantee the uniqueness of symbols while using a relatively small amount of
+// memory (vs storing USRs directly).
+SymbolID hashUSR(llvm::StringRef USR);
+
+} // namespace serialize
+} // namespace doc
+} // namespace clang
+
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_DOC_SERIALIZE_H
OpenPOWER on IntegriCloud