Skip to content

Commit

Permalink
xml work
Browse files Browse the repository at this point in the history
  • Loading branch information
vinniefalco committed Mar 31, 2023
1 parent 3d32024 commit 3dea5c4
Show file tree
Hide file tree
Showing 7 changed files with 239 additions and 87 deletions.
2 changes: 1 addition & 1 deletion include/mrdox/mrdox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace doc {

llvm::Expected<llvm::Twine>
renderXML(
llvm::StringRef path);
llvm::StringRef fileName);

} // doc
} // clang
Expand Down
25 changes: 23 additions & 2 deletions source/lib/Representation.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,30 @@ struct TypeInfo {
// This is a very simple serialization of the text of the source code of the
// template parameter. It is saved in a struct so there is a place to add the
// name and default values in the future if needed.
struct TemplateParamInfo {
//
/** A tempalte parameter.
*/
struct TemplateParamInfo
{
enum class Kind
{
Class,
Typename,
Nttp
};

TemplateParamInfo() = default;
explicit TemplateParamInfo(StringRef Contents) : Contents(Contents) {}

TemplateParamInfo(
//StringRef Name,
StringRef Contents)
: Contents(Contents)
{
}

Kind kind = Kind::Class;

//SmallString<16> Name;

// The literal contents of the code for that specifies this template parameter
// for this declaration. Typical values will be "class T" and
Expand Down
15 changes: 10 additions & 5 deletions source/lib/Serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,17 +381,22 @@ void PopulateTemplateParameters(std::optional<TemplateInfo>& TemplateInfo,
if (!TemplateInfo) {
TemplateInfo.emplace();
}
for (const NamedDecl* ND : *ParamList) {
for (const NamedDecl* ND : *ParamList)
{
TemplateInfo->Params.emplace_back(
getSourceCode(ND, ND->getSourceRange()));
}
}
}

TemplateParamInfo TemplateArgumentToInfo(const clang::Decl* D,
const TemplateArgument& Arg) {
// The TemplateArgument's pretty printing handles all the normal cases
// well enough for our requirements.
TemplateParamInfo
TemplateArgumentToInfo(
clang::Decl const* D,
TemplateArgument const & Arg)
{
// The TemplateArgument's pretty printing
// handles all the normal cases well enough
// for our requirements.
std::string Str;
llvm::raw_string_ostream Stream(Str);
Arg.print(PrintingPolicy(D->getLangOpts()), Stream, false);
Expand Down
Loading

0 comments on commit 3dea5c4

Please sign in to comment.