blob: 2951fa0bfa98480885aafef8bffe67c542cfaf9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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);
}
}
}
|