Microsoft.Cci.CodeModelToILConverter.LoadLocal C# (CSharp) Method

LoadLocal() private method

private LoadLocal ( ILocalDefinition local ) : void
local ILocalDefinition
return void
    private void LoadLocal(ILocalDefinition local) {
      ushort localIndex = this.GetLocalIndex(local);
      if (localIndex == 0) this.generator.Emit(OperationCode.Ldloc_0, local);
      else if (localIndex == 1) this.generator.Emit(OperationCode.Ldloc_1, local);
      else if (localIndex == 2) this.generator.Emit(OperationCode.Ldloc_2, local);
      else if (localIndex == 3) this.generator.Emit(OperationCode.Ldloc_3, local);
      else if (localIndex <= byte.MaxValue) this.generator.Emit(OperationCode.Ldloc_S, local);
      else this.generator.Emit(OperationCode.Ldloc, local);
      this.StackSize++;
    }