diff --git a/src/Generator.Rewrite/GeneratedVariableIdentifier.cs b/src/Generator.Rewrite/GeneratedVariableIdentifier.cs
index d9cef063..aa89acf3 100644
--- a/src/Generator.Rewrite/GeneratedVariableIdentifier.cs
+++ b/src/Generator.Rewrite/GeneratedVariableIdentifier.cs
@@ -1,4 +1,5 @@
using System;
+using Mono.Cecil.Cil;
namespace OpenTK.Rewrite
{
@@ -8,36 +9,48 @@ namespace OpenTK.Rewrite
///
public class GeneratedVariableIdentifier
{
+ ///
+ /// The which the variable is in.
+ ///
+ public MethodBody Body { get; }
+
+ ///
+ /// The which the variable idetifier maps to.
+ ///
+ public VariableDefinition Definition { get; }
+
///
/// The name of the generated variable.
///
public string Name { get; }
-
- ///
- /// The index of the generated variable in its method.
- ///
- public int Index { get; }
///
/// Initializes a new instance of the class.
///
+ /// The method body which the variable is in.
/// The name of the generated variable.
/// The index of the generated variable in its method.
///
- public GeneratedVariableIdentifier(string name, int index)
+ public GeneratedVariableIdentifier(MethodBody body, VariableDefinition definition, string name)
{
+ if (body == null)
+ {
+ throw new ArgumentException("The body argument cannot be null.", nameof(body));
+ }
+
+ if (definition == null)
+ {
+ throw new ArgumentException("The definition argument cannot be null.", nameof(body));
+ }
+
if (string.IsNullOrEmpty(name))
{
throw new ArgumentException("The name argument cannot be null or empty", nameof(name));
}
- if (index < 0)
- {
- throw new ArgumentException("The index must be greater than zero.", nameof(index));
- }
-
+ this.Body = body;
+ this.Definition = definition;
this.Name = name;
- this.Index = index;
}
}
}
\ No newline at end of file