17 #ifndef LLVM_CLANG_EXTRACTAPI_SERIALIZATION_SYMBOLGRAPHSERIALIZER_H
18 #define LLVM_CLANG_EXTRACTAPI_SERIALIZATION_SYMBOLGRAPHSERIALIZER_H
22 #include "llvm/ADT/SmallVector.h"
23 #include "llvm/Support/JSON.h"
24 #include "llvm/Support/VersionTuple.h"
25 #include "llvm/Support/raw_ostream.h"
28 namespace extractapi {
38 virtual void anchor();
47 static const VersionTuple FormatVersion;
57 struct PathComponentGuard {
59 PC.emplace_back(Component);
62 ~PathComponentGuard() { PC.pop_back(); }
77 void serialize(raw_ostream &os)
override;
95 static StringRef getRelationshipString(RelationshipKind
Kind);
102 Object serializeMetadata()
const;
110 Object serializeModule()
const;
113 bool shouldSkip(
const APIRecord &Record)
const;
125 template <
typename RecordTy>
130 template <
typename MemberTy>
131 void serializeMembers(
const APIRecord &Record,
132 const SmallVector<std::unique_ptr<MemberTy>> &Members);
148 void serializeEnumRecord(
const EnumRecord &Record);
167 LLVM_NODISCARD PathComponentGuard makePathComponentGuard(StringRef Component);
178 #endif // LLVM_CLANG_EXTRACTAPI_SERIALIZATION_SYMBOLGRAPHSERIALIZER_H