Browse Source

Merge branch 'newdecompiler' of https://github.com/icsharpcode/ILSpy into netstd-support

# Conflicts:
#	ILSpy/ILSpy.csproj
pull/848/head
Siegfried Pammer 8 years ago
parent
commit
354c97f1e2
  1. 92
      .editorconfig
  2. 4
      ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
  3. 4
      ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs
  4. 8
      ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs
  5. 12
      ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpAmbience.cs
  6. 10
      ICSharpCode.Decompiler/CSharp/Resolver/CSharpOperators.cs
  7. 17
      ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs
  8. 12
      ICSharpCode.Decompiler/CSharp/Resolver/ReducedExtensionMethod.cs
  9. 36
      ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs
  10. 1
      ICSharpCode.Decompiler/CecilExtensions.cs
  11. 7
      ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj
  12. 218
      ICSharpCode.Decompiler/IL/ControlFlow/AsyncAwaitDecompiler.cs
  13. 6
      ICSharpCode.Decompiler/IL/Instructions.cs
  14. 3
      ICSharpCode.Decompiler/IL/Instructions.tt
  15. 11
      ICSharpCode.Decompiler/IL/Instructions/Await.cs
  16. 1
      ICSharpCode.Decompiler/IL/Instructions/ILVariableCollection.cs
  17. 32
      ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs
  18. 3
      ICSharpCode.Decompiler/IL/Transforms/ILInlining.cs
  19. 4
      ICSharpCode.Decompiler/IL/Transforms/RemoveDeadVariableInit.cs
  20. 16
      ICSharpCode.Decompiler/Semantics/Conversion.cs
  21. 13
      ICSharpCode.Decompiler/TypeSystem/CecilLoader.cs
  22. 63
      ICSharpCode.Decompiler/TypeSystem/EntityType.cs
  23. 4
      ICSharpCode.Decompiler/TypeSystem/IAmbience.cs
  24. 6
      ICSharpCode.Decompiler/TypeSystem/IEntity.cs
  25. 10
      ICSharpCode.Decompiler/TypeSystem/IMember.cs
  26. 6
      ICSharpCode.Decompiler/TypeSystem/IMethod.cs
  27. 12
      ICSharpCode.Decompiler/TypeSystem/IProjectContent.cs
  28. 3
      ICSharpCode.Decompiler/TypeSystem/IUnresolvedFile.cs
  29. 5
      ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractResolvedEntity.cs
  30. 5
      ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractResolvedMember.cs
  31. 3
      ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultAssemblyReference.cs
  32. 5
      ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedMethod.cs
  33. 5
      ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedTypeDefinition.cs
  34. 26
      ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultUnresolvedMethod.cs
  35. 7
      ICSharpCode.Decompiler/TypeSystem/Implementation/GetClassTypeReference.cs
  36. 20
      ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMember.cs
  37. 7
      ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMethod.cs
  38. 11
      ICSharpCode.Decompiler/TypeSystem/ParameterListComparer.cs
  39. 17
      ICSharpCode.Decompiler/TypeSystem/VarArgInstanceMethod.cs
  40. 58
      ILSpy/ILSpy.csproj
  41. 372
      Rebracer.xml

92
.editorconfig

@ -23,4 +23,94 @@ indent_style = space @@ -23,4 +23,94 @@ indent_style = space
indent_size = 2
[*.vsct]
indent_style = space
indent_size = 2
indent_size = 2
[*.cs]
# New line preferences
csharp_new_line_before_open_brace = methods, types
csharp_new_line_before_else = false
csharp_new_line_before_catch = false
csharp_new_line_before_finally = false
csharp_new_line_before_members_in_object_initializers = false
csharp_new_line_before_members_in_anonymous_types = false
csharp_new_line_within_query_expression_clauses = false
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = one_less
# Avoid 'this.' in generated code unless absolutely necessary, but allow developers to use it
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent
# Do not use 'var' when generating code, but allow developers to use it
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_when_type_is_apparent = false:silent
csharp_style_var_elsewhere = false:silent
# Use language keywords instead of BCL types when generating code, but allow developers to use either
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
# Using directives
dotnet_sort_system_directives_first = true
# Wrapping
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
# Code style
csharp_prefer_braces = true:silent
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
# Pattern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
# Null checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = do_not_ignore
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false

4
ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj

@ -111,4 +111,8 @@ @@ -111,4 +111,8 @@
<None Include="TestCases\Pretty\Readme.txt" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

4
ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs

@ -188,8 +188,8 @@ namespace ICSharpCode.Decompiler.CSharp @@ -188,8 +188,8 @@ namespace ICSharpCode.Decompiler.CSharp
return true;
if (settings.YieldReturn && YieldReturnDecompiler.IsCompilerGeneratorEnumerator(type))
return true;
// if (settings.AsyncAwait && AsyncDecompiler.IsCompilerGeneratedStateMachine(type))
// return true;
if (settings.AsyncAwait && AsyncAwaitDecompiler.IsCompilerGeneratedStateMachine(type))
return true;
} else if (type.IsCompilerGenerated()) {
// if (type.Name.StartsWith("<PrivateImplementationDetails>", StringComparison.Ordinal))
// return true;

8
ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs

@ -1730,6 +1730,14 @@ namespace ICSharpCode.Decompiler.CSharp @@ -1730,6 +1730,14 @@ namespace ICSharpCode.Decompiler.CSharp
.WithRR(new ByReferenceResolveResult(value.ResolveResult, false));
}
protected internal override TranslatedExpression VisitAwait(Await inst, TranslationContext context)
{
var value = Translate(inst.Value);
return new UnaryOperatorExpression(UnaryOperatorType.Await, value.Expression)
.WithILInstruction(inst)
.WithRR(new ResolveResult(inst?.GetResultMethod.ReturnType ?? SpecialType.UnknownType));
}
protected internal override TranslatedExpression VisitInvalidBranch(InvalidBranch inst, TranslationContext context)
{
string message = "Error";

12
ICSharpCode.Decompiler/CSharp/OutputVisitor/CSharpAmbience.cs

@ -31,12 +31,6 @@ namespace ICSharpCode.Decompiler.CSharp.OutputVisitor @@ -31,12 +31,6 @@ namespace ICSharpCode.Decompiler.CSharp.OutputVisitor
public ConversionFlags ConversionFlags { get; set; }
#region ConvertSymbol
[Obsolete("Use ConvertSymbol() instead")]
public string ConvertEntity(IEntity entity)
{
return ConvertSymbol(entity);
}
public string ConvertSymbol(ISymbol symbol)
{
if (symbol == null)
@ -47,12 +41,6 @@ namespace ICSharpCode.Decompiler.CSharp.OutputVisitor @@ -47,12 +41,6 @@ namespace ICSharpCode.Decompiler.CSharp.OutputVisitor
return writer.ToString();
}
[Obsolete("Use ConvertSymbol() instead")]
public void ConvertEntity(IEntity entity, TokenWriter writer, CSharpFormattingOptions formattingPolicy)
{
ConvertSymbol(entity, writer, formattingPolicy);
}
public void ConvertSymbol(ISymbol symbol, TokenWriter writer, CSharpFormattingOptions formattingPolicy)
{
if (symbol == null)

10
ICSharpCode.Decompiler/CSharp/Resolver/CSharpOperators.cs

@ -151,11 +151,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver @@ -151,11 +151,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver
get { return SymbolKind.Operator; }
}
[Obsolete("Use the SymbolKind property instead.")]
EntityType IEntity.EntityType {
get { return EntityType.Operator; }
}
DomRegion IEntity.Region {
get { return DomRegion.Empty; }
}
@ -224,11 +219,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver @@ -224,11 +219,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver
get { return compilation.MainAssembly; }
}
IMemberReference IMember.ToMemberReference()
{
throw new NotSupportedException();
}
ISymbolReference ISymbol.ToReference()
{
throw new NotSupportedException();

17
ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs

@ -352,17 +352,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver @@ -352,17 +352,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver
}
#endregion
#region Clone
/// <summary>
/// Creates a copy of this CSharp resolver.
/// </summary>
[Obsolete("CSharpResolver is immutable, cloning is no longer necessary")]
public CSharpResolver Clone()
{
return this;
}
#endregion
#region ResolveUnaryOperator
#region ResolveUnaryOperator method
public ResolveResult ResolveUnaryOperator(UnaryOperatorType op, ResolveResult expression)
@ -1720,12 +1709,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver @@ -1720,12 +1709,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver
return result;
}
[Obsolete("Use ResolveMemberAccess() with NameLookupMode.Type instead")]
public ResolveResult ResolveMemberType(ResolveResult target, string identifier, IList<IType> typeArguments)
{
return ResolveMemberAccess(target, identifier, typeArguments, NameLookupMode.Type);
}
ResolveResult ResolveMemberAccessOnNamespace(NamespaceResolveResult nrr, string identifier, IList<IType> typeArguments, bool parameterizeResultType)
{
if (typeArguments.Count == 0) {

12
ICSharpCode.Decompiler/CSharp/Resolver/ReducedExtensionMethod.cs

@ -93,11 +93,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver @@ -93,11 +93,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver
}
}
}
public IMemberReference ToMemberReference()
{
return new ReducedExtensionMethodMemberReference (baseMethod);
}
public IMemberReference ToReference()
{
@ -286,13 +281,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver @@ -286,13 +281,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver
}
}
[Obsolete("Use the SymbolKind property instead.")]
public EntityType EntityType {
get {
return baseMethod.EntityType;
}
}
public DomRegion Region {
get {
return baseMethod.Region;

36
ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs

@ -27,42 +27,6 @@ using System; @@ -27,42 +27,6 @@ using System;
namespace ICSharpCode.Decompiler.CSharp.Syntax
{
[Obsolete("This class is obsolete. Remove all referencing code.")]
public class EmptyExpression : AstNode
{
#region implemented abstract members of AstNode
public override void AcceptVisitor(IAstVisitor visitor)
{
throw new NotImplementedException();
}
public override T AcceptVisitor<T>(IAstVisitor<T> visitor)
{
throw new NotImplementedException();
}
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
{
throw new NotImplementedException();
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
throw new NotImplementedException();
}
public override NodeType NodeType {
get {
throw new NotImplementedException();
}
}
#endregion
}
public class ErrorExpression : Expression
{
TextLocation location;

1
ICSharpCode.Decompiler/CecilExtensions.cs

@ -211,7 +211,6 @@ namespace ICSharpCode.Decompiler @@ -211,7 +211,6 @@ namespace ICSharpCode.Decompiler
return null;
}
//[Obsolete("throwing exceptions is considered a bug")]
public static TypeDefinition ResolveOrThrow(this TypeReference typeReference)
{
var resolved = typeReference.Resolve();

7
ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj

@ -265,6 +265,7 @@ @@ -265,6 +265,7 @@
<Compile Include="IL\ControlFlow\ControlFlowGraph.cs" />
<Compile Include="IL\ControlFlow\StateRangeAnalysis.cs" />
<Compile Include="IL\ControlFlow\SymbolicExecution.cs" />
<Compile Include="IL\Instructions\Await.cs" />
<Compile Include="IL\Instructions\ILVariableCollection.cs" />
<Compile Include="IL\Instructions\NullCoalescingInstruction.cs" />
<Compile Include="IL\Patterns\AnyNode.cs" />
@ -388,7 +389,6 @@ @@ -388,7 +389,6 @@
<Compile Include="TypeSystem\DecompilerTypeSystem.cs" />
<Compile Include="TypeSystem\DefaultSolutionSnapshot.cs" />
<Compile Include="TypeSystem\DomRegion.cs" />
<Compile Include="TypeSystem\EntityType.cs" />
<Compile Include="TypeSystem\Error.cs" />
<Compile Include="TypeSystem\FullTypeName.cs" />
<Compile Include="TypeSystem\IAmbience.cs" />
@ -436,7 +436,6 @@ @@ -436,7 +436,6 @@
<Compile Include="TypeSystem\Implementation\DefaultVariable.cs" />
<Compile Include="TypeSystem\Implementation\DummyTypeParameter.cs" />
<Compile Include="TypeSystem\Implementation\ExplicitInterfaceImplementationMemberReference.cs" />
<Compile Include="TypeSystem\Implementation\FullNameAndTypeParameterCount.cs" />
<Compile Include="TypeSystem\Implementation\GetClassTypeReference.cs" />
<Compile Include="TypeSystem\Implementation\GetMembersHelper.cs" />
<Compile Include="TypeSystem\Implementation\KnownTypeCache.cs" />
@ -542,6 +541,10 @@ @@ -542,6 +541,10 @@
</Content>
</ItemGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
<Target Name="BeforeBuild">

218
ICSharpCode.Decompiler/IL/ControlFlow/AsyncAwaitDecompiler.cs

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
using ICSharpCode.Decompiler.IL.Transforms;
using ICSharpCode.Decompiler.CSharp;
using ICSharpCode.Decompiler.IL.Transforms;
using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.Decompiler.Util;
using System;
@ -15,18 +16,17 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -15,18 +16,17 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
/// </summary>
class AsyncAwaitDecompiler : IILTransform
{
/*
public static bool IsCompilerGeneratedStateMachine(TypeDefinition type)
public static bool IsCompilerGeneratedStateMachine(Mono.Cecil.TypeDefinition type)
{
if (!(type.DeclaringType != null && type.IsCompilerGenerated()))
return false;
foreach (TypeReference i in type.Interfaces) {
if (i.Namespace == "System.Runtime.CompilerServices" && i.Name == "IAsyncStateMachine")
foreach (var i in type.Interfaces) {
var iface = i.InterfaceType;
if (iface.Namespace == "System.Runtime.CompilerServices" && iface.Name == "IAsyncStateMachine")
return true;
}
return false;
}
*/
enum AsyncMethodType
{
@ -55,26 +55,48 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -55,26 +55,48 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
Block setResultAndExitBlock; // block that is jumped to for return statements
int finalState; // final state after the setResultAndExitBlock
ILVariable resultVar; // the variable that gets returned by the setResultAndExitBlock
ILVariable doFinallyBodies;
// These fields are set by AnalyzeStateMachine():
// For each block containing an 'await', stores the awaiter variable, and the field storing the awaiter
// across the yield point.
Dictionary<Block, (ILVariable awaiterVar, IField awaiterField)> awaitBlocks = new Dictionary<Block, (ILVariable awaiterVar, IField awaiterField)>();
public void Run(ILFunction function, ILTransformContext context)
{
if (!context.Settings.AsyncAwait)
return; // abort if async/await decompilation is disabled
this.context = context;
fieldToParameterMap.Clear();
awaitBlocks.Clear();
if (!MatchTaskCreationPattern(function))
return;
try {
AnalyzeMoveNext();
ValidateCatchBlock();
InlineBodyOfMoveNext(function);
AnalyzeStateMachine(function);
FinalizeInlineMoveNext(function);
} catch (SymbolicAnalysisFailedException) {
return;
}
InlineBodyOfMoveNext(function);
// Copy-propagate temporaries holding a copy of 'this'.
foreach (var stloc in function.Descendants.OfType<StLoc>().Where(s => s.Variable.IsSingleDefinition && s.Value.MatchLdThis()).ToList()) {
CopyPropagation.Propagate(stloc, context);
}
AnalyzeStateMachine(function);
DetectAwaitPattern(function);
context.Step("Translate fields to local accesses", function);
YieldReturnDecompiler.TranslateFieldsToLocalAccess(function, function, fieldToParameterMap);
FinalizeInlineMoveNext(function);
// Re-run control flow simplification over the newly constructed set of gotos,
// and inlining because TranslateFieldsToLocalAccess() might have opened up new inlining opportunities.
function.RunTransforms(CSharpDecompiler.EarlyILTransforms(), context);
}
#region MatchTaskCreationPattern
@ -396,6 +418,7 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -396,6 +418,7 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
}
function.Variables.AddRange(function.Descendants.OfType<IInstructionWithVariableOperand>().Select(inst => inst.Variable).Distinct());
function.Variables.RemoveDead();
function.Variables.AddRange(fieldToParameterMap.Values);
}
void FinalizeInlineMoveNext(ILFunction function)
@ -412,6 +435,8 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -412,6 +435,8 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
}
#endregion
#region AnalyzeStateMachine
/// <summary>
/// Analyze the the state machine; and replace 'leave IL_0000' with await+jump to block that gets
/// entered on the next MoveNext() call.
@ -427,16 +452,18 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -427,16 +452,18 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
sra.AssignStateRanges(container, LongSet.Universe);
foreach (var block in container.Blocks) {
context.CancellationToken.ThrowIfCancellationRequested();
if (block.Instructions.Last().MatchLeave((BlockContainer)moveNextFunction.Body)) {
// This is likely an 'await' block
if (AnalyzeAwaitBlock(block, out var awaiter, out var awaiterField, out var state)) {
block.Instructions.Add(new Await(new LdLoca(awaiter)));
if (AnalyzeAwaitBlock(block, out var awaiterVar, out var awaiterField, out var state)) {
block.Instructions.Add(new Await(new LdLoca(awaiterVar)));
Block targetBlock = sra.FindBlock(container, state);
if (targetBlock != null) {
block.Instructions.Add(new Branch(targetBlock));
} else {
block.Instructions.Add(new InvalidBranch("Could not find block for state " + state));
}
awaitBlocks.Add(block, (awaiterVar, awaiterField));
}
}
}
@ -458,7 +485,6 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -458,7 +485,6 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
awaiter = null;
awaiterField = null;
state = 0;
context.CancellationToken.ThrowIfCancellationRequested();
int pos = block.Instructions.Count - 2;
if (doFinallyBodies != null && block.Instructions[pos] is StLoc storeDoFinallyBodies) {
if (!(storeDoFinallyBodies.Variable.Kind == VariableKind.Local
@ -525,7 +551,9 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -525,7 +551,9 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
// delete preceding dead stores:
while (pos > 0 && block.Instructions[pos - 1] is StLoc stloc2
&& stloc2.Variable.IsSingleDefinition && stloc2.Variable.LoadCount == 0
&& stloc2.Variable.Kind == VariableKind.StackSlot) {
&& stloc2.Variable.Kind == VariableKind.StackSlot
&& SemanticHelper.IsPure(stloc2.Value.Flags))
{
pos--;
}
block.Instructions.RemoveRange(pos, block.Instructions.Count - pos);
@ -541,5 +569,167 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -541,5 +569,167 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
}
return inst;
}
#endregion
#region DetectAwaitPattern
void DetectAwaitPattern(ILFunction function)
{
context.StepStartGroup("DetectAwaitPattern", function);
foreach (var container in function.Descendants.OfType<BlockContainer>()) {
foreach (var block in container.Blocks) {
context.CancellationToken.ThrowIfCancellationRequested();
DetectAwaitPattern(block);
}
container.SortBlocks(deleteUnreachableBlocks: true);
}
context.StepEndGroup(keepIfEmpty: true);
}
void DetectAwaitPattern(Block block)
{
// block:
// stloc awaiterVar(callvirt GetAwaiter(...))
// if (call get_IsCompleted(ldloca awaiterVar)) br completedBlock
// br awaitBlock
// awaitBlock:
// ..
// br resumeBlock
// resumeBlock:
// ..
// br completedBlock
if (block.Instructions.Count < 3)
return;
// stloc awaiterVar(callvirt GetAwaiter(...))
if (!(block.Instructions[block.Instructions.Count - 3] is StLoc stLocAwaiter))
return;
ILVariable awaiterVar = stLocAwaiter.Variable;
if (!(stLocAwaiter.Value is CallInstruction getAwaiterCall))
return;
if (!(getAwaiterCall.Method.Name == "GetAwaiter" && (!getAwaiterCall.Method.IsStatic || getAwaiterCall.Method.IsExtensionMethod)))
return;
if (getAwaiterCall.Arguments.Count != 1)
return;
// if (call get_IsCompleted(ldloca awaiterVar)) br completedBlock
if (!block.Instructions[block.Instructions.Count - 2].MatchIfInstruction(out var condition, out var trueInst))
return;
if (!MatchCall(condition, "get_IsCompleted", out var isCompletedArgs) || isCompletedArgs.Count != 1)
return;
if (!isCompletedArgs[0].MatchLdLocRef(awaiterVar))
return;
if (!trueInst.MatchBranch(out var completedBlock))
return;
// br awaitBlock
if (!block.Instructions.Last().MatchBranch(out var awaitBlock))
return;
// Check awaitBlock and resumeBlock:
if (!awaitBlocks.TryGetValue(awaitBlock, out var awaitBlockData))
return;
if (awaitBlockData.awaiterVar != awaiterVar)
return;
if (!CheckAwaitBlock(awaitBlock, out var resumeBlock))
return;
if (!CheckResumeBlock(resumeBlock, awaiterVar, awaitBlockData.awaiterField, completedBlock))
return;
// Check completedBlock:
ILInstruction getResultCall;
if (completedBlock.Instructions[0] is StLoc resultStore) {
getResultCall = resultStore.Value;
} else {
getResultCall = completedBlock.Instructions[0];
resultStore = null;
}
if (!MatchCall(getResultCall, "GetResult", out var getResultArgs) || getResultArgs.Count != 1)
return;
if (!getResultArgs[0].MatchLdLocRef(awaiterVar))
return;
// All checks successful, let's transform.
context.Step("Transform await pattern", block);
block.Instructions.RemoveAt(block.Instructions.Count - 3); // remove getAwaiter call
block.Instructions.RemoveAt(block.Instructions.Count - 2); // remove if (isCompleted)
((Branch)block.Instructions.Last()).TargetBlock = completedBlock; // instead, directly jump to completed block
Await awaitInst = new Await(getAwaiterCall.Arguments.Single());
awaitInst.GetResultMethod = ((CallInstruction)getResultCall).Method;
awaitInst.GetAwaiterMethod = getAwaiterCall.Method;
if (resultStore != null) {
resultStore.Value = awaitInst;
} else {
completedBlock.Instructions[0] = awaitInst;
}
// Remove useless reset of awaiterVar.
if (completedBlock.Instructions[1] is StObj stobj) {
if (stobj.Target.MatchLdLoca(awaiterVar) && stobj.Value.OpCode == OpCode.DefaultValue) {
completedBlock.Instructions.RemoveAt(1);
}
}
}
bool CheckAwaitBlock(Block block, out Block resumeBlock)
{
// awaitBlock:
// await(ldloca V_2)
// br resumeBlock
resumeBlock = null;
if (block.Instructions.Count != 2)
return false;
if (block.Instructions[0].OpCode != OpCode.Await)
return false;
if (!block.Instructions[1].MatchBranch(out resumeBlock))
return false;
return true;
}
bool CheckResumeBlock(Block block, ILVariable awaiterVar, IField awaiterField, Block completedBlock)
{
int pos = 0;
// stloc awaiterVar(ldfld awaiterField(ldloc this))
if (!block.Instructions[pos].MatchStLoc(awaiterVar, out var value))
return false;
if (!value.MatchLdFld(out var target, out var field))
return false;
if (!target.MatchLdThis())
return false;
if (field.MemberDefinition != awaiterField)
return false;
pos++;
// stfld awaiterField(ldloc this, default.value)
if (block.Instructions[pos].MatchStFld(out target, out field, out value)
&& target.MatchLdThis()
&& field.MemberDefinition == awaiterField
&& value.OpCode == OpCode.DefaultValue)
{
pos++;
}
// stloc S_28(ldc.i4 -1)
// stloc cachedStateVar(ldloc S_28)
// stfld <>1__state(ldloc this, ldloc S_28)
ILVariable m1Var = null;
if (block.Instructions[pos] is StLoc stlocM1 && stlocM1.Value.MatchLdcI4(initialState) && stlocM1.Variable.Kind == VariableKind.StackSlot) {
m1Var = stlocM1.Variable;
pos++;
}
if (block.Instructions[pos] is StLoc stlocCachedState) {
if (stlocCachedState.Variable.Kind == VariableKind.Local && stlocCachedState.Variable.Index == cachedStateVar.Index) {
if (stlocCachedState.Value.MatchLdLoc(m1Var) || stlocCachedState.Value.MatchLdcI4(initialState))
pos++;
}
}
if (block.Instructions[pos].MatchStFld(out target, out field, out value)) {
if (!target.MatchLdThis())
return false;
if (field.MemberDefinition != stateField)
return false;
if (!(value.MatchLdcI4(initialState) || value.MatchLdLoc(m1Var)))
return false;
pos++;
} else {
return false;
}
return block.Instructions[pos].MatchBranch(completedBlock);
}
#endregion
}
}

6
ICSharpCode.Decompiler/IL/Instructions.cs

@ -727,6 +727,7 @@ namespace ICSharpCode.Decompiler.IL @@ -727,6 +727,7 @@ namespace ICSharpCode.Decompiler.IL
{
base.CheckInvariant(phase);
Debug.Assert(phase <= ILPhase.InILReader || this.IsDescendantOf(variable.Function));
Debug.Assert(phase <= ILPhase.InILReader || variable.Function.Variables[variable.IndexInFunction] == variable);
}
public static readonly SlotInfo InitSlot = new SlotInfo("Init", canInlineInto: true);
ILInstruction init;
@ -1790,6 +1791,7 @@ namespace ICSharpCode.Decompiler.IL @@ -1790,6 +1791,7 @@ namespace ICSharpCode.Decompiler.IL
{
base.CheckInvariant(phase);
Debug.Assert(phase <= ILPhase.InILReader || this.IsDescendantOf(variable.Function));
Debug.Assert(phase <= ILPhase.InILReader || variable.Function.Variables[variable.IndexInFunction] == variable);
}
public override StackType ResultType { get { return variable.StackType; } }
protected override InstructionFlags ComputeFlags()
@ -1873,6 +1875,7 @@ namespace ICSharpCode.Decompiler.IL @@ -1873,6 +1875,7 @@ namespace ICSharpCode.Decompiler.IL
{
base.CheckInvariant(phase);
Debug.Assert(phase <= ILPhase.InILReader || this.IsDescendantOf(variable.Function));
Debug.Assert(phase <= ILPhase.InILReader || variable.Function.Variables[variable.IndexInFunction] == variable);
}
public override void WriteTo(ITextOutput output)
{
@ -1946,6 +1949,7 @@ namespace ICSharpCode.Decompiler.IL @@ -1946,6 +1949,7 @@ namespace ICSharpCode.Decompiler.IL
{
base.CheckInvariant(phase);
Debug.Assert(phase <= ILPhase.InILReader || this.IsDescendantOf(variable.Function));
Debug.Assert(phase <= ILPhase.InILReader || variable.Function.Variables[variable.IndexInFunction] == variable);
}
public static readonly SlotInfo ValueSlot = new SlotInfo("Value", canInlineInto: true);
ILInstruction value;
@ -4053,7 +4057,7 @@ namespace ICSharpCode.Decompiler.IL @@ -4053,7 +4057,7 @@ namespace ICSharpCode.Decompiler.IL
clone.Value = this.value.Clone();
return clone;
}
public override StackType ResultType { get { return StackType.Void; } }
public override StackType ResultType { get { return GetResultMethod?.ReturnType.GetStackType() ?? StackType.Unknown; } }
protected override InstructionFlags ComputeFlags()
{
return InstructionFlags.SideEffect | value.Flags;

3
ICSharpCode.Decompiler/IL/Instructions.tt

@ -225,7 +225,7 @@ @@ -225,7 +225,7 @@
// note: "yield break" is always represented using a "leave" instruction
new OpCode("await", "C# await operator.",
SideEffect, // other code can run with arbitrary side effects while we're waiting
CustomArguments("value"), ResultType("Void")),
CustomArguments("value"), ResultType("GetResultMethod?.ReturnType.GetStackType() ?? StackType.Unknown")),
// patterns
new OpCode("AnyNode", "Matches any node", Pattern, CustomArguments(), CustomConstructor),
@ -869,6 +869,7 @@ protected override void Disconnected() @@ -869,6 +869,7 @@ protected override void Disconnected()
{
base.CheckInvariant(phase);
Debug.Assert(phase <= ILPhase.InILReader || this.IsDescendantOf(variable.Function));
Debug.Assert(phase <= ILPhase.InILReader || variable.Function.Variables[variable.IndexInFunction] == variable);
}");
}
};

11
ICSharpCode.Decompiler/TypeSystem/Implementation/FullNameAndTypeParameterCount.cs → ICSharpCode.Decompiler/IL/Instructions/Await.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team
// Copyright (c) 2017 Daniel Grunwald
//
// 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
@ -16,12 +16,13 @@ @@ -16,12 +16,13 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using ICSharpCode.Decompiler.TypeSystem;
namespace ICSharpCode.Decompiler.TypeSystem.Implementation
namespace ICSharpCode.Decompiler.IL
{
[Obsolete("This struct was renamed to 'TopLevelTypeName'.", true)]
public struct FullNameAndTypeParameterCount
partial class Await
{
public IMethod GetAwaiterMethod;
public IMethod GetResultMethod;
}
}

1
ICSharpCode.Decompiler/IL/Instructions/ILVariableCollection.cs

@ -88,6 +88,7 @@ namespace ICSharpCode.Decompiler.IL @@ -88,6 +88,7 @@ namespace ICSharpCode.Decompiler.IL
void RemoveAt(int index)
{
list[index].Function = null;
// swap-remove index
list[index] = list[list.Count - 1];
list[index].IndexInFunction = index;

32
ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs

@ -216,27 +216,33 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -216,27 +216,33 @@ namespace ICSharpCode.Decompiler.IL.Transforms
protected internal override void VisitStObj(StObj inst)
{
base.VisitStObj(inst);
ILVariable v;
if (inst.Target.MatchLdLoca(out v)
&& TypeUtils.IsCompatibleTypeForMemoryAccess(new ByReferenceType(v.Type), inst.Type)
&& inst.UnalignedPrefix == 0
&& !inst.IsVolatile)
{
context.Step("stobj(ldloca(v), ...) => stloc(v, ...)", inst);
inst.ReplaceWith(new StLoc(v, inst.Value));
if (StObjToStLoc(inst, context)) {
return;
}
ILInstruction target;
IType t;
BinaryNumericInstruction binary = inst.Value as BinaryNumericInstruction;
if (binary != null && binary.Left.MatchLdObj(out target, out t) && inst.Target.Match(target).Success) {
if (inst.Value is BinaryNumericInstruction binary
&& binary.Left.MatchLdObj(out ILInstruction target, out IType t)
&& inst.Target.Match(target).Success)
{
context.Step("compound assignment", inst);
// stobj(target, binary.op(ldobj(target), ...))
// => compound.op(target, ...)
inst.ReplaceWith(new CompoundAssignmentInstruction(binary.Operator, binary.Left, binary.Right, t, binary.CheckForOverflow, binary.Sign, CompoundAssignmentType.EvaluatesToNewValue));
}
}
internal static bool StObjToStLoc(StObj inst, ILTransformContext context)
{
if (inst.Target.MatchLdLoca(out ILVariable v)
&& TypeUtils.IsCompatibleTypeForMemoryAccess(new ByReferenceType(v.Type), inst.Type)
&& inst.UnalignedPrefix == 0
&& !inst.IsVolatile) {
context.Step("stobj(ldloca(v), ...) => stloc(v, ...)", inst);
inst.ReplaceWith(new StLoc(v, inst.Value));
return true;
}
return false;
}
protected internal override void VisitIfInstruction(IfInstruction inst)
{

3
ICSharpCode.Decompiler/IL/Transforms/ILInlining.cs

@ -261,10 +261,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -261,10 +261,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms
// decide based on the source expression being inlined
switch (inlinedExpression.OpCode) {
case OpCode.DefaultValue:
return true;
case OpCode.StObj:
return true;
case OpCode.CompoundAssignmentInstruction:
case OpCode.Await:
return true;
case OpCode.LdLoc:
if (v.StateMachineField == null && ((LdLoc)inlinedExpression).Variable.StateMachineField != null) {

4
ICSharpCode.Decompiler/IL/Transforms/RemoveDeadVariableInit.cs

@ -37,8 +37,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -37,8 +37,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms
v.HasInitialValue = false;
}
}
if (function.IsIterator) {
// In yield return, the C# compiler tends to store null/default(T) to variables
if (function.IsIterator || function.IsAsync) {
// In yield return + async, the C# compiler tends to store null/default(T) to variables
// when the variable goes out of scope. Remove such useless stores.
foreach (var v in function.Variables) {
if (v.Kind == VariableKind.Local && v.StoreCount == 1 && v.LoadCount == 0 && v.AddressCount == 0) {

16
ICSharpCode.Decompiler/Semantics/Conversion.cs

@ -74,22 +74,6 @@ namespace ICSharpCode.Decompiler.Semantics @@ -74,22 +74,6 @@ namespace ICSharpCode.Decompiler.Semantics
/// </summary>
public static readonly Conversion TryCast = new BuiltinConversion(false, 9);
[Obsolete("Use UserDefinedConversion() instead")]
public static Conversion UserDefinedImplicitConversion(IMethod operatorMethod, Conversion conversionBeforeUserDefinedOperator, Conversion conversionAfterUserDefinedOperator, bool isLifted)
{
if (operatorMethod == null)
throw new ArgumentNullException("operatorMethod");
return new UserDefinedConv(true, operatorMethod, conversionBeforeUserDefinedOperator, conversionAfterUserDefinedOperator, isLifted, false);
}
[Obsolete("Use UserDefinedConversion() instead")]
public static Conversion UserDefinedExplicitConversion(IMethod operatorMethod, Conversion conversionBeforeUserDefinedOperator, Conversion conversionAfterUserDefinedOperator, bool isLifted)
{
if (operatorMethod == null)
throw new ArgumentNullException("operatorMethod");
return new UserDefinedConv(false, operatorMethod, conversionBeforeUserDefinedOperator, conversionAfterUserDefinedOperator, isLifted, false);
}
public static Conversion UserDefinedConversion(IMethod operatorMethod, bool isImplicit, Conversion conversionBeforeUserDefinedOperator, Conversion conversionAfterUserDefinedOperator, bool isLifted = false, bool isAmbiguous = false)
{
if (operatorMethod == null)

13
ICSharpCode.Decompiler/TypeSystem/CecilLoader.cs

@ -109,19 +109,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -109,19 +109,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
{
}
/// <summary>
/// Initializes a new instance of the <see cref="CecilLoader"/> class.
/// </summary>
/// <param name='createCecilReferences'>
/// If true references to the cecil objects are hold. In this case the cecil loader can do a type system -> cecil mapping.
/// </param>
[Obsolete("The built-in entity<->cecil mapping is obsolete. Use the OnEntityLoaded callback instead!")]
public CecilLoader(bool createCecilReferences) : this()
{
if (createCecilReferences)
typeSystemTranslationTable = new Dictionary<object, object> ();
}
/// <summary>
/// Creates a nested CecilLoader for lazy-loading.
/// </summary>

63
ICSharpCode.Decompiler/TypeSystem/EntityType.cs

@ -1,63 +0,0 @@ @@ -1,63 +0,0 @@
// Copyright (c) 2010-2013 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;
namespace ICSharpCode.Decompiler.TypeSystem
{
[Obsolete("Use SymbolKind instead")]
public enum EntityType : byte
{
None = SymbolKind.None,
/// <seealso cref="ITypeDefinition"/>
TypeDefinition = SymbolKind.TypeDefinition,
/// <seealso cref="IField"/>
Field = SymbolKind.Field,
/// <summary>
/// The symbol is a property, but not an indexer.
/// </summary>
/// <seealso cref="IProperty"/>
Property = SymbolKind.Property,
/// <summary>
/// The symbol is an indexer, not a regular property.
/// </summary>
/// <seealso cref="IProperty"/>
Indexer = SymbolKind.Indexer,
/// <seealso cref="IEvent"/>
Event = SymbolKind.Event,
/// <summary>
/// The symbol is a method which is not an operator/constructor/destructor or accessor.
/// </summary>
/// <seealso cref="IMethod"/>
Method = SymbolKind.Method,
/// <summary>
/// The symbol is a user-defined operator.
/// </summary>
/// <seealso cref="IMethod"/>
Operator = SymbolKind.Operator,
/// <seealso cref="IMethod"/>
Constructor = SymbolKind.Constructor,
/// <seealso cref="IMethod"/>
Destructor = SymbolKind.Destructor,
/// <summary>
/// The accessor method for a property getter/setter or event add/remove.
/// </summary>
/// <seealso cref="IMethod"/>
Accessor = SymbolKind.Accessor,
}
}

4
ICSharpCode.Decompiler/TypeSystem/IAmbience.cs

@ -94,12 +94,8 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -94,12 +94,8 @@ namespace ICSharpCode.Decompiler.TypeSystem
{
ConversionFlags ConversionFlags { get; set; }
[Obsolete("Use ConvertSymbol() instead")]
string ConvertEntity(IEntity entity);
string ConvertSymbol(ISymbol symbol);
string ConvertType(IType type);
[Obsolete("Use ConvertSymbol() instead")]
string ConvertVariable(IVariable variable);
string ConvertConstantValue(object constantValue);
string WrapComment(string comment);

6
ICSharpCode.Decompiler/TypeSystem/IEntity.cs

@ -93,12 +93,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -93,12 +93,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
/// </summary>
public interface IEntity : ISymbol, ICompilationProvider, INamedElement, IHasAccessibility
{
/// <summary>
/// Gets the entity type.
/// </summary>
[Obsolete("Use the SymbolKind property instead.")]
EntityType EntityType { get; }
/// <summary>
/// Gets the short name of the entity.
/// </summary>

10
ICSharpCode.Decompiler/TypeSystem/IMember.cs

@ -166,16 +166,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -166,16 +166,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
/// If this member is specialized using open generic types, the resulting member reference will need to be looked up in an appropriate generic context.
/// Otherwise, the main resolve context of a compilation is sufficient.
/// </remarks>
[Obsolete("Use the ToReference method instead.")]
IMemberReference ToMemberReference();
/// <summary>
/// Creates a member reference that can be used to rediscover this member in another compilation.
/// </summary>
/// <remarks>
/// If this member is specialized using open generic types, the resulting member reference will need to be looked up in an appropriate generic context.
/// Otherwise, the main resolve context of a compilation is sufficient.
/// </remarks>
new IMemberReference ToReference();
/// <summary>

6
ICSharpCode.Decompiler/TypeSystem/IMethod.cs

@ -44,12 +44,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -44,12 +44,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
/// Gets whether the method is a C#-style async method.
/// </summary>
bool IsAsync { get; }
[Obsolete("Use IsPartial && !HasBody instead")]
bool IsPartialMethodDeclaration { get; }
[Obsolete("Use IsPartial && HasBody instead")]
bool IsPartialMethodImplementation { get; }
/// <summary>
/// Gets whether the method has a body.

12
ICSharpCode.Decompiler/TypeSystem/IProjectContent.cs

@ -136,18 +136,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -136,18 +136,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
/// </summary>
IProjectContent RemoveFiles(params string[] fileNames);
/// <summary>
/// Removes types and attributes from oldFile from the project, and adds those from newFile.
/// </summary>
[Obsolete("Use RemoveFiles()/AddOrUpdateFiles() instead")]
IProjectContent UpdateProjectContent(IUnresolvedFile oldFile, IUnresolvedFile newFile);
/// <summary>
/// Removes types and attributes from oldFiles from the project, and adds those from newFiles.
/// </summary>
[Obsolete("Use RemoveFiles()/AddOrUpdateFiles() instead")]
IProjectContent UpdateProjectContent(IEnumerable<IUnresolvedFile> oldFiles, IEnumerable<IUnresolvedFile> newFiles);
/// <summary>
/// Sets the compiler settings object.
/// The concrete type of the settings object depends on the programming language used to implement this project.

3
ICSharpCode.Decompiler/TypeSystem/IUnresolvedFile.cs

@ -22,9 +22,6 @@ using ICSharpCode.Decompiler.CSharp.Syntax; @@ -22,9 +22,6 @@ using ICSharpCode.Decompiler.CSharp.Syntax;
namespace ICSharpCode.Decompiler.TypeSystem
{
[Obsolete("IParsedFile was renamed to IUnresolvedFile", true)]
public interface IParsedFile {}
/// <summary>
/// Represents a single file that was parsed.
/// </summary>

5
ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractResolvedEntity.cs

@ -44,11 +44,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -44,11 +44,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
get { return unresolved.SymbolKind; }
}
[Obsolete("Use the SymbolKind property instead.")]
public EntityType EntityType {
get { return (EntityType)unresolved.SymbolKind; }
}
public DomRegion Region {
get { return unresolved.Region; }
}

5
ICSharpCode.Decompiler/TypeSystem/Implementation/AbstractResolvedMember.cs

@ -129,11 +129,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -129,11 +129,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
}
}
public virtual IMemberReference ToMemberReference()
{
return (IMemberReference)ToReference();
}
internal IMethod GetAccessor(ref IMethod accessorField, IUnresolvedMethod unresolvedAccessor)
{
if (unresolvedAccessor == null)

3
ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultAssemblyReference.cs

@ -28,9 +28,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -28,9 +28,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
{
public static readonly IAssemblyReference CurrentAssembly = new CurrentAssemblyReference();
[Obsolete("The corlib is not always called 'mscorlib' (as returned by this property), but might be 'System.Runtime'.")]
public static readonly IAssemblyReference Corlib = new DefaultAssemblyReference("mscorlib");
readonly string shortName;
public DefaultAssemblyReference(string assemblyName)

5
ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedMethod.cs

@ -246,11 +246,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -246,11 +246,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
}
}
public override IMemberReference ToMemberReference()
{
return (IMemberReference)ToReference();
}
public override IMember Specialize(TypeParameterSubstitution substitution)
{
if (TypeParameterSubstitution.Identity.Equals(substitution))

5
ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultResolvedTypeDefinition.cs

@ -114,11 +114,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -114,11 +114,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
get { return parts[0].SymbolKind; }
}
[Obsolete("Use the SymbolKind property instead.")]
public EntityType EntityType {
get { return (EntityType)parts[0].SymbolKind; }
}
public virtual TypeKind Kind {
get { return parts[0].Kind; }
}

26
ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultUnresolvedMethod.cs

@ -138,32 +138,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -138,32 +138,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
}
}
[Obsolete]
public bool IsPartialMethodDeclaration {
get { return IsPartial && !HasBody; }
set {
if (value) {
IsPartial = true;
HasBody = false;
} else if (!value && IsPartial && !HasBody) {
IsPartial = false;
}
}
}
[Obsolete]
public bool IsPartialMethodImplementation {
get { return IsPartial && HasBody; }
set {
if (value) {
IsPartial = true;
HasBody = true;
} else if (!value && IsPartial && HasBody) {
IsPartial = false;
}
}
}
public IList<IUnresolvedParameter> Parameters {
get {
if (parameters == null)

7
ICSharpCode.Decompiler/TypeSystem/Implementation/GetClassTypeReference.cs

@ -80,13 +80,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -80,13 +80,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
/// </summary>
public FullTypeName FullTypeName { get { return fullTypeName; } }
[Obsolete("Use the FullTypeName property instead. GetClassTypeReference now supports nested types, where the Namespace/Name/TPC tripel isn't sufficient for identifying the type.")]
public string Namespace { get { return fullTypeName.TopLevelTypeName.Namespace; } }
[Obsolete("Use the FullTypeName property instead. GetClassTypeReference now supports nested types, where the Namespace/Name/TPC tripel isn't sufficient for identifying the type.")]
public string Name { get { return fullTypeName.Name; } }
[Obsolete("Use the FullTypeName property instead. GetClassTypeReference now supports nested types, where the Namespace/Name/TPC tripel isn't sufficient for identifying the type.")]
public int TypeParameterCount { get { return fullTypeName.TypeParameterCount; } }
IType ResolveInAllAssemblies(ITypeResolveContext context)
{
var compilation = context.Compilation;

20
ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMember.cs

@ -58,21 +58,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -58,21 +58,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
this.substitution = TypeParameterSubstitution.Compose(newSubstitution, this.substitution);
}
[Obsolete("Use IMember.Specialize() instead")]
public static IMember Create(IMember memberDefinition, TypeParameterSubstitution substitution)
{
if (memberDefinition == null) {
return null;
} else {
return memberDefinition.Specialize(substitution);
}
}
public virtual IMemberReference ToMemberReference()
{
return ToReference();
}
public virtual IMemberReference ToReference()
{
return new SpecializingMemberReference(
@ -185,11 +170,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -185,11 +170,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
get { return baseMember.SymbolKind; }
}
[Obsolete("Use the SymbolKind property instead.")]
public EntityType EntityType {
get { return baseMember.EntityType; }
}
public DomRegion Region {
get { return baseMember.Region; }
}

7
ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedMethod.cs

@ -158,7 +158,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -158,7 +158,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
// the generic method itself is parameterized, not if the generic method is only
// specialized with class type arguments.
// This is necessary due to this part of the ToMemberReference() contract:
// This is necessary due to this part of the ToReference() contract:
// If this member is specialized using open generic types, the resulting member reference will need to be looked up in an appropriate generic context.
// Otherwise, the main resolve context of a compilation is sufficient.
// ->
@ -175,11 +175,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -175,11 +175,6 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
}
}
public override IMemberReference ToMemberReference()
{
return ToReference();
}
public override bool Equals(object obj)
{
SpecializedMethod other = obj as SpecializedMethod;

11
ICSharpCode.Decompiler/TypeSystem/ParameterListComparer.cs

@ -56,17 +56,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -56,17 +56,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
static readonly NormalizeTypeVisitor normalizationVisitor = new NormalizeTypeVisitor();
/// <summary>
/// Replaces all occurrences of method type parameters in the given type
/// by normalized type parameters. This allows comparing parameter types from different
/// generic methods.
/// </summary>
[Obsolete("Use DummyTypeParameter.NormalizeMethodTypeParameters instead if you only need to normalize type parameters. Also, consider if you need to normalize object vs. dynamic as well.")]
public IType NormalizeMethodTypeParameters(IType type)
{
return DummyTypeParameter.NormalizeMethodTypeParameters(type);
}
public bool Equals(IList<IParameter> x, IList<IParameter> y)
{
if (x == y)

17
ICSharpCode.Decompiler/TypeSystem/VarArgInstanceMethod.cs

@ -165,13 +165,7 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -165,13 +165,7 @@ namespace ICSharpCode.Decompiler.TypeSystem
#endregion
#region IMember implementation
[Obsolete("Use the ToReference method instead.")]
public IMemberReference ToMemberReference()
{
return ToReference();
}
public IMemberReference ToReference()
{
throw new NotImplementedException();
@ -238,14 +232,7 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -238,14 +232,7 @@ namespace ICSharpCode.Decompiler.TypeSystem
#endregion
#region IEntity implementation
[Obsolete]
public EntityType EntityType {
get {
throw new NotImplementedException();
}
}
public DomRegion Region {
get { return baseMethod.Region; }
}

58
ILSpy/ILSpy.csproj

@ -160,6 +160,11 @@ @@ -160,6 +160,11 @@
<Compile Include="Commands\RefreshCommand.cs" />
<Compile Include="Commands\SaveCommand.cs" />
<Compile Include="SearchPane.cs">
<DependentUpon>SearchPane.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="LogWindow.xaml.cs">
<DependentUpon>LogWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Commands\SimpleCommand.cs" />
@ -246,7 +251,9 @@ @@ -246,7 +251,9 @@
</Compile>
<Compile Include="SessionSettings.cs" />
<Compile Include="TextView\CaretHighlightAdorner.cs" />
<Compile Include="TextView\DecompilerTextView.cs" />
<Compile Include="TextView\DecompilerTextView.cs">
<DependentUpon>DecompilerTextView.xaml</DependentUpon>
</Compile>
<Compile Include="TextView\OutputLengthExceededException.cs" />
<Compile Include="TextView\ReferenceElementGenerator.cs" />
<Compile Include="TextView\AvalonEditTextOutput.cs" />
@ -280,36 +287,20 @@ @@ -280,36 +287,20 @@
</ItemGroup>
<ItemGroup>
<Page Include="Controls\ResourceObjectTable.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Controls\ResourceObjectTable.xaml" />
<Page Include="Controls\ResourceStringTable.xaml" />
<Page Include="Controls\SearchBoxStyle.xaml">
<DependentUpon>SearchBox.cs</DependentUpon>
</Page>
<Page Include="CreateListDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="DebugSteps.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\SearchBoxStyle.xaml" />
<Page Include="CreateListDialog.xaml" />
<Page Include="DebugSteps.xaml" />
<Page Include="MainWindow.xaml" />
<Page Include="OpenFromGacDialog.xaml" />
<Page Include="OpenListDialog.xaml" />
<Page Include="Options\DecompilerSettingsPanel.xaml" />
<Page Include="Options\DisplaySettingsPanel.xaml" />
<Page Include="Options\OptionsDialog.xaml" />
<Page Include="SearchPane.xaml">
<DependentUpon>SearchPane.cs</DependentUpon>
</Page>
<Page Include="LogWindow.xaml">
<DependentUpon>LogWindow.xaml.cs</DependentUpon>
</Page>
<Page Include="TextView\DecompilerTextView.xaml">
<DependentUpon>DecompilerTextView.cs</DependentUpon>
</Page>
<Page Include="SearchPane.xaml" />
<Page Include="TextView\DecompilerTextView.xaml" />
<Page Include="LogWindow.xaml" />
<Page Include="themes\generic.xaml" />
</ItemGroup>
@ -369,4 +360,23 @@ @@ -369,4 +360,23 @@
<Resource Include="Images\Sort.png" />
</ItemGroup>
<ItemGroup>
<Page Update="@(Page)" SubType="Designer" Generator="MSBuild:Compile" />
</ItemGroup>
<ItemGroup>
<None Include="@(Page)" />
<None Include="@(Resource)" />
</ItemGroup>
<!--
Work around to fix Intellisense file generation for XAML projects
https://github.com/dotnet/project-system/issues/2488
-->
<Target Name="WorkaroundForXAMLIntellisenseBuildIssue" AfterTargets="_CheckCompileDesignTimePrerequisite">
<PropertyGroup>
<BuildingProject>false</BuildingProject>
</PropertyGroup>
</Target>
</Project>

372
Rebracer.xml

@ -1,372 +0,0 @@ @@ -1,372 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!--Rebracer Solution Settings File-->
<!--This file contains Visual Studio settings for ILSpy.sln.-->
<!--Rebracer uses this file to apply settings for this solution-->
<!--when the solution is opened.-->
<!--Install Rebracer from http://visualstudiogallery.msdn.microsoft.com/410e9b9f-65f3-4495-b68e-15567e543c58 -->
<!--See https://github.com/SLaks/Rebracer for more information-->
<UserSettings>
<ToolsOptions>
<ToolsOptionsCategory name="Environment">
<ToolsOptionsSubCategory name="TaskList">
<PropertyValue name="CommentTokens" ArrayType="VT_VARIANT" ArrayElementCount="4">
<PropertyValue name="0">HACK:2</PropertyValue>
<PropertyValue name="1">TODO:2</PropertyValue>
<PropertyValue name="2">UNDONE:2</PropertyValue>
<PropertyValue name="3">UnresolvedMergeConflict:3</PropertyValue>
</PropertyValue>
<PropertyValue name="ConfirmTaskDeletion">false</PropertyValue>
<PropertyValue name="DontShowFilePaths">false</PropertyValue>
<PropertyValue name="WarnOnAddingHiddenItem">false</PropertyValue>
</ToolsOptionsSubCategory>
</ToolsOptionsCategory>
<ToolsOptionsCategory name="TextEditor">
<ToolsOptionsSubCategory name="CSharp-Specific">
<PropertyValue name="AddImport_SuggestForTypesInNuGetPackages">0</PropertyValue>
<PropertyValue name="AddImport_SuggestForTypesInReferenceAssemblies">0</PropertyValue>
<PropertyValue name="AutoComment">1</PropertyValue>
<PropertyValue name="AutoInsertAsteriskForNewLinesOfBlockComments">1</PropertyValue>
<PropertyValue name="BringUpOnIdentifier">1</PropertyValue>
<PropertyValue name="CSharpClosedFileDiagnostics">-1</PropertyValue>
<PropertyValue name="ClosedFileDiagnostics">-1</PropertyValue>
<PropertyValue name="CodeDefinitionWindow_DocumentationComment_IndentBase">1</PropertyValue>
<PropertyValue name="CodeDefinitionWindow_DocumentationComment_IndentOffset">2</PropertyValue>
<PropertyValue name="CodeDefinitionWindow_DocumentationComment_WrapLength">80</PropertyValue>
<PropertyValue name="DisplayLineSeparators">0</PropertyValue>
<PropertyValue name="EnableHighlightRelatedKeywords">1</PropertyValue>
<PropertyValue name="EnterKeyBehavior">0</PropertyValue>
<PropertyValue name="ExtractMethod_AllowMovingDeclaration">0</PropertyValue>
<PropertyValue name="ExtractMethod_DoNotPutOutOrRefOnStruct">1</PropertyValue>
<PropertyValue name="Formatting_TriggerOnBlockCompletion">1</PropertyValue>
<PropertyValue name="Formatting_TriggerOnPaste">1</PropertyValue>
<PropertyValue name="Formatting_TriggerOnStatementCompletion">1</PropertyValue>
<PropertyValue name="HighlightMatchingPortionsOfCompletionListItems">1</PropertyValue>
<PropertyValue name="ImplementInterface_InsertRegionTags">0</PropertyValue>
<PropertyValue name="Indent_BlockContents">1</PropertyValue>
<PropertyValue name="Indent_Braces">0</PropertyValue>
<PropertyValue name="Indent_CaseContents">1</PropertyValue>
<PropertyValue name="Indent_CaseLabels">1</PropertyValue>
<PropertyValue name="Indent_FlushLabelsLeft">0</PropertyValue>
<PropertyValue name="Indent_UnindentLabels">2</PropertyValue>
<PropertyValue name="InsertNewlineOnEnterWithWholeWord">0</PropertyValue>
<PropertyValue name="NewLines_AnonymousTypeInitializer_EachMember">0</PropertyValue>
<PropertyValue name="NewLines_Braces_Accessor">0</PropertyValue>
<PropertyValue name="NewLines_Braces_AnonymousMethod">0</PropertyValue>
<PropertyValue name="NewLines_Braces_AnonymousTypeInitializer">0</PropertyValue>
<PropertyValue name="NewLines_Braces_ArrayInitializer">0</PropertyValue>
<PropertyValue name="NewLines_Braces_CollectionInitializer">0</PropertyValue>
<PropertyValue name="NewLines_Braces_ControlFlow">0</PropertyValue>
<PropertyValue name="NewLines_Braces_LambdaExpressionBody">0</PropertyValue>
<PropertyValue name="NewLines_Braces_Method">1</PropertyValue>
<PropertyValue name="NewLines_Braces_ObjectInitializer">0</PropertyValue>
<PropertyValue name="NewLines_Braces_Property">0</PropertyValue>
<PropertyValue name="NewLines_Braces_Type">1</PropertyValue>
<PropertyValue name="NewLines_Keywords_Catch">0</PropertyValue>
<PropertyValue name="NewLines_Keywords_Else">0</PropertyValue>
<PropertyValue name="NewLines_Keywords_Finally">0</PropertyValue>
<PropertyValue name="NewLines_ObjectInitializer_EachMember">0</PropertyValue>
<PropertyValue name="NewLines_QueryExpression_EachClause">0</PropertyValue>
<PropertyValue name="RemoveUnusedUsings">1</PropertyValue>
<PropertyValue name="RenameTrackingPreview">1</PropertyValue>
<PropertyValue name="ShowCompletionItemFilters">1</PropertyValue>
<PropertyValue name="ShowKeywords">1</PropertyValue>
<PropertyValue name="ShowSnippets">1</PropertyValue>
<PropertyValue name="SnippetsBehavior">0</PropertyValue>
<PropertyValue name="SortUsings">1</PropertyValue>
<PropertyValue name="SortUsings_PlaceSystemFirst">1</PropertyValue>
<PropertyValue name="Space_AfterBasesColon">1</PropertyValue>
<PropertyValue name="Space_AfterCast">0</PropertyValue>
<PropertyValue name="Space_AfterComma">1</PropertyValue>
<PropertyValue name="Space_AfterDot">0</PropertyValue>
<PropertyValue name="Space_AfterLambdaArrow">1</PropertyValue>
<PropertyValue name="Space_AfterMethodCallName">0</PropertyValue>
<PropertyValue name="Space_AfterMethodDeclarationName">0</PropertyValue>
<PropertyValue name="Space_AfterSemicolonsInForStatement">1</PropertyValue>
<PropertyValue name="Space_AroundBinaryOperator">1</PropertyValue>
<PropertyValue name="Space_BeforeBasesColon">1</PropertyValue>
<PropertyValue name="Space_BeforeComma">0</PropertyValue>
<PropertyValue name="Space_BeforeDot">0</PropertyValue>
<PropertyValue name="Space_BeforeLambdaArrow">1</PropertyValue>
<PropertyValue name="Space_BeforeOpenSquare">0</PropertyValue>
<PropertyValue name="Space_BeforeSemicolonsInForStatement">0</PropertyValue>
<PropertyValue name="Space_BetweenEmptyMethodCallParentheses">0</PropertyValue>
<PropertyValue name="Space_BetweenEmptyMethodDeclarationParentheses">0</PropertyValue>
<PropertyValue name="Space_BetweenEmptySquares">0</PropertyValue>
<PropertyValue name="Space_InControlFlowConstruct">1</PropertyValue>
<PropertyValue name="Space_Normalize">0</PropertyValue>
<PropertyValue name="Space_WithinCastParentheses">0</PropertyValue>
<PropertyValue name="Space_WithinExpressionParentheses">0</PropertyValue>
<PropertyValue name="Space_WithinMethodCallParentheses">0</PropertyValue>
<PropertyValue name="Space_WithinMethodDeclarationParentheses">0</PropertyValue>
<PropertyValue name="Space_WithinOtherParentheses">0</PropertyValue>
<PropertyValue name="Space_WithinSquares">0</PropertyValue>
<PropertyValue name="Style_NamingPreferences">&lt;NamingPreferencesInfo SerializationVersion="4"&gt;
&lt;SymbolSpecifications&gt;
&lt;SymbolSpecification ID="5c545a62-b14d-460a-88d8-e936c0a39316" Name="Class"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;TypeKind&gt;Class&lt;/TypeKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Protected&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;ProtectedOrInternal&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList /&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="23d856b4-5089-4405-83ce-749aada99153" Name="Interface"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;TypeKind&gt;Interface&lt;/TypeKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Protected&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;ProtectedOrInternal&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList /&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="d1796e78-ff66-463f-8576-eb46416060c0" Name="Struct"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;TypeKind&gt;Struct&lt;/TypeKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Protected&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;ProtectedOrInternal&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList /&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="d8af8dc6-1ade-441d-9947-8946922e198a" Name="Enum"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;TypeKind&gt;Enum&lt;/TypeKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Protected&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;ProtectedOrInternal&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList /&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="408a3347-b908-4b54-a954-1355e64c1de3" Name="Delegate"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;TypeKind&gt;Delegate&lt;/TypeKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Protected&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;ProtectedOrInternal&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList /&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="830657f6-e7e5-4830-b328-f109d3b6c165" Name="Event"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;SymbolKind&gt;Event&lt;/SymbolKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Protected&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;ProtectedOrInternal&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList /&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="390caed4-f0a9-42bb-adbb-b44c4a302a22" Name="Method"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;SymbolKind&gt;Method&lt;/SymbolKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList /&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="af410767-f189-47c6-b140-aeccf1ff242e" Name="Private Method"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;SymbolKind&gt;Method&lt;/SymbolKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList /&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="8076757e-6a4a-47f1-9b4b-ae8a3284e987" Name="Abstract Method"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;SymbolKind&gt;Method&lt;/SymbolKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Protected&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;ProtectedOrInternal&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList&gt;
&lt;ModifierKind&gt;IsAbstract&lt;/ModifierKind&gt;
&lt;/RequiredModifierList&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="16133061-a8e7-4392-92c3-1d93cd54c218" Name="Static Method"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;SymbolKind&gt;Method&lt;/SymbolKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Protected&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;ProtectedOrInternal&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList&gt;
&lt;ModifierKind&gt;IsStatic&lt;/ModifierKind&gt;
&lt;/RequiredModifierList&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="da6a2919-5aa6-4ad1-a24d-576776ed3974" Name="Property"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;SymbolKind&gt;Property&lt;/SymbolKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Protected&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;ProtectedOrInternal&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList /&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="b24a91ce-3501-4799-b6df-baf044156c83" Name="Public or Protected Field"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;SymbolKind&gt;Field&lt;/SymbolKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Protected&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList /&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="70af42cb-1741-4027-969c-9edc4877d965" Name="Static Field"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;SymbolKind&gt;Field&lt;/SymbolKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Protected&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;ProtectedOrInternal&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList&gt;
&lt;ModifierKind&gt;IsStatic&lt;/ModifierKind&gt;
&lt;/RequiredModifierList&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="10790aa6-0a0b-432d-a52d-d252ca92302b" Name="Private or Internal Field"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;SymbolKind&gt;Field&lt;/SymbolKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList /&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="ac995be4-88de-4771-9dcc-a456a7c02d89" Name="Private or Internal Static Field"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;SymbolKind&gt;Field&lt;/SymbolKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList&gt;
&lt;ModifierKind&gt;IsStatic&lt;/ModifierKind&gt;
&lt;/RequiredModifierList&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="2c07f5bf-bc81-4c2b-82b4-ae9b3ffd0ba4" Name="Types"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;TypeKind&gt;Class&lt;/TypeKind&gt;
&lt;TypeKind&gt;Struct&lt;/TypeKind&gt;
&lt;TypeKind&gt;Interface&lt;/TypeKind&gt;
&lt;TypeKind&gt;Enum&lt;/TypeKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Protected&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;ProtectedOrInternal&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList /&gt;
&lt;/SymbolSpecification&gt;
&lt;SymbolSpecification ID="5f3ddba1-279f-486c-801e-5c097c36dd85" Name="Non-Field Members"&gt;
&lt;ApplicableSymbolKindList&gt;
&lt;SymbolKind&gt;Property&lt;/SymbolKind&gt;
&lt;SymbolKind&gt;Method&lt;/SymbolKind&gt;
&lt;SymbolKind&gt;Event&lt;/SymbolKind&gt;
&lt;/ApplicableSymbolKindList&gt;
&lt;ApplicableAccessibilityList&gt;
&lt;AccessibilityKind&gt;Public&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Internal&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Private&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;Protected&lt;/AccessibilityKind&gt;
&lt;AccessibilityKind&gt;ProtectedOrInternal&lt;/AccessibilityKind&gt;
&lt;/ApplicableAccessibilityList&gt;
&lt;RequiredModifierList /&gt;
&lt;/SymbolSpecification&gt;
&lt;/SymbolSpecifications&gt;
&lt;NamingStyles&gt;
&lt;NamingStyle ID="87e7c501-9948-4b53-b1eb-a6cbe918feee" Name="Pascal Case" Prefix="" Suffix="" WordSeparator="" CapitalizationScheme="PascalCase" /&gt;
&lt;NamingStyle ID="1ecc5eb6-b5fc-49a5-a9f1-a980f3e48c92" Name="Begins with I" Prefix="I" Suffix="" WordSeparator="" CapitalizationScheme="PascalCase" /&gt;
&lt;/NamingStyles&gt;
&lt;NamingRules&gt;
&lt;SerializableNamingRule SymbolSpecificationID="23d856b4-5089-4405-83ce-749aada99153" NamingStyleID="1ecc5eb6-b5fc-49a5-a9f1-a980f3e48c92" EnforcementLevel="Info" /&gt;
&lt;SerializableNamingRule SymbolSpecificationID="2c07f5bf-bc81-4c2b-82b4-ae9b3ffd0ba4" NamingStyleID="87e7c501-9948-4b53-b1eb-a6cbe918feee" EnforcementLevel="Info" /&gt;
&lt;SerializableNamingRule SymbolSpecificationID="5f3ddba1-279f-486c-801e-5c097c36dd85" NamingStyleID="87e7c501-9948-4b53-b1eb-a6cbe918feee" EnforcementLevel="Info" /&gt;
&lt;/NamingRules&gt;
&lt;/NamingPreferencesInfo&gt;</PropertyValue>
<PropertyValue name="Style_PreferBraces">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferCoalesceExpression">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferCollectionInitializer">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferConditionalDelegateCall">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferExplicitTupleNames">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferExpressionBodiedAccessors">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferExpressionBodiedConstructors">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferExpressionBodiedIndexers">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferExpressionBodiedMethods">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferExpressionBodiedOperators">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferExpressionBodiedProperties">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferInlinedVariableDeclaration">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferIntrinsicPredefinedTypeKeywordInDeclaration">1</PropertyValue>
<PropertyValue name="Style_PreferIntrinsicPredefinedTypeKeywordInDeclaration_CodeStyle">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferIntrinsicPredefinedTypeKeywordInMemberAccess">1</PropertyValue>
<PropertyValue name="Style_PreferIntrinsicPredefinedTypeKeywordInMemberAccess_CodeStyle">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferNullPropagation">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferObjectInitializer">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferPatternMatchingOverAsWithNullCheck">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferPatternMatchingOverIsWithCastCheck">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /&gt;</PropertyValue>
<PropertyValue name="Style_PreferThrowExpression">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /&gt;</PropertyValue>
<PropertyValue name="Style_QualifyEventAccess">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_QualifyFieldAccess">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_QualifyMemberAccessWithThisOrMe">0</PropertyValue>
<PropertyValue name="Style_QualifyMethodAccess">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_QualifyPropertyAccess">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_UseImplicitTypeForIntrinsicTypes">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_UseImplicitTypeWhereApparent">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_UseImplicitTypeWherePossible">&lt;CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /&gt;</PropertyValue>
<PropertyValue name="Style_UseVarWhenDeclaringLocals">0</PropertyValue>
<PropertyValue name="WarnOnBuildErrors">0</PropertyValue>
<PropertyValue name="WarnWhenMembersCauseCompilerGeneratedReferences">1</PropertyValue>
<PropertyValue name="Wrapping_IgnoreSpacesAroundBinaryOperators">0</PropertyValue>
<PropertyValue name="Wrapping_IgnoreSpacesAroundVariableDeclaration">0</PropertyValue>
<PropertyValue name="Wrapping_KeepStatementsOnSingleLine">1</PropertyValue>
<PropertyValue name="Wrapping_PreserveSingleLine">1</PropertyValue>
</ToolsOptionsSubCategory>
</ToolsOptionsCategory>
</ToolsOptions>
</UserSettings>
Loading…
Cancel
Save