VariableReference.cs 765 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // Author:
  3. // Jb Evain (jbevain@gmail.com)
  4. //
  5. // Copyright (c) 2008 - 2015 Jb Evain
  6. // Copyright (c) 2008 - 2011 Novell, Inc.
  7. //
  8. // Licensed under the MIT/X11 license.
  9. //
  10. namespace ILRuntime.Mono.Cecil.Cil {
  11. public abstract class VariableReference {
  12. internal int index = -1;
  13. protected TypeReference variable_type;
  14. public TypeReference VariableType {
  15. get { return variable_type; }
  16. set { variable_type = value; }
  17. }
  18. public int Index {
  19. get { return index; }
  20. }
  21. internal VariableReference (TypeReference variable_type)
  22. {
  23. this.variable_type = variable_type;
  24. }
  25. public abstract VariableDefinition Resolve ();
  26. public override string ToString ()
  27. {
  28. if (index >= 0)
  29. return "V_" + index;
  30. return string.Empty;
  31. }
  32. }
  33. }