Skip to content

Commit bbfb0f8

Browse files
committed
remove Path from meta
1 parent 51bf725 commit bbfb0f8

27 files changed

+136
-521
lines changed

include/mrdox/Corpus.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <mrdox/Config.hpp>
1616
#include <mrdox/MetadataFwd.hpp>
1717
#include <mrdox/Reporter.hpp>
18-
#include <mrdox/meta/Index.hpp>
1918
#include <mrdox/meta/Symbols.hpp>
2019
#include <clang/Tooling/Execution.h>
2120
#include <llvm/Support/Mutex.h>

include/mrdox/Metadata.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
// All headers related to
1616
// metadata extracted from AST
1717

18+
#include <mrdox/meta/BaseRecord.hpp>
1819
#include <mrdox/meta/Enum.hpp>
1920
#include <mrdox/meta/FieldType.hpp>
2021
#include <mrdox/meta/Function.hpp>
2122
#include <mrdox/meta/Overloads.hpp>
22-
#include <mrdox/meta/Index.hpp>
2323
#include <mrdox/meta/Info.hpp>
2424
#include <mrdox/meta/Javadoc.hpp>
2525
#include <mrdox/meta/Location.hpp>

include/mrdox/MetadataFwd.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ struct FieldTypeInfo;
2727
struct FunctionInfo;
2828
struct Overloads;
2929
struct OverloadsSet;
30-
struct Index;
3130
struct Info;
3231
struct Javadoc;
3332
struct Location;

include/mrdox/meta/BaseRecord.hpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//
2+
// This is a derivative work. originally part of the LLVM Project.
3+
// Licensed under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
// Copyright (c) 2023 Vinnie Falco ([email protected])
8+
//
9+
// Official repository: https://github.com/cppalliance/mrdox
10+
//
11+
12+
#ifndef MRDOX_META_BASERECORD_HPP
13+
#define MRDOX_META_BASERECORD_HPP
14+
15+
#include <mrdox/meta/Record.hpp>
16+
17+
namespace clang {
18+
namespace mrdox {
19+
20+
struct BaseRecordInfo : public RecordInfo
21+
{
22+
BaseRecordInfo();
23+
24+
BaseRecordInfo(
25+
SymbolID USR,
26+
llvm::StringRef Name,
27+
bool IsVirtual,
28+
AccessSpecifier Access,
29+
bool IsParent);
30+
31+
// Indicates if base corresponds to a virtual inheritance
32+
bool IsVirtual = false;
33+
34+
// Access level associated with this inherited info (public, protected,
35+
// private).
36+
AccessSpecifier Access = AccessSpecifier::AS_public;
37+
38+
bool IsParent = false; // Indicates if this base is a direct parent
39+
};
40+
41+
} // mrdox
42+
} // clang
43+
44+
#endif

include/mrdox/meta/Index.hpp

Lines changed: 0 additions & 70 deletions
This file was deleted.

include/mrdox/meta/Info.hpp

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ struct Info
4949
*/
5050
Javadoc javadoc;
5151

52-
// Path of directory where the clang-doc
53-
// generated file will be saved
54-
llvm::SmallString<128> Path;
55-
56-
std::string mangledName;
57-
5852
//--------------------------------------------
5953

6054
virtual ~Info() = default;
@@ -65,25 +59,21 @@ struct Info
6559
Info(
6660
InfoType IT = InfoType::IT_default,
6761
SymbolID USR = SymbolID(),
68-
llvm::StringRef Name = llvm::StringRef(),
69-
llvm::StringRef Path = llvm::StringRef())
62+
llvm::StringRef Name = llvm::StringRef())
7063
: USR(USR)
7164
, IT(IT)
7265
, Name(Name)
73-
, Path(Path)
7466
{
7567
}
7668

7769
bool canMerge(const Info& Other);
7870
void mergeBase(Info&& I);
7971

80-
llvm::SmallString<16> extractName() const;
81-
82-
/// Returns the file path for this Info relative to CurrentPath.
83-
llvm::SmallString<64> getRelativeFilePath(llvm::StringRef const& CurrentPath) const;
72+
//
73+
// Observers
74+
//
8475

85-
/// Returns the basename that should be used for this Info.
86-
//llvm::SmallString<16> getFileBaseName() const;
76+
llvm::SmallString<16> extractName() const;
8777

8878
/** Return the fully qualified name.
8979
*/
@@ -93,30 +83,12 @@ struct Info
9383

9484
/** Return a string representing the symbol type.
9585
96-
This will be one of:
97-
98-
@li default
99-
@li namespace
100-
@li class
101-
@li struct
102-
@li union
103-
@li function
104-
@li enum
105-
@li typedef
86+
For example, "namespace", "class", et. al.
10687
*/
10788
llvm::StringRef
10889
symbolType() const noexcept;
10990
};
11091

111-
//------------------------------------------------
112-
113-
llvm::SmallString<64>
114-
calculateRelativeFilePath(
115-
InfoType const& Type,
116-
llvm::StringRef const& Path,
117-
llvm::StringRef const& Name,
118-
llvm::StringRef const& CurrentPath);
119-
12092
} // mrdox
12193
} // clang
12294

include/mrdox/meta/Namespace.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ struct NamespaceInfo
3131

3232
NamespaceInfo(
3333
SymbolID USR,
34-
llvm::StringRef Name = llvm::StringRef(),
35-
llvm::StringRef Path = llvm::StringRef());
34+
llvm::StringRef Name = llvm::StringRef());
3635

3736
void merge(NamespaceInfo&& I);
3837
};

include/mrdox/meta/Record.hpp

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ struct RecordInfo : SymbolInfo
3737

3838
RecordInfo(
3939
SymbolID USR = SymbolID(),
40-
llvm::StringRef Name = llvm::StringRef(),
41-
llvm::StringRef Path = llvm::StringRef());
40+
llvm::StringRef Name = llvm::StringRef());
4241

4342
void merge(RecordInfo&& I);
4443

@@ -68,30 +67,6 @@ struct RecordInfo : SymbolInfo
6867
Scope Children;
6968
};
7069

71-
//------------------------------------------------
72-
73-
struct BaseRecordInfo : public RecordInfo
74-
{
75-
BaseRecordInfo();
76-
77-
BaseRecordInfo(
78-
SymbolID USR,
79-
llvm::StringRef Name,
80-
llvm::StringRef Path,
81-
bool IsVirtual,
82-
AccessSpecifier Access,
83-
bool IsParent);
84-
85-
// Indicates if base corresponds to a virtual inheritance
86-
bool IsVirtual = false;
87-
88-
// Access level associated with this inherited info (public, protected,
89-
// private).
90-
AccessSpecifier Access = AccessSpecifier::AS_public;
91-
92-
bool IsParent = false; // Indicates if this base is a direct parent
93-
};
94-
9570
} // mrdox
9671
} // clang
9772

include/mrdox/meta/Reference.hpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ struct Reference
3535
*/
3636
InfoType RefType = InfoType::IT_default;
3737

38-
// Path of directory where the generated file
39-
// will be saved (possibly unresolved)
40-
llvm::SmallString<128> Path;
41-
4238
//--------------------------------------------
4339

4440
// This variant (that takes no qualified name parameter) uses the Name as the
@@ -56,18 +52,6 @@ struct Reference
5652
{
5753
}
5854

59-
Reference(
60-
SymbolID USR,
61-
llvm::StringRef Name,
62-
InfoType IT,
63-
llvm::StringRef Path)
64-
: USR(USR)
65-
, Name(Name)
66-
, RefType(IT)
67-
, Path(Path)
68-
{
69-
}
70-
7155
bool
7256
operator==(
7357
Reference const& Other) const
@@ -81,12 +65,6 @@ struct Reference
8165

8266
bool canMerge(Reference const& Other);
8367
void merge(Reference&& I);
84-
85-
/// Returns the path for this Reference relative to CurrentPath.
86-
llvm::SmallString<64> getRelativeFilePath(llvm::StringRef const& CurrentPath) const;
87-
88-
/// Returns the basename that should be used for this Reference.
89-
//llvm::SmallString<16> getFileBaseName() const;
9068
};
9169

9270
} // mrdox

include/mrdox/meta/Symbol.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ struct SymbolInfo : Info
3333
SymbolInfo(
3434
InfoType IT,
3535
SymbolID USR = SymbolID(),
36-
llvm::StringRef Name = llvm::StringRef(),
37-
llvm::StringRef Path = llvm::StringRef())
38-
: Info(IT, USR, Name, Path)
36+
llvm::StringRef Name = llvm::StringRef())
37+
: Info(IT, USR, Name)
3938
{
4039
}
4140

0 commit comments

Comments
 (0)