Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cppalliance/mrdocs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 07e53c6b4a368cd554b4fdfd59b52d4bffaa69f5
Choose a base ref
..
head repository: cppalliance/mrdocs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 903e020c17d587193c6da5ae36cf5c279cca154a
Choose a head ref
Showing with 1,570 additions and 1,014 deletions.
  1. +35 −2 include/mrdox/ADT/Optional.hpp
  2. +0 −1 include/mrdox/Metadata.hpp
  3. +14 −5 include/mrdox/Metadata/Function.hpp
  4. +2 −2 include/mrdox/Metadata/Info.hpp
  5. +15 −4 include/mrdox/Metadata/Record.hpp
  6. +0 −1 include/mrdox/Metadata/Symbol.hpp
  7. +230 −15 include/mrdox/Metadata/Template.hpp
  8. +0 −33 include/mrdox/Metadata/TemplateArg.hpp
  9. +0 −181 include/mrdox/Metadata/TemplateParam.hpp
  10. +19 −0 include/mrdox/Metadata/Typedef.hpp
  11. +18 −1 include/mrdox/Metadata/Var.hpp
  12. +3 −3 source/-XML/CXXTags.hpp
  13. +18 −13 source/-XML/XMLWriter.cpp
  14. +2 −2 source/-XML/XMLWriter.hpp
  15. +20 −4 source/-adoc/AdocWriter.cpp
  16. +7 −2 source/-adoc/AdocWriter.hpp
  17. +586 −510 source/AST/ASTVisitor.cpp
  18. +89 −68 source/AST/ASTVisitor.hpp
  19. +33 −20 source/AST/AnyBlock.hpp
  20. +14 −9 source/AST/BitcodeWriter.cpp
  21. +2 −2 source/AST/BitcodeWriter.hpp
  22. +0 −33 source/AST/Commands.cpp
  23. +0 −34 source/AST/Commands.hpp
  24. +1 −1 source/AST/DecodeRecord.hpp
  25. +2 −1 source/AST/FrontendAction.cpp
  26. +28 −3 source/AST/ParseJavadoc.cpp
  27. +15 −3 source/AST/ParseJavadoc.hpp
  28. +0 −32 source/AST/clangASTComment.hpp
  29. +1 −1 source/CorpusImpl.cpp
  30. +4 −0 source/Metadata/Interface.cpp
  31. +7 −3 source/Metadata/Reduce.cpp
  32. +5 −6 source/Metadata/Templates.cpp
  33. +1 −1 source/Support/Generator.cpp
  34. +15 −0 test-files/old-tests/alias-template.cpp
  35. +39 −0 test-files/old-tests/alias-template.xml
  36. +12 −0 test-files/old-tests/class-template-partial-spec.cpp
  37. +34 −0 test-files/old-tests/class-template-partial-spec.xml
  38. 0 test-files/old-tests/{template-spec.cpp → class-template-spec.cpp}
  39. +18 −18 test-files/old-tests/{template-spec.xml → class-template-spec.xml}
  40. +51 −0 test-files/old-tests/class-template.cpp
  41. +102 −0 test-files/old-tests/class-template.xml
  42. +12 −0 test-files/old-tests/static-data-template.cpp
  43. +40 −0 test-files/old-tests/static-data-template.xml
  44. +20 −0 test-files/old-tests/var-template.cpp
  45. +56 −0 test-files/old-tests/var-template.xml
37 changes: 35 additions & 2 deletions include/mrdox/ADT/Optional.hpp
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
#define MRDOX_ADT_OPTIONAL_HPP

#include <mrdox/Platform.hpp>
#include <concepts>
#include <type_traits>
#include <utility>

@@ -27,9 +28,11 @@ namespace mrdox {
struct DefaultEmptyPredicate
{
template<class T>
requires
requires(T t) { t.empty(); }
constexpr bool operator()(T const& t) const noexcept
requires requires
{
{ t.empty() } -> std::convertible_to<bool>;
}
{
return t.empty();
}
@@ -73,6 +76,26 @@ class Optional
return t_ = T(std::forward<Args>(args)...);
}

constexpr value_type& value() & noexcept
{
return t_;
}

constexpr const value_type& value() const & noexcept
{
return t_;
}

constexpr value_type&& value() && noexcept
{
return std::move(t_);
}

constexpr const value_type&& value() const && noexcept
{
return std::move(t_);
}

constexpr value_type& operator*() noexcept
{
return t_;
@@ -83,6 +106,16 @@ class Optional
return t_;
}

constexpr value_type* operator->() noexcept
{
return &t_;
}

constexpr value_type const* operator->() const noexcept
{
return &t_;
}

constexpr explicit operator bool() const noexcept
{
return has_value();
1 change: 0 additions & 1 deletion include/mrdox/Metadata.hpp
Original file line number Diff line number Diff line change
@@ -32,7 +32,6 @@
#include <mrdox/Metadata/Symbol.hpp>
#include <mrdox/Metadata/Symbols.hpp>
#include <mrdox/Metadata/Template.hpp>
#include <mrdox/Metadata/TemplateParam.hpp>
#include <mrdox/Metadata/Type.hpp>
#include <mrdox/Metadata/Typedef.hpp>
#include <mrdox/Metadata/Var.hpp>
19 changes: 14 additions & 5 deletions include/mrdox/Metadata/Function.hpp
Original file line number Diff line number Diff line change
@@ -21,11 +21,9 @@
#include <mrdox/Metadata/Symbol.hpp>
#include <mrdox/Metadata/Symbols.hpp>
#include <mrdox/Metadata/Template.hpp>
#include <clang/Basic/Specifiers.h>
#include <llvm/ADT/SmallString.h>
#include <llvm/ADT/SmallVector.h>
#include <clang/AST/Attr.h>
#include <optional>
#include <memory>
#include <string>
#include <vector>

namespace clang {
@@ -107,11 +105,13 @@ struct Param
struct FunctionInfo
: SymbolInfo
{
friend class ASTVisitor;

TypeInfo ReturnType; // Info about the return type of this function.
std::vector<Param> Params; // List of parameters.

// When present, this function is a template or specialization.
std::optional<TemplateInfo> Template;
std::unique_ptr<TemplateInfo> Template;

FnFlags0 specs0{.raw{0}};
FnFlags1 specs1{.raw{0}};
@@ -126,6 +126,15 @@ struct FunctionInfo
: SymbolInfo(InfoType::IT_function, id_)
{
}

private:
explicit
FunctionInfo(
std::unique_ptr<TemplateInfo>&& T)
: SymbolInfo(InfoType::IT_function)
, Template(std::move(T))
{
}
};

//------------------------------------------------
4 changes: 2 additions & 2 deletions include/mrdox/Metadata/Info.hpp
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
#include <llvm/ADT/StringRef.h>
#include <llvm/ADT/SmallVector.h>
#include <array>
#include <optional>
#include <memory>
#include <string>
#include <vector>

@@ -48,7 +48,7 @@ struct Info

/** The extracted javadoc for this declaration.
*/
std::optional<Javadoc> javadoc;
std::unique_ptr<Javadoc> javadoc;

//--------------------------------------------

19 changes: 15 additions & 4 deletions include/mrdox/Metadata/Record.hpp
Original file line number Diff line number Diff line change
@@ -19,11 +19,11 @@
#include <mrdox/Metadata/Reference.hpp>
#include <mrdox/Metadata/Scope.hpp>
#include <mrdox/Metadata/Symbol.hpp>
#include <mrdox/Metadata/Template.hpp>
#include <mrdox/Metadata/Symbols.hpp>
#include <mrdox/Metadata/Template.hpp>
#include <clang/AST/Type.h>
#include <llvm/ADT/SmallVector.h>
#include <optional>
#include <memory>
#include <string>
#include <string_view>
#include <vector>
@@ -80,12 +80,14 @@ struct RecordScope
struct RecordInfo
: SymbolInfo
{
friend class ASTVisitor;

// VFALCO Use our own enumeration for this
// Type of this record (struct, class, union, interface).
TagTypeKind TagType = TagTypeKind::TTK_Struct;

// When present, this record is a template or specialization.
std::optional<TemplateInfo> Template;
std::unique_ptr<TemplateInfo> Template;

// Indicates if the record was declared using a typedef. Things like anonymous
// structs in a typedef:
@@ -102,7 +104,7 @@ struct RecordInfo

/** List of friend functions.
*/
llvm::SmallVector<SymbolID, 4> Friends;
std::vector<SymbolID> Friends;

/** Record members
*/
@@ -119,6 +121,15 @@ struct RecordInfo
: SymbolInfo(InfoType::IT_record, id, Name)
{
}

private:
explicit
RecordInfo(
std::unique_ptr<TemplateInfo>&& T)
: SymbolInfo(InfoType::IT_record)
, Template(std::move(T))
{
}
};

} // mrdox
1 change: 0 additions & 1 deletion include/mrdox/Metadata/Symbol.hpp
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@
#include <mrdox/Platform.hpp>
#include <mrdox/Metadata/Info.hpp>
#include <mrdox/Metadata/Location.hpp>
#include <llvm/ADT/SmallVector.h>
#include <optional>

namespace clang {
Loading