Exemplo n.º 1
0
        bool IsDeclIgnored(Declaration decl)
        {
            var checker = new TypeIgnoreChecker(Driver.TypeDatabase);

            decl.Visit(checker);

            return(checker.IsIgnored);
        }
Exemplo n.º 2
0
        private bool IsTypeIgnored(Type type)
        {
            var checker = new TypeIgnoreChecker(TypeMaps, Options.GeneratorKind);

            type.Visit(checker);

            return(checker.IsIgnored);
        }
Exemplo n.º 3
0
        private bool IsTypeIgnored(Type type)
        {
            var checker = new TypeIgnoreChecker(TypeDatabase);

            type.Visit(checker);

            return(checker.IsIgnored);
        }
Exemplo n.º 4
0
        bool IsTypeIgnored(AST.Type type)
        {
            var checker = new TypeIgnoreChecker(Driver.TypeDatabase);

            type.Visit(checker);

            return(checker.IsIgnored);
        }
Exemplo n.º 5
0
        private bool UnsupportedTemplateArgument(ClassTemplateSpecialization specialization, TemplateArgument a)
        {
            if (a.Type.Type == null ||
                CheckIgnoredDeclsPass.IsTypeExternal(
                    specialization.TranslationUnit.Module, a.Type.Type))
                return true;

            var typeIgnoreChecker = new TypeIgnoreChecker(Context.TypeMaps);
            a.Type.Type.Visit(typeIgnoreChecker);
            return typeIgnoreChecker.IsIgnored;
        }
Exemplo n.º 6
0
        private static bool UnsupportedTemplateArgument(
            ClassTemplateSpecialization specialization, TemplateArgument a, ITypeMapDatabase typeMaps)
        {
            if (a.Type.Type == null ||
                IsTypeExternal(specialization.TranslationUnit.Module, a.Type.Type))
            {
                return(true);
            }

            var typeIgnoreChecker = new TypeIgnoreChecker(typeMaps);

            a.Type.Type.Visit(typeIgnoreChecker);
            return(typeIgnoreChecker.IsIgnored);
        }
Exemplo n.º 7
0
        private void CleanSpecializations(Class template)
        {
            template.Specializations.RemoveAll(s =>
                                               !specializations.Contains(s) && !internalSpecializations.Contains(s));

            foreach (var specialization in template.Specializations.Where(
                         s => !s.IsExplicitlyGenerated &&
                         (s.Arguments.Any(a =>
            {
                if (a.Kind != TemplateArgument.ArgumentKind.Declaration &&
                    a.Kind != TemplateArgument.ArgumentKind.Template &&
                    a.Kind != TemplateArgument.ArgumentKind.Type)
                {
                    return(true);
                }

                var type = a.Type.Type.Desugar();
                if (ASTUtils.IsTypeExternal(template.TranslationUnit.Module, type) ||
                    type.IsPrimitiveType(PrimitiveType.Void))
                {
                    return(true);
                }

                var typeIgnoreChecker = new TypeIgnoreChecker(TypeMaps);
                type.Visit(typeIgnoreChecker);
                return(typeIgnoreChecker.IsIgnored);
            }) ||
                          s.SpecializationKind == TemplateSpecializationKind.ExplicitSpecialization ||
                          s is ClassTemplatePartialSpecialization ||
                          internalSpecializations.Contains(s))))
            {
                specialization.ExplicitlyIgnore();
            }

            Func <TemplateArgument, bool> allPointers =
                a => a.Type.Type != null && a.Type.Type.IsAddress();
            var groups = (from specialization in template.Specializations
                          group specialization by specialization.Arguments.All(allPointers)
                          into @group
                          select @group).ToList();

            foreach (var group in groups.Where(g => g.Key))
            {
                foreach (var specialization in group.Skip(1))
                {
                    template.Specializations.Remove(specialization);
                }
            }

            for (int i = template.Specializations.Count - 1; i >= 0; i--)
            {
                var specialization = template.Specializations[i];
                if (specialization is ClassTemplatePartialSpecialization &&
                    !specialization.Arguments.All(allPointers))
                {
                    template.Specializations.RemoveAt(i);
                }
            }

            if (!template.IsExplicitlyGenerated &&
                template.Specializations.All(s => s.Ignore))
            {
                template.ExplicitlyIgnore();
            }
        }
Exemplo n.º 8
0
        private bool IsTypeIgnored(Type type)
        {
            var checker = new TypeIgnoreChecker(Driver.TypeDatabase);
            type.Visit(checker);

            return checker.IsIgnored;
        }
Exemplo n.º 9
0
        bool IsDeclIgnored(Declaration decl)
        {
            var checker = new TypeIgnoreChecker(Driver.TypeDatabase);
            decl.Visit(checker);

            return checker.IsIgnored;
        }
Exemplo n.º 10
0
        private bool IsTypeIgnored(Type type)
        {
            var checker = new TypeIgnoreChecker(TypeMaps);
            type.Visit(checker);

            return checker.IsIgnored;
        }