Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/ilasm/codegen/Local.cs')
-rw-r--r--mcs/ilasm/codegen/Local.cs62
1 files changed, 62 insertions, 0 deletions
diff --git a/mcs/ilasm/codegen/Local.cs b/mcs/ilasm/codegen/Local.cs
new file mode 100644
index 00000000000..2951fa0bfa9
--- /dev/null
+++ b/mcs/ilasm/codegen/Local.cs
@@ -0,0 +1,62 @@
+//
+// Mono.ILASM.Local
+//
+// Author(s):
+// Jackson Harper (Jackson@LatitudeGeo.com)
+//
+// (C) 2003 Jackson Harper, All rights reserved
+//
+
+
+using System;
+
+
+namespace Mono.ILASM {
+
+ public class Local {
+
+ private int slot;
+ private string name;
+ private BaseTypeRef type;
+
+ public Local (int slot, BaseTypeRef type) : this (slot, null, type) {
+
+ }
+
+ public Local (int slot, string name, BaseTypeRef type) {
+ this.slot = slot;
+ this.name = name;
+ this.type = type;
+ }
+
+ public int Slot {
+ get { return slot; }
+ set { slot = value; }
+ }
+
+ public string Name {
+ get { return name; }
+ }
+
+ public BaseTypeRef Type {
+ get { return type; }
+ }
+
+ public PEAPI.Local GetPeapiLocal (CodeGen code_gen)
+ {
+ int ec = Report.ErrorCount;
+ BaseGenericTypeRef gtr = type as BaseGenericTypeRef;
+ if (gtr == null)
+ type.Resolve (code_gen);
+ else
+ gtr.ResolveNoTypeSpec (code_gen);
+
+ if (Report.ErrorCount > ec)
+ return null;
+
+ return new PEAPI.Local (name, type.PeapiType);
+ }
+ }
+
+}
+