Skip to content

Commit 15efafb

Browse files
committed
Fix ignore type checking to take type maps into account.
1 parent 6d4e940 commit 15efafb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Generator/Types/TypeIgnoreChecker.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ void Ignore()
2727
IsIgnored = true;
2828
}
2929

30+
public override bool VisitType(Type type, TypeQualifiers quals)
31+
{
32+
TypeMap typeMap;
33+
if (TypeMapDatabase.FindTypeMap(type, out typeMap)
34+
&& typeMap.IsIgnored)
35+
{
36+
Ignore();
37+
return false;
38+
}
39+
40+
return base.VisitType(type, quals);
41+
}
42+
3043
public override bool VisitPrimitiveType(PrimitiveType type, TypeQualifiers quals)
3144
{
3245
// we do not support long double yet because its high-level representation is often problematic
@@ -46,6 +59,12 @@ public override bool VisitDeclaration(Declaration decl)
4659
if (decl.CompleteDeclaration != null)
4760
return VisitDeclaration(decl.CompleteDeclaration);
4861

62+
TypeMap typeMap;
63+
if (TypeMapDatabase.FindTypeMap(decl, out typeMap))
64+
{
65+
return typeMap.IsIgnored;
66+
}
67+
4968
if (!(decl is TypedefDecl) && !decl.IsGenerated)
5069
{
5170
Ignore();

0 commit comments

Comments
 (0)