**** Merged from MCS ****
[mono-project.git] / mcs / ilasm / codegen / CatchBlock.cs
blob1cdb964473ab08de86344018ac4d9d38420dcbf6
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 //
11 using System;
14 namespace Mono.ILASM {
16 public class CatchBlock : ISehClause {
18 private IClassRef class_ref;
19 private HandlerBlock handler_block;
21 public CatchBlock (IClassRef class_ref)
23 this.class_ref = class_ref;
26 public void SetHandlerBlock (HandlerBlock hb)
28 handler_block = hb;
31 public PEAPI.HandlerBlock Resolve (CodeGen code_gen, MethodDef method)
33 PEAPI.CILLabel from = handler_block.GetFromLabel (code_gen, method);
34 PEAPI.CILLabel to = handler_block.GetToLabel (code_gen, method);
35 PEAPI.Catch katch;
37 class_ref.Resolve (code_gen);
39 katch = new PEAPI.Catch (class_ref.PeapiClass, from, to);
41 return katch;