* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / ilasm / codegen / CatchBlock.cs
1 //
2 // Mono.ILASM.CatchBlock
3 //
4 // Author(s):
5 //  Jackson Harper (Jackson@LatitudeGeo.com)
6 //
7 // (C) 2003 Jackson Harper, All rights reserved
8 //
9
10
11 using System;
12
13
14 namespace Mono.ILASM {
15
16         public class CatchBlock : ISehClause {
17
18                 private BaseClassRef class_ref;
19                 private HandlerBlock handler_block;
20
21                 public CatchBlock (BaseClassRef class_ref)
22                 {
23                         this.class_ref = class_ref;
24                 }
25
26                 public void SetHandlerBlock (HandlerBlock hb)
27                 {
28                         handler_block = hb;
29                 }
30
31                 public PEAPI.HandlerBlock Resolve (CodeGen code_gen, MethodDef method)
32                 {
33                         PEAPI.CILLabel from = handler_block.GetFromLabel (code_gen, method);
34                         PEAPI.CILLabel to = handler_block.GetToLabel (code_gen, method);
35                         PEAPI.Catch katch;
36
37                         class_ref.Resolve (code_gen);
38
39                         katch = new PEAPI.Catch (class_ref.PeapiClass, from, to);
40
41                         return katch;
42                 }
43         }
44
45 }