Added skipping of forward declarations
This commit is contained in:
@@ -130,6 +130,16 @@ public:
|
|||||||
|
|
||||||
bool is_declaration() const { return clang_isDeclaration(kind()); }
|
bool is_declaration() const { return clang_isDeclaration(kind()); }
|
||||||
|
|
||||||
|
bool is_forward_declaration() const
|
||||||
|
{
|
||||||
|
auto definition = clang_getCursorDefinition(m_cursor);
|
||||||
|
|
||||||
|
if (clang_equalCursors(definition, clang_getNullCursor()))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return !clang_equalCursors(m_cursor, definition);
|
||||||
|
}
|
||||||
|
|
||||||
bool is_invalid_declaration() const
|
bool is_invalid_declaration() const
|
||||||
{
|
{
|
||||||
return clang_isInvalidDeclaration(m_cursor);
|
return clang_isInvalidDeclaration(m_cursor);
|
||||||
|
|||||||
@@ -572,12 +572,16 @@ static enum CXChildVisitResult translation_unit_visitor(
|
|||||||
case CXCursor_ClassTemplate:
|
case CXCursor_ClassTemplate:
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case CXCursor_ClassDecl: {
|
case CXCursor_ClassDecl: {
|
||||||
spdlog::info("Found class or class template declaration: {}",
|
spdlog::info(
|
||||||
cursor_name_str);
|
"Found class or class template declaration: {}", cursor);
|
||||||
if (!ctx->config.should_include(cursor.fully_qualified())) {
|
if (!ctx->config.should_include(cursor.fully_qualified())) {
|
||||||
ret = CXChildVisit_Continue;
|
ret = CXChildVisit_Continue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (cursor.is_forward_declaration()) {
|
||||||
|
ret = CXChildVisit_Continue;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
scope = scope_t::kPublic;
|
scope = scope_t::kPublic;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user