24 #include "llvm/Support/Error.h" 32 std::unique_ptr<Info>
reduce(std::vector<std::unique_ptr<Info>> &Values) {
33 std::unique_ptr<Info> Merged = llvm::make_unique<T>();
34 T *Tmp =
static_cast<T *
>(Merged.get());
35 for (
auto &I : Values)
36 Tmp->merge(std::move(*static_cast<T *>(I.get())));
41 llvm::Expected<std::unique_ptr<Info>>
44 return llvm::make_error<llvm::StringError>(
"No info values to merge.\n",
45 llvm::inconvertibleErrorCode());
47 switch (Values[0]->IT) {
49 return reduce<NamespaceInfo>(Values);
51 return reduce<RecordInfo>(Values);
53 return reduce<EnumInfo>(Values);
55 return reduce<FunctionInfo>(Values);
57 return llvm::make_error<llvm::StringError>(
"Unexpected info type.\n",
58 llvm::inconvertibleErrorCode());
71 std::move(Other.Description.begin(), Other.Description.end(),
76 return IT == Other.
IT && (
USR == EmptySID ||
USR == Other.
USR);
82 DefLoc = std::move(Other.DefLoc);
84 std::move(Other.Loc.begin(), Other.Loc.end(), std::back_inserter(
Loc));
96 TagType = Other.TagType;
98 Members = std::move(Other.Members);
100 Parents = std::move(Other.Parents);
101 if (VirtualParents.empty())
102 VirtualParents = std::move(Other.VirtualParents);
109 Scoped = Other.Scoped;
111 Members = std::move(Other.Members);
118 IsMethod = Other.IsMethod;
120 Access = Other.Access;
123 if (Parent.USR == EmptySID && Parent.Name ==
"")
124 Parent = std::move(Other.Parent);
126 Params = std::move(Other.Params);
SourceLocation Loc
'#' location in the include directive
llvm::SmallVector< Reference, 4 > Namespace
static const SymbolID EmptySID
std::unique_ptr< Info > reduce(std::vector< std::unique_ptr< Info >> &Values)
void merge(NamespaceInfo &&I)
bool mergeable(const Info &Other)
std::vector< CommentInfo > Description
llvm::Expected< std::unique_ptr< Info > > mergeInfos(std::vector< std::unique_ptr< Info >> &Values)
void merge(SymbolInfo &&I)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
void merge(FunctionInfo &&I)
std::array< uint8_t, 20 > SymbolID
void merge(RecordInfo &&I)