Browse Source

TypeSystemAstBuilder in TransformContext

pull/728/head
Daniel Grunwald 10 years ago
parent
commit
20a7fd1725
  1. 3
      ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs
  2. 5
      ICSharpCode.Decompiler/CSharp/Transforms/TransformContext.cs

3
ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs

@ -103,7 +103,8 @@ namespace ICSharpCode.Decompiler.CSharp @@ -103,7 +103,8 @@ namespace ICSharpCode.Decompiler.CSharp
void RunTransforms(AstNode rootNode, ITypeResolveContext decompilationContext)
{
var context = new TransformContext(typeSystem, decompilationContext, CancellationToken);
var typeSystemAstBuilder = CreateAstBuilder(decompilationContext);
var context = new TransformContext(typeSystem, decompilationContext, typeSystemAstBuilder, CancellationToken);
foreach (var transform in astTransforms) {
CancellationToken.ThrowIfCancellationRequested();
transform.Run(rootNode, context);

5
ICSharpCode.Decompiler/CSharp/Transforms/TransformContext.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Threading;
using ICSharpCode.NRefactory.CSharp.Refactoring;
using ICSharpCode.NRefactory.CSharp.Resolver;
using ICSharpCode.NRefactory.TypeSystem;
@ -30,6 +31,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms @@ -30,6 +31,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms
{
public readonly DecompilerTypeSystem TypeSystem;
public readonly CancellationToken CancellationToken;
public readonly TypeSystemAstBuilder TypeSystemAstBuilder;
readonly ITypeResolveContext decompilationContext;
/// <summary>
@ -46,10 +48,11 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms @@ -46,10 +48,11 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms
get { return decompilationContext.CurrentTypeDefinition; }
}
internal TransformContext(DecompilerTypeSystem typeSystem, ITypeResolveContext decompilationContext, CancellationToken cancellationToken)
internal TransformContext(DecompilerTypeSystem typeSystem, ITypeResolveContext decompilationContext, TypeSystemAstBuilder typeSystemAstBuilder, CancellationToken cancellationToken)
{
this.TypeSystem = typeSystem;
this.decompilationContext = decompilationContext;
this.TypeSystemAstBuilder = typeSystemAstBuilder;
this.CancellationToken = cancellationToken;
}
}

Loading…
Cancel
Save