From 0ec1c8410bbea5bce2621a20b562f91587263cdd Mon Sep 17 00:00:00 2001 From: triton Date: Sat, 9 Mar 2013 01:22:54 +0000 Subject: [PATCH] Added a way to desugar types (strips all the typedefs). --- src/Bridge/Type.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Bridge/Type.cs b/src/Bridge/Type.cs index 29d38f98..6458c8cb 100644 --- a/src/Bridge/Type.cs +++ b/src/Bridge/Type.cs @@ -106,6 +106,14 @@ namespace Cxxi return decl != null; } + public Type Desugar() + { + var type = this as TypedefType; + if (type != null) + return type.Declaration.QualifiedType.Type.Desugar(); + return this; + } + public abstract T Visit(ITypeVisitor visitor, TypeQualifiers quals = new TypeQualifiers());