[mini] Use C++ linker iff building C++ that needs the C++ runtime (#12266)
[mono-project.git] / mcs / ilasm / codegen / Local.cs
blob2951fa0bfa98480885aafef8bffe67c542cfaf9b
1 //
2 // Mono.ILASM.Local
3 //
4 // Author(s):
5 // Jackson Harper (Jackson@LatitudeGeo.com)
6 //
7 // (C) 2003 Jackson Harper, All rights reserved
8 //
11 using System;
14 namespace Mono.ILASM {
16 public class Local {
18 private int slot;
19 private string name;
20 private BaseTypeRef type;
22 public Local (int slot, BaseTypeRef type) : this (slot, null, type) {
26 public Local (int slot, string name, BaseTypeRef type) {
27 this.slot = slot;
28 this.name = name;
29 this.type = type;
32 public int Slot {
33 get { return slot; }
34 set { slot = value; }
37 public string Name {
38 get { return name; }
41 public BaseTypeRef Type {
42 get { return type; }
45 public PEAPI.Local GetPeapiLocal (CodeGen code_gen)
47 int ec = Report.ErrorCount;
48 BaseGenericTypeRef gtr = type as BaseGenericTypeRef;
49 if (gtr == null)
50 type.Resolve (code_gen);
51 else
52 gtr.ResolveNoTypeSpec (code_gen);
54 if (Report.ErrorCount > ec)
55 return null;
57 return new PEAPI.Local (name, type.PeapiType);