Skip to content

Commit

Permalink
Remove some unused variable management methods in CSharpResolver.
Browse files Browse the repository at this point in the history
  • Loading branch information
siegfriedpammer committed Oct 14, 2023
1 parent a99eed0 commit 5a3c6e0
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,29 +235,6 @@ CSharpResolver WithLocalVariableStack(ImmutableStack<IVariable> stack)
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>
/// Adds a new variable or lambda parameter to the current block.
/// </summary>
Expand All @@ -268,16 +245,6 @@ public CSharpResolver AddVariable(IVariable 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>
/// Gets all currently visible local variables and lambda parameters.
/// Does not include method parameters.
Expand Down

0 comments on commit 5a3c6e0

Please sign in to comment.