5
5
// Jb Evain (jbevain@gmail.com)
7
// Copyright (c) 2008 - 2010 Jb Evain
9
9
// Permission is hereby granted, free of charge, to any person obtaining
10
10
// a copy of this software and associated documentation files (the
29
29
namespace Mono.Cecil.Cil {
31
public abstract class VariableReference : ICodeVisitable {
31
public abstract class VariableReference {
35
TypeReference m_variableType;
34
internal int index = -1;
35
protected TypeReference variable_type;
37
37
public string Name {
38
get { return m_name; }
39
set { m_name = value; }
42
public TypeReference VariableType {
43
get { return variable_type; }
44
set { variable_type = value; }
43
get { return m_index; }
44
set { m_index = value; }
47
public TypeReference VariableType {
48
get { return m_variableType; }
49
set { m_variableType = value; }
52
public VariableReference (TypeReference variableType)
54
m_variableType = variableType;
57
public VariableReference (string name, int index, TypeReference variableType) : this (variableType)
51
internal VariableReference (TypeReference variable_type)
52
: this (string.Empty, variable_type)
56
internal VariableReference (string name, TypeReference variable_type)
59
this.variable_type = variable_type;
62
public abstract VariableDefinition Resolve ();
63
64
public override string ToString ()
65
if (m_name != null && m_name.Length > 0)
68
return string.Concat ("V_", m_index);
66
if (!string.IsNullOrEmpty (name))
71
public abstract void Accept (ICodeVisitor visitor);