Skip to content

Commit 8f26655

Browse files
committed
Tidy up javadoc parsing files
1 parent d821280 commit 8f26655

File tree

10 files changed

+69
-107
lines changed

10 files changed

+69
-107
lines changed

source/-adoc/AdocWriter.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,22 @@ tagToString(TagTypeKind k) noexcept
862862
}
863863
}
864864

865+
//------------------------------------------------
866+
867+
void
868+
AdocWriter::
869+
declareRecord(
870+
RecordInfo const& I)
871+
{
872+
}
873+
874+
void
875+
AdocWriter::
876+
declareFunction(
877+
FunctionInfo const& I)
878+
{
879+
}
880+
865881
} // adoc
866882
} // mrdox
867883
} // clang

source/-adoc/AdocWriter.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ class AdocWriter
144144
void endSection();
145145

146146
static llvm::StringRef tagToString(TagTypeKind k) noexcept;
147+
148+
//--------------------------------------------
149+
150+
void declareRecord(RecordInfo const& I);
151+
void declareFunction(FunctionInfo const& I);
147152
};
148153

149154
} // adoc

source/AST/ASTVisitor.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#include "ASTVisitor.hpp"
1414
#include "Bitcode.hpp"
15-
#include "Commands.hpp"
1615
#include "ParseJavadoc.hpp"
1716
#include "ConfigImpl.hpp"
1817
#include "Metadata/FunctionKind.hpp"

source/AST/Commands.cpp

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

source/AST/Commands.hpp

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

source/AST/ParseJavadoc.cpp

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,25 @@
99
// Official repository: https://github.com/cppalliance/mrdox
1010
//
1111

12-
#include "clangASTComment.hpp"
1312
#include "ParseJavadoc.hpp"
1413
#include <mrdox/Metadata/Javadoc.hpp>
1514
#include <clang/AST/CommentCommandTraits.h>
1615
#include <clang/AST/ASTContext.h>
1716
#include <clang/AST/RawCommentList.h>
17+
18+
#ifdef _MSC_VER
19+
#pragma warning(push)
20+
#pragma warning(disable: 5054) // C5054: operator '+': deprecated between enumerations of different types
21+
#endif
22+
#include <clang/AST/Comment.h>
23+
#include <clang/AST/CommentVisitor.h>
24+
#ifdef _MSC_VER
25+
#pragma warning(pop)
26+
#endif
27+
1828
#include <llvm/Support/JSON.h>
1929
#include <cassert>
2030

21-
#include <llvm/Support/Mutex.h>
22-
2331
/*
2432
Comment Types
2533
@@ -542,6 +550,23 @@ dumpCommentCommands()
542550

543551
//------------------------------------------------
544552

553+
void
554+
initCustomCommentCommands(ASTContext& context)
555+
{
556+
auto& traits = context.getCommentCommandTraits();
557+
558+
{
559+
//auto cmd = traits.registerBlockCommand("mrdox");
560+
//auto cmd = traits.registerBlockCommand("par");
561+
562+
//CommentOptions opt;
563+
//opt.BlockCommandNames.push_back("par");
564+
//traits.registerCommentOptions(opt);
565+
}
566+
567+
(void)traits;
568+
}
569+
545570
Javadoc
546571
parseJavadoc(
547572
RawComment const* RC,

source/AST/ParseJavadoc.hpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,24 @@
1515
#include <mrdox/Platform.hpp>
1616
#include <mrdox/Reporter.hpp>
1717
#include <mrdox/Metadata/Javadoc.hpp>
18-
#include <clang/AST/Decl.h>
19-
#include "clangASTComment.hpp"
20-
#include <clang/AST/ASTContext.h>
2118

2219
namespace clang {
20+
21+
class Decl;
22+
class ASTContext;
23+
class RawComment;
24+
2325
namespace mrdox {
2426

27+
/** Initialize clang to recognize our custom comments.
28+
29+
Safe to be called more than once, but
30+
not concurrently.
31+
*/
32+
void
33+
initCustomCommentCommands(
34+
ASTContext& ctx);
35+
2536
/** Return a complete javadoc object for a raw comment.
2637
*/
2738
Javadoc
@@ -31,6 +42,7 @@ parseJavadoc(
3142
Reporter& R);
3243

3344
} // mrdox
45+
3446
} // clang
3547

3648
#endif

source/AST/clangASTComment.hpp

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

source/Metadata/Interface.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ class Interface::Build
7979
for(auto const& B : From.Bases)
8080
{
8181
auto actualAccess = effectiveAccess(access, B.access);
82+
// VFALCO temporary hack to avoid looking up IDs
83+
// which for metadata that is not emitted.
84+
if(! corpus_.find(B.id))
85+
continue;
8286
append(actualAccess, corpus_.get<RecordInfo>(B.id));
8387
}
8488

source/Support/Generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Official repository: https://github.com/cppalliance/mrdox
1010
//
1111

12-
#include "AST/Commands.hpp"
12+
#include "AST/ParseJavadoc.hpp"
1313
#include <mrdox/Error.hpp>
1414
#include <mrdox/Generator.hpp>
1515
#include <llvm/ADT/SmallString.h>

0 commit comments

Comments
 (0)