Added support for 'class' diagrams from C99/C11 translation units (#97)

This commit is contained in:
Bartek Kryza
2023-02-19 18:49:59 +01:00
parent 4afb1daef0
commit 6341a62857
17 changed files with 301 additions and 30 deletions

View File

@@ -152,7 +152,12 @@ std::string to_string(const clang::QualType &type, const clang::ASTContext &ctx,
// it has some default name
if (result.empty())
result = "(anonymous)";
else if (util::contains(result, "unnamed struct")) {
else if (util::contains(result, "unnamed struct") ||
util::contains(result, "unnamed union")) {
result = common::get_tag_name(*type->getAsTagDecl());
}
else if (util::contains(result, "anonymous struct") ||
util::contains(result, "anonymous union")) {
result = common::get_tag_name(*type->getAsTagDecl());
}