Skip to content

Commit 1cee02e

Browse files
committed
refactor metadata extraction
1 parent 81d2d91 commit 1cee02e

38 files changed

+1405
-1683
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ file(GLOB_RECURSE LIB_SOURCES CONFIGURE_DEPENDS
9393
source/api/*.h
9494
source/api/*.hpp
9595
source/api/*.cpp
96-
#source/api/*.natvis
96+
source/api/*.natvis
9797
)
9898

9999
add_library(mrdox-api ${MRDOX_LINK_MODE} ${LIB_INCLUDES} ${LIB_SOURCES})

include/mrdox/Corpus.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class MRDOX_VISIBLE
106106
MRDOX_DECL virtual bool visit(FunctionInfo const&);
107107
MRDOX_DECL virtual bool visit(TypedefInfo const&);
108108
MRDOX_DECL virtual bool visit(EnumInfo const&);
109-
MRDOX_DECL virtual bool visit(VariableInfo const&);
109+
MRDOX_DECL virtual bool visit(VarInfo const&);
110110
};
111111

112112
/** Visit the specified symbol ID or node.
@@ -160,7 +160,7 @@ get(
160160
Assert(t->IT == InfoType::IT_typedef);
161161
else if constexpr(std::is_same_v<T, EnumInfo>)
162162
Assert(t->IT == InfoType::IT_enum);
163-
else if constexpr(std::is_same_v<T, VariableInfo>)
163+
else if constexpr(std::is_same_v<T, VarInfo>)
164164
Assert(t->IT == InfoType::IT_variable);
165165
return *t;
166166
}

include/mrdox/Metadata.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
#include <mrdox/Metadata/TemplateParam.hpp>
3737
#include <mrdox/Metadata/Type.hpp>
3838
#include <mrdox/Metadata/Typedef.hpp>
39-
#include <mrdox/Metadata/Variable.hpp>
39+
#include <mrdox/Metadata/Var.hpp>
4040

4141
#endif

include/mrdox/Metadata/Function.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ enum class FnFlags1 : std::uint32_t
8383
0x00000008 +
8484
0x00000010,
8585

86-
isExplicit = 0x00000020
86+
isExplicit = 0x00000020,
87+
88+
functionKind = 0b00000000'00000000'00011111'11000000
8789
};
8890

8991
// TODO: Expand to allow for documenting templating and default args.

include/mrdox/Metadata/Scope.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct Scope
3939
std::vector<Reference> Functions;
4040
std::vector<Reference> Typedefs;
4141
std::vector<Reference> Enums;
42-
std::vector<Reference> Variables;
42+
std::vector<Reference> Vars;
4343

4444
explicit
4545
Scope(

include/mrdox/Metadata/Variable.hpp include/mrdox/Metadata/Var.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ enum class VarFlags0 : std::uint32_t
3131
This includes variables at namespace
3232
scope, and static variables at class scope.
3333
*/
34-
struct VariableInfo
34+
struct VarInfo
3535
: SymbolInfo
3636
, TypeInfo // holds the type of this variable
3737
{
@@ -42,7 +42,7 @@ struct VariableInfo
4242
static constexpr InfoType type_id = InfoType::IT_variable;
4343

4444
explicit
45-
VariableInfo(
45+
VarInfo(
4646
SymbolID ID = SymbolID(),
4747
llvm::StringRef Name = llvm::StringRef())
4848
: SymbolInfo(InfoType::IT_variable, ID, Name)

include/mrdox/MetadataFwd.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct TemplateParamInfo;
4444
struct TemplateSpecializationInfo;
4545
struct TypeInfo;
4646
struct TypedefInfo;
47-
struct VariableInfo;
47+
struct VarInfo;
4848
struct VerbatimBlock;
4949

5050
} // mrdox

mrdox.rnc

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ grammar {
100100
Javadoc?
101101
}
102102

103-
VariableInfo = element variable {
103+
VarInfo = element var {
104104
Name,
105105
Id,
106106
(Location &

mrdox.rng

+3-3
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@
205205
</optional>
206206
</element>
207207
</define>
208-
<define name="VariableInfo">
209-
<element name="variable">
208+
<define name="VarInfo">
209+
<element name="var">
210210
<ref name="Name"/>
211211
<ref name="Id"/>
212212
<interleave>
@@ -302,7 +302,7 @@
302302
<ref name="FunctionInfo"/>
303303
<ref name="TypedefInfo"/>
304304
<ref name="EnumInfo"/>
305-
<ref name="VariableInfo"/>
305+
<ref name="VarInfo"/>
306306
</choice>
307307
</zeroOrMore>
308308
</define>

0 commit comments

Comments
 (0)