Пример #1
0
        public CLITypeReference GetTypeReference(Declaration decl)
        {
            if (typeReferences.ContainsKey(decl))
            {
                return(typeReferences[decl]);
            }

            var translationUnit = decl.Namespace.TranslationUnit;

            if (ShouldIncludeTranslationUnit(translationUnit) && decl.IsGenerated && !IsBuiltinTypedef(decl))
            {
                var @ref = new CLITypeReference {
                    Declaration = decl
                };

                @ref.Include = new CInclude
                {
                    File            = GetIncludePath(translationUnit),
                    TranslationUnit = translationUnit,
                    Kind            = translationUnit.IsGenerated ? CInclude.IncludeKind.Quoted : CInclude.IncludeKind.Angled
                };

                typeReferences.Add(decl, @ref);

                return(@ref);
            }

            return(null);
        }
Пример #2
0
        public CLITypeReference GetTypeReference(Declaration decl)
        {
            if(typeReferences.ContainsKey(decl))
                return typeReferences[decl];

            var @ref = new CLITypeReference { Declaration = decl };
            typeReferences.Add(decl, @ref);

            return @ref;
        }
Пример #3
0
        public CLITypeReference GetTypeReference(Declaration decl)
        {
            if (typeReferences.ContainsKey(decl))
            {
                return(typeReferences[decl]);
            }

            var @ref = new CLITypeReference();

            typeReferences.Add(decl, @ref);
            return(@ref);
        }