コード例 #1
0
        private IEnumerable <ICodeGenerator> CreateHandleTypeTemplates(BindingContext ctx)
        {
            var handles = ctx.ASTContext.GetHandleTypeDefs( );

            foreach (var handle in handles)
            {
                if (HandleToTemplateMap.TryGetValue(handle.Name, out IHandleCodeTemplate template))
                {
                    yield return(new TemplateCodeGenerator(true, handle.Name, Path.Combine(GeneratedCodePath, "Handles"), new[] { template }));
                }
                else
                {
                    Diagnostics.Error("No Mapping for handle type {0} - {1}@{2}", handle.Name, handle.TranslationUnit.FileRelativePath, handle.LineNumberStart);
                }
            }
        }
コード例 #2
0
        private IEnumerable <ICodeGenerator> CreateHandleTypeTemplates(BindingContext ctx)
        {
            // filter out known handle types with non-templated implementations
            var handles = from handle in ctx.ASTContext.GetHandleTypeDefs( )
                          where handle.Name != "LLVMErrorRef"
                          select handle;

            foreach (var handle in handles)
            {
                if (HandleToTemplateMap.TryGetValue(handle.Name, out IHandleCodeTemplate template))
                {
                    yield return(new TemplateCodeGenerator(true, handle.Name, Path.Combine(GeneratedCodePath, "Handles"), new[] { template }));
                }
                else
                {
                    Diagnostics.Error("No Mapping for handle type {0} - {1}@{2}", handle.Name, handle.TranslationUnit.FileRelativePath, handle.LineNumberStart);
                }
            }
        }