From 5a3c6e0872cb30745eb484585c865e4a6d632a9b Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 14 Oct 2023 22:04:24 +0200 Subject: [PATCH] Remove some unused variable management methods in CSharpResolver. --- .../CSharp/Resolver/CSharpResolver.cs | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs b/ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs index f235e0a98a..c2db8b7b08 100644 --- a/ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs +++ b/ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs @@ -235,29 +235,6 @@ CSharpResolver WithLocalVariableStack(ImmutableStack stack) return new CSharpResolver(compilation, conversions, context, checkForOverflow, isWithinLambdaExpression, currentTypeDefinitionCache, stack, objectInitializerStack); } - /// - /// Opens a new scope for local variables. - /// - public CSharpResolver PushBlock() - { - return WithLocalVariableStack(localVariableStack.Push(null)); - } - - /// - /// Closes the current scope for local variables; removing all variables in that scope. - /// - public CSharpResolver PopBlock() - { - var stack = localVariableStack; - IVariable removedVar; - do - { - removedVar = stack.Peek(); - stack = stack.Pop(); - } while (removedVar != null); - return WithLocalVariableStack(stack); - } - /// /// Adds a new variable or lambda parameter to the current block. /// @@ -268,16 +245,6 @@ public CSharpResolver AddVariable(IVariable variable) return WithLocalVariableStack(localVariableStack.Push(variable)); } - /// - /// Removes the variable that was just added. - /// - public CSharpResolver PopLastVariable() - { - if (localVariableStack.Peek() == null) - throw new InvalidOperationException("There is no variable within the current block."); - return WithLocalVariableStack(localVariableStack.Pop()); - } - /// /// Gets all currently visible local variables and lambda parameters. /// Does not include method parameters.