Skip to content

Commit 778861b

Browse files
committed
refactor includes
1 parent 7115b7d commit 778861b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+386
-476
lines changed

Diff for: include/mrdox/Corpus.hpp

+3-12
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
#ifndef MRDOX_CORPUS_HPP
1313
#define MRDOX_CORPUS_HPP
1414

15-
#include "Index.hpp"
1615
#include <mrdox/Config.hpp>
16+
#include <mrdox/MetadataFwd.hpp>
1717
#include <mrdox/Reporter.hpp>
18+
#include <mrdox/meta/Index.hpp>
19+
#include <mrdox/meta/Types.hpp>
1820
#include <clang/Tooling/Execution.h>
1921
#include <llvm/Support/Mutex.h>
2022
#include <type_traits>
@@ -23,15 +25,6 @@
2325
namespace clang {
2426
namespace mrdox {
2527

26-
struct Info;
27-
struct Scope;
28-
struct MemberTypeInfo;
29-
struct NamespaceInfo;
30-
struct RecordInfo;
31-
struct FunctionInfo;
32-
struct EnumInfo;
33-
struct TypedefInfo;
34-
3528
/** The collection of declarations in extracted form.
3629
*/
3730
class Corpus
@@ -217,8 +210,6 @@ class Corpus
217210
bool canonicalize(std::vector<Reference>& list, Temps& t, Reporter& R);
218211
bool canonicalize(llvm::SmallVectorImpl<MemberTypeInfo>& list, Temps& t, Reporter& R);
219212

220-
221-
222213
private:
223214
llvm::sys::Mutex infoMutex;
224215
llvm::sys::Mutex allSymbolsMutex;

Diff for: include/mrdox/Error.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#define MRDOX_ERROR_HPP
1414

1515
#include <mrdox/detail/nice.hpp>
16-
#include <llvm/ADT/StringRef.h>
1716
#include <llvm/Support/Error.h>
17+
#include <llvm/Support/raw_ostream.h>
1818
#include <source_location>
1919
#include <string>
2020

Diff for: include/mrdox/Metadata.hpp

+20-13
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,26 @@
1212
#ifndef MRDOX_METADATA_HPP
1313
#define MRDOX_METADATA_HPP
1414

15-
#include "Representation.h"
15+
// All headers related to
16+
// metadata extracted from AST
1617

17-
#include <mrdox/Config.hpp>
18-
#include <mrdox/Corpus.hpp>
19-
#include <mrdox/Function.hpp>
20-
#include <mrdox/Info.hpp>
21-
#include <mrdox/Namespace.hpp>
22-
#include <mrdox/Scope.hpp>
23-
#include <mrdox/Symbol.hpp>
24-
#include <mrdox/Template.hpp>
25-
#include <mrdox/TemplateParam.hpp>
26-
#include <mrdox/Type.hpp>
27-
#include <mrdox/Typedef.hpp>
28-
#include <mrdox/Types.hpp>
18+
#include <mrdox/meta/Enum.hpp>
19+
#include <mrdox/meta/FieldType.hpp>
20+
#include <mrdox/meta/Function.hpp>
21+
#include <mrdox/meta/Index.hpp>
22+
#include <mrdox/meta/Info.hpp>
23+
#include <mrdox/meta/Javadoc.hpp>
24+
#include <mrdox/meta/Location.hpp>
25+
#include <mrdox/meta/MemberType.hpp>
26+
#include <mrdox/meta/Namespace.hpp>
27+
#include <mrdox/meta/Record.hpp>
28+
#include <mrdox/meta/Reference.hpp>
29+
#include <mrdox/meta/Scope.hpp>
30+
#include <mrdox/meta/Symbol.hpp>
31+
#include <mrdox/meta/Template.hpp>
32+
#include <mrdox/meta/TemplateParam.hpp>
33+
#include <mrdox/meta/Type.hpp>
34+
#include <mrdox/meta/Typedef.hpp>
35+
#include <mrdox/meta/Types.hpp>
2936

3037
#endif

Diff for: include/mrdox/ForwardDecls.hpp renamed to include/mrdox/MetadataFwd.hpp

+17-7
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,39 @@
99
// Official repository: https://github.com/cppalliance/mrdox
1010
//
1111

12-
#ifndef MRDOX_FORWARD_DECLS_HPP
13-
#define MRDOX_FORWARD_DECLS_HPP
12+
#ifndef MRDOX_METADATA_FWD_HPP
13+
#define MRDOX_METADATA_FWD_HPP
14+
15+
// Forward declarations for all types
16+
// related to metadata extracted from AST
17+
18+
#include <mrdox/meta/Types.hpp>
1419

1520
namespace clang {
1621
namespace mrdox {
1722

18-
class Config;
19-
class Corpus;
20-
2123
struct BaseRecordInfo;
24+
struct CommentInfo;
25+
struct EnumValueInfo;
2226
struct EnumInfo;
2327
struct FieldTypeInfo;
2428
struct FunctionInfo;
29+
struct Index;
2530
struct Info;
31+
struct Javadoc;
2632
struct Location;
33+
struct MemberTypeInfo;
2734
struct NamespaceInfo;
2835
struct RecordInfo;
36+
struct Reference;
2937
struct Scope;
3038
struct SymbolInfo;
39+
struct TemplateInfo;
3140
struct TemplateParamInfo;
41+
struct TemplateSpecializationInfo;
42+
struct TypeInfo;
3243
struct TypedefInfo;
33-
34-
struct Reporter;
44+
struct VerbatimBlock;
3545

3646
} // mrdox
3747
} // clang

Diff for: include/mrdox/Reporter.hpp

-8
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,17 @@
1414

1515
#include <mrdox/detail/nice.hpp>
1616
#include <llvm/Support/Error.h>
17-
#include <llvm/Support/Format.h>
1817
#include <llvm/Support/Mutex.h>
1918
#include <llvm/Support/raw_ostream.h>
2019
#include <cassert>
2120
#include <source_location>
2221
#include <string>
23-
#include <string_view>
2422
#include <system_error>
2523
#include <type_traits>
2624

2725
namespace clang {
2826
namespace mrdox {
2927

30-
//------------------------------------------------
31-
//
32-
// Reporter
33-
//
34-
//------------------------------------------------
35-
3628
/** Used to check and report errors uniformly.
3729
*/
3830
struct Reporter

Diff for: include/mrdox/FlatWriter.hpp renamed to include/mrdox/format/FlatWriter.hpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
// Official repository: https://github.com/cppalliance/mrdox
1010
//
1111

12-
#ifndef MRDOX_FLAT_WRITER_HPP
13-
#define MRDOX_FLAT_WRITER_HPP
12+
#ifndef MRDOX_FLATWRITER_HPP
13+
#define MRDOX_FLATWRITER_HPP
1414

15-
#include <mrdox/Info.hpp>
16-
#include <mrdox/Reporter.hpp>
15+
#include <mrdox/MetadataFwd.hpp>
1716
#include <llvm/ADT/StringRef.h>
1817
#include <llvm/Support/raw_ostream.h>
1918
#include <string>
File renamed without changes.

Diff for: include/mrdox/OverloadSet.hpp renamed to include/mrdox/format/OverloadSet.hpp

+8-31
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,18 @@
99
// Official repository: https://github.com/cppalliance/mrdox
1010
//
1111

12+
#ifndef MRDOX_META_OVERLOADSET_HPP
13+
#define MRDOX_META_OVERLOADSET_HPP
14+
15+
#include <mrdox/meta/Function.hpp>
16+
#include <llvm/ADT/StringRef.h>
1217
#include <functional>
1318

1419
namespace clang {
1520
namespace mrdox {
1621

1722
class Corpus;
18-
struct FunctionInfo;
19-
20-
/*
21-
struct OverloadSet
22-
{
23-
struct Overloads
24-
{
25-
llvm::StringRef name;
26-
std::vector<FunctionInfo const*> overloads;
27-
};
28-
29-
AccessSpecifier access; // public, protected, private
30-
std::vector<Overloads> list;
31-
};
32-
33-
void
34-
BasicWriter::
35-
writeClass(
36-
ClassInfo const& I)
37-
{
38-
beginClass( I.TagType, I.Name );
39-
//...
40-
OverloadSet list = buildOverloadSet(
41-
I.Children.Functions, AccessSpecifier::AS_public );
42-
writeOverloadSet( list );
43-
//
44-
endClass();
45-
}
46-
*/
47-
48-
//------------------------------------------------
23+
struct Scope;
4924

5025
struct OverloadSet
5126
{
@@ -61,3 +36,5 @@ makeOverloadSet(
6136

6237
} // mrdox
6338
} // clang
39+
40+
#endif

Diff for: include/mrdox/RecursiveWriter.hpp renamed to include/mrdox/format/RecursiveWriter.hpp

+4-11
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
// Official repository: https://github.com/cppalliance/mrdox
1010
//
1111

12-
#ifndef MRDOX_RECURSIVE_WRITER_HPP
13-
#define MRDOX_RECURSIVE_WRITER_HPP
12+
#ifndef MRDOX_RECURSIVEWRITER_HPP
13+
#define MRDOX_RECURSIVEWRITER_HPP
1414

15-
#include <mrdox/Info.hpp>
15+
#include <mrdox/MetadataFwd.hpp>
16+
#include <mrdox/meta/Types.hpp>
1617
#include <mrdox/Reporter.hpp>
1718
#include <llvm/ADT/StringRef.h>
1819
#include <llvm/Support/raw_ostream.h>
@@ -21,16 +22,8 @@
2122
namespace clang {
2223
namespace mrdox {
2324

24-
//------------------------------------------------
25-
2625
class Corpus;
2726
class Config;
28-
struct NamespaceInfo;
29-
struct RecordInfo;
30-
struct FunctionInfo;
31-
struct EnumInfo;
32-
struct TypedefInfo;
33-
struct Scope;
3427

3528
//------------------------------------------------
3629

Diff for: source/lib/Enum.hpp renamed to include/mrdox/meta/Enum.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
// types for the clang-doc tool.
1515
//
1616

17-
#ifndef MRDOX_ENUM_HPP
18-
#define MRDOX_ENUM_HPP
17+
#ifndef MRDOX_META_ENUM_HPP
18+
#define MRDOX_META_ENUM_HPP
1919

20-
#include <mrdox/Symbol.hpp>
21-
#include <mrdox/Type.hpp>
20+
#include <mrdox/meta/Symbol.hpp>
21+
#include <mrdox/meta/Type.hpp>
2222
#include <llvm/ADT/Optional.h>
2323
#include <llvm/ADT/SmallString.h>
2424
#include <llvm/ADT/SmallVector.h>

Diff for: include/mrdox/FieldType.hpp renamed to include/mrdox/meta/FieldType.hpp

+3-8
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@
99
// Official repository: https://github.com/cppalliance/mrdox
1010
//
1111

12-
//
13-
// This file defines the internal representations of different declaration
14-
// types for the clang-doc tool.
15-
//
16-
17-
#ifndef MRDOX_FIELDTYPE_HPP
18-
#define MRDOX_FIELDTYPE_HPP
12+
#ifndef MRDOX_META_FIELDTYPE_HPP
13+
#define MRDOX_META_FIELDTYPE_HPP
1914

20-
#include <mrdox/Type.hpp>
15+
#include <mrdox/meta/Type.hpp>
2116
#include <llvm/ADT/SmallString.h>
2217
#include <utility>
2318

Diff for: include/mrdox/Function.hpp renamed to include/mrdox/meta/Function.hpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
#ifndef MRDOX_FUNCTION_HPP
1313
#define MRDOX_FUNCTION_HPP
1414

15-
#include <mrdox/FieldType.hpp>
16-
#include <mrdox/Function.hpp>
17-
#include "List.hpp"
18-
#include <mrdox/Symbol.hpp>
19-
#include <mrdox/Template.hpp>
20-
#include <mrdox/Types.hpp>
15+
#include <mrdox/meta/FieldType.hpp>
16+
#include <mrdox/meta/Function.hpp>
17+
#include <mrdox/meta/Symbol.hpp>
18+
#include <mrdox/meta/Template.hpp>
19+
#include <mrdox/meta/Types.hpp>
2120
#include <clang/Basic/Specifiers.h>
2221
#include <llvm/ADT/Optional.h>
2322
#include <llvm/ADT/SmallString.h>

Diff for: source/lib/Index.hpp renamed to include/mrdox/meta/Index.hpp

+4-10
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
// Official repository: https://github.com/cppalliance/mrdox
1010
//
1111

12-
#ifndef MRDOX_INDEX_HPP
13-
#define MRDOX_INDEX_HPP
12+
#ifndef MRDOX_META_INDEX_HPP
13+
#define MRDOX_META_INDEX_HPP
1414

15-
#include <mrdox/Info.hpp>
16-
#include "Reference.hpp"
15+
#include <mrdox/meta/Info.hpp>
16+
#include <mrdox/meta/Reference.hpp>
1717
#include <llvm/ADT/Optional.h>
1818
#include <llvm/ADT/SmallString.h>
1919
#include <llvm/ADT/StringRef.h>
@@ -64,12 +64,6 @@ struct Index : Reference
6464
void sort();
6565
};
6666

67-
// A standalone function to call to merge a vector of infos into one.
68-
// This assumes that all infos in the vector are of the same type, and will fail
69-
// if they are different.
70-
llvm::Expected<std::unique_ptr<Info>>
71-
mergeInfos(std::vector<std::unique_ptr<Info>>& Values);
72-
7367
} // mrdox
7468
} // clang
7569

Diff for: include/mrdox/Info.hpp renamed to include/mrdox/meta/Info.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
#ifndef MRDOX_INFO_HPP
1313
#define MRDOX_INFO_HPP
1414

15-
#include "Javadoc.hpp"
16-
#include "Reference.hpp"
17-
#include <mrdox/Types.hpp>
15+
#include <mrdox/meta/Javadoc.hpp>
16+
#include <mrdox/meta/Reference.hpp>
17+
#include <mrdox/meta/Types.hpp>
1818
#include <llvm/ADT/StringRef.h>
1919
#include <llvm/ADT/SmallString.h>
2020
#include <llvm/ADT/SmallVector.h>

Diff for: source/lib/Javadoc.hpp renamed to include/mrdox/meta/Javadoc.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// Official repository: https://github.com/cppalliance/mrdox
1010
//
1111

12-
#ifndef MRDOX_JAVADOC_HPP
13-
#define MRDOX_JAVADOC_HPP
12+
#ifndef MRDOX_META_JAVADOC_HPP
13+
#define MRDOX_META_JAVADOC_HPP
1414

1515
#include <llvm/ADT/SmallString.h>
1616
#include <string>
File renamed without changes.

Diff for: source/lib/MemberType.hpp renamed to include/mrdox/meta/MemberType.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
// Official repository: https://github.com/cppalliance/mrdox
1010
//
1111

12-
#ifndef MRDOX_MEMBERTYPE_HPP
13-
#define MRDOX_MEMBERTYPE_HPP
12+
#ifndef MRDOX_META_MEMBERTYPE_HPP
13+
#define MRDOX_META_MEMBERTYPE_HPP
1414

15-
#include <mrdox/FieldType.hpp>
16-
#include <mrdox/Function.hpp>
17-
#include "Javadoc.hpp"
15+
#include <mrdox/meta/Javadoc.hpp>
16+
#include <mrdox/meta/FieldType.hpp>
17+
#include <mrdox/meta/Function.hpp>
1818

1919
namespace clang {
2020
namespace mrdox {

0 commit comments

Comments
 (0)