Skip to content

Commit c31f3e7

Browse files
committed
javadoc bitcode
1 parent 197bb95 commit c31f3e7

16 files changed

+1723
-1273
lines changed

include/mrdox/meta/Javadoc.hpp

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ struct Javadoc
7272
{
7373
using String = std::string;
7474

75-
enum class Kind
75+
enum class Kind : int
7676
{
7777
text,
7878
styledText,
7979
paragraph,
80+
brief,
8081
admonition,
8182
code,
8283
returns,
@@ -191,7 +192,7 @@ struct Javadoc
191192

192193
auto operator<=>(Paragraph const&) const noexcept = default;
193194

194-
Paragraph()
195+
Paragraph() noexcept
195196
: Block(Kind::paragraph)
196197
{
197198
}
@@ -204,6 +205,18 @@ struct Javadoc
204205
}
205206
};
206207

208+
/** The brief description
209+
*/
210+
struct Brief : Paragraph
211+
{
212+
auto operator<=>(Brief const&) const noexcept = default;
213+
214+
Brief() noexcept
215+
: Paragraph(Kind::brief)
216+
{
217+
}
218+
};
219+
207220
/** Documentation for an admonition
208221
*/
209222
struct Admonition : Paragraph
@@ -291,11 +304,8 @@ struct Javadoc
291304

292305
//---
293306

294-
std::shared_ptr<Paragraph> const&
295-
getBrief() const noexcept
296-
{
297-
return brief_;
298-
}
307+
Paragraph const*
308+
getBrief() const noexcept;
299309

300310
List<Block> const&
301311
getBlocks() const noexcept
@@ -323,12 +333,11 @@ struct Javadoc
323333

324334
//---
325335

326-
Javadoc() = default;
336+
Javadoc() noexcept;
327337

328338
/** Constructor
329339
*/
330340
Javadoc(
331-
Paragraph brief,
332341
List<Block> blocks,
333342
List<Param> params,
334343
List<TParam> tparams,
@@ -360,8 +369,12 @@ struct Javadoc
360369
tparams_.emplace_back(std::move(tparam));
361370
}
362371

372+
void merge(Javadoc& other);
373+
363374
private:
364-
std::shared_ptr<Paragraph> brief_;
375+
static Paragraph const s_empty_;
376+
377+
Paragraph const* brief_;
365378
List<Block> blocks_;
366379
List<Param> params_;
367380
List<TParam> tparams_;

include/mrdox/meta/List.hpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ class List
8383
template<class U>
8484
iterator emplace_back(U&& u);
8585

86+
template<class U>
87+
void splice_back(List<U>& other);
88+
8689
void swap(List& other);
8790

8891
private:
@@ -498,6 +501,30 @@ emplace_back(U&& u) ->
498501
return iterator(item);
499502
}
500503

504+
template<class T>
505+
template<class U>
506+
void
507+
List<T>::
508+
splice_back(
509+
List<U>& other)
510+
{
511+
if(other.empty())
512+
return;
513+
auto it = other.head_;
514+
while(it != &other.end_)
515+
{
516+
auto next = it->next;
517+
append(it);
518+
it = next;
519+
}
520+
size_ += other.size_;
521+
other.size_ = 0;
522+
other.head_ = &other.end_;
523+
other.tail_ = &other.end_;
524+
tail_ = &end_;
525+
}
526+
527+
501528
template<class T>
502529
void
503530
List<T>::

source/lib/Corpus.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "ast/FrontendAction.hpp"
1313
#include "ast/BitcodeReader.hpp"
14-
#include "ast/BitcodeWriter.hpp"
14+
//#include "ast/BitcodeWriter.hpp"
1515
#include "ast/Serialize.hpp"
1616
#include "meta/Reduce.hpp"
1717
#include <mrdox/Corpus.hpp>
@@ -121,8 +121,7 @@ build(
121121
for (auto& Bitcode : Group.getValue())
122122
{
123123
llvm::BitstreamCursor Stream(Bitcode);
124-
ClangDocBitcodeReader Reader(Stream);
125-
auto infos = Reader.readBitcode();
124+
auto infos = readBitcode(Stream, R);
126125
if(R.error(infos, "read bitcode"))
127126
{
128127
GotFailure = true;

0 commit comments

Comments
 (0)