mirror of https://github.com/icsharpcode/ILSpy.git
23 changed files with 88 additions and 67 deletions
@ -1,50 +0,0 @@
@@ -1,50 +0,0 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Diagnostics; |
||||
using ICSharpCode.Decompiler.ILAst; |
||||
using ICSharpCode.NRefactory.CSharp; |
||||
using Mono.Cecil; |
||||
|
||||
namespace ICSharpCode.Decompiler.Ast |
||||
{ |
||||
public class TypeInformation |
||||
{ |
||||
public readonly TypeReference InferredType; |
||||
|
||||
public TypeInformation(TypeReference inferredType) |
||||
{ |
||||
this.InferredType = inferredType; |
||||
} |
||||
} |
||||
|
||||
public class LdTokenAnnotation {} |
||||
|
||||
/// <summary>
|
||||
/// Annotation that is applied to the body expression of an Expression.Lambda() call.
|
||||
/// </summary>
|
||||
public class ParameterDeclarationAnnotation |
||||
{ |
||||
public readonly List<ParameterDeclaration> Parameters = new List<ParameterDeclaration>(); |
||||
|
||||
public ParameterDeclarationAnnotation(ILExpression expr) |
||||
{ |
||||
Debug.Assert(expr.Code == ILCode.ExpressionTreeParameterDeclarations); |
||||
for (int i = 0; i < expr.Arguments.Count - 1; i++) { |
||||
ILExpression p = expr.Arguments[i]; |
||||
// p looks like this:
|
||||
// stloc(v, call(Expression::Parameter, call(Type::GetTypeFromHandle, ldtoken(...)), ldstr(...)))
|
||||
ILVariable v = (ILVariable)p.Operand; |
||||
TypeReference typeRef = (TypeReference)p.Arguments[0].Arguments[0].Arguments[0].Operand; |
||||
string name = (string)p.Arguments[0].Arguments[1].Operand; |
||||
Parameters.Add(new ParameterDeclaration(AstBuilder.ConvertType(typeRef), name).WithAnnotation(v)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Annotation that is applied to a LambdaExpression that was produced by an expression tree.
|
||||
/// </summary>
|
||||
public class ExpressionTreeLambdaAnnotation |
||||
{ |
||||
} |
||||
} |
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Daniel |
||||
* Date: 2014-08-24 |
||||
* Time: 18:42 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
|
||||
namespace ICSharpCode.Decompiler.CSharp |
||||
{ |
||||
public class LdTokenAnnotation {} |
||||
} |
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Threading; |
||||
using ICSharpCode.NRefactory.CSharp; |
||||
|
||||
namespace ICSharpCode.Decompiler.CSharp.Transforms |
||||
{ |
||||
public interface IAstTransform |
||||
{ |
||||
void Run(AstNode compilationUnit); |
||||
} |
||||
|
||||
public static class TransformationPipeline |
||||
{ |
||||
public static IAstTransform[] CreatePipeline() |
||||
{ |
||||
return new IAstTransform[] { |
||||
new AddCheckedBlocks() |
||||
}; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue