3 // System.Reflection.Emit/LocalBuilder.cs
6 // Paolo Molaro (lupus@ximian.com)
7 // Martin Baulig (martin@gnome.org)
8 // Miguel de Icaza (miguel@ximian.com)
10 // (C) 2001, 2002 Ximian, Inc. http://www.ximian.com
14 using System.Reflection;
15 using System.Reflection.Emit;
16 using System.Globalization;
17 using System.Runtime.CompilerServices;
18 using System.Diagnostics.SymbolStore;
20 namespace System.Reflection.Emit {
21 public sealed class LocalBuilder {
23 // These are kept in sync with reflection.h
25 #region Sync with reflection.h
31 // Order does not matter after here
33 private ModuleBuilder module;
34 internal int position;
36 internal LocalBuilder (ModuleBuilder m, Type t)
41 public void SetLocalSymInfo (string lname, int startOffset, int endOffset)
43 ISymbolWriter symbol_writer = module.GetSymWriter ();
46 if (symbol_writer == null)
49 SignatureHelper sig_helper = SignatureHelper.GetLocalVarSigHelper (module);
51 sig_helper.AddArgument (type);
53 byte[] signature = sig_helper.GetSignature ();
55 symbol_writer.DefineLocalVariable (name, FieldAttributes.Private,
56 signature, SymAddressKind.ILOffset,
58 startOffset, endOffset);
61 public void SetLocalSymInfo (string lname)
63 SetLocalSymInfo (lname, 0, 0);