|
23 | 23 | // on members on the forward declaration, but would have the class name).
|
24 | 24 | //
|
25 | 25 |
|
26 |
| -#include "Index.hpp" |
27 |
| -#include "Reduce.h" |
28 | 26 | #include "Representation.h"
|
29 | 27 | #include "Namespace.hpp"
|
30 | 28 | #include <mrdox/Config.hpp>
|
31 | 29 | #include "llvm/Support/Error.h"
|
32 | 30 | #include "llvm/Support/Path.h"
|
33 | 31 |
|
34 |
| -static_assert(clang::AccessSpecifier::AS_public == 0); |
35 |
| -static_assert(clang::AccessSpecifier::AS_protected == 1); |
36 |
| -static_assert(clang::AccessSpecifier::AS_private == 2); |
37 |
| -static_assert(clang::AccessSpecifier::AS_none == 3); |
38 |
| - |
39 | 32 | namespace clang {
|
40 | 33 | namespace mrdox {
|
41 | 34 |
|
42 |
| -// Dispatch function. |
43 |
| -llvm::Expected<std::unique_ptr<Info>> |
44 |
| -mergeInfos(std::vector<std::unique_ptr<Info>>& Values) { |
45 |
| - if (Values.empty() || !Values[0]) |
46 |
| - return llvm::createStringError(llvm::inconvertibleErrorCode(), |
47 |
| - "no info values to merge"); |
48 |
| - |
49 |
| - switch (Values[0]->IT) { |
50 |
| - case InfoType::IT_namespace: |
51 |
| - return reduce<NamespaceInfo>(Values); |
52 |
| - case InfoType::IT_record: |
53 |
| - return reduce<RecordInfo>(Values); |
54 |
| - case InfoType::IT_enum: |
55 |
| - return reduce<EnumInfo>(Values); |
56 |
| - case InfoType::IT_function: |
57 |
| - return reduce<FunctionInfo>(Values); |
58 |
| - case InfoType::IT_typedef: |
59 |
| - return reduce<TypedefInfo>(Values); |
60 |
| - default: |
61 |
| - return llvm::createStringError(llvm::inconvertibleErrorCode(), |
62 |
| - "unexpected info type"); |
63 |
| - } |
64 |
| -} |
65 |
| - |
66 | 35 | bool CommentInfo::operator==(const CommentInfo& Other) const {
|
67 | 36 | auto FirstCI = std::tie(Kind, Text, Name, Direction, ParamName, CloseName,
|
68 | 37 | SelfClosing, Explicit, AttrKeys, AttrValues, Args);
|
@@ -141,33 +110,5 @@ BaseRecordInfo::BaseRecordInfo(SymbolID USR, StringRef Name, StringRef Path,
|
141 | 110 | : RecordInfo(USR, Name, Path), IsVirtual(IsVirtual), Access(Access),
|
142 | 111 | IsParent(IsParent) {}
|
143 | 112 |
|
144 |
| -// Order is based on the Name attribute: |
145 |
| -// case insensitive order |
146 |
| -bool |
147 |
| -Index::operator<(const Index& Other) const { |
148 |
| - // Loop through each character of both strings |
149 |
| - for (unsigned I = 0; I < Name.size() && I < Other.Name.size(); ++I) { |
150 |
| - // Compare them after converting both to lower case |
151 |
| - int D = tolower(Name[I]) - tolower(Other.Name[I]); |
152 |
| - if (D == 0) |
153 |
| - continue; |
154 |
| - return D < 0; |
155 |
| - } |
156 |
| - // If both strings have the size it means they would be equal if changed to |
157 |
| - // lower case. In here, lower case will be smaller than upper case |
158 |
| - // Example: string < stRing = true |
159 |
| - // This is the opposite of how operator < handles strings |
160 |
| - if (Name.size() == Other.Name.size()) |
161 |
| - return Name > Other.Name; |
162 |
| - // If they are not the same size; the shorter string is smaller |
163 |
| - return Name.size() < Other.Name.size(); |
164 |
| -} |
165 |
| - |
166 |
| -void Index::sort() { |
167 |
| - llvm::sort(Children); |
168 |
| - for (auto& C : Children) |
169 |
| - C.sort(); |
170 |
| -} |
171 |
| - |
172 | 113 | } // mrdox
|
173 | 114 | } // clang
|
0 commit comments