Browse Source

Remove some unused variable management methods in CSharpResolver.

pull/3111/head
Siegfried Pammer 2 years ago
parent
commit
5a3c6e0872
  1. 33
      ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs

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

@ -235,29 +235,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver
return new CSharpResolver(compilation, conversions, context, checkForOverflow, isWithinLambdaExpression, currentTypeDefinitionCache, stack, objectInitializerStack); return new CSharpResolver(compilation, conversions, context, checkForOverflow, isWithinLambdaExpression, currentTypeDefinitionCache, stack, objectInitializerStack);
} }
/// <summary>
/// Opens a new scope for local variables.
/// </summary>
public CSharpResolver PushBlock()
{
return WithLocalVariableStack(localVariableStack.Push(null));
}
/// <summary>
/// Closes the current scope for local variables; removing all variables in that scope.
/// </summary>
public CSharpResolver PopBlock()
{
var stack = localVariableStack;
IVariable removedVar;
do
{
removedVar = stack.Peek();
stack = stack.Pop();
} while (removedVar != null);
return WithLocalVariableStack(stack);
}
/// <summary> /// <summary>
/// Adds a new variable or lambda parameter to the current block. /// Adds a new variable or lambda parameter to the current block.
/// </summary> /// </summary>
@ -268,16 +245,6 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver
return WithLocalVariableStack(localVariableStack.Push(variable)); return WithLocalVariableStack(localVariableStack.Push(variable));
} }
/// <summary>
/// Removes the variable that was just added.
/// </summary>
public CSharpResolver PopLastVariable()
{
if (localVariableStack.Peek() == null)
throw new InvalidOperationException("There is no variable within the current block.");
return WithLocalVariableStack(localVariableStack.Pop());
}
/// <summary> /// <summary>
/// Gets all currently visible local variables and lambda parameters. /// Gets all currently visible local variables and lambda parameters.
/// Does not include method parameters. /// Does not include method parameters.

Loading…
Cancel
Save