コード例 #1
0
ファイル: Method.cs プロジェクト: nobled/mono
		/// <summary>
		/// </summary>
		/// <param name="tb"></param>
		public void Emit (Class host)
		{
			TypeBuilder tb = host.TypeBuilder;

			if (IsCtor) {
			} else {
				ILGenerator ilgen = method_builder.GetILGenerator ();

				if (local_list != null) {
					foreach (DictionaryEntry local in local_list) {
						Type local_type = host.CodeGen.TypeManager[(string)local.Key];
						if (local_type == null) {
							Console.WriteLine ("Could not find type: {0}", local.Key);
							return;
						}
						ilgen.DeclareLocal (local_type);
					}
				}

				if (instructions != null) {
					foreach (InstrBase instr in instructions)
						instr.Emit (ilgen, host);
				}
			}
		}
コード例 #2
0
ファイル: Method.cs プロジェクト: nobled/mono
		public void Resolve (Class host)
		{
			Type return_type = host.CodeGen.TypeManager[RetType];
			method_builder = host.TypeBuilder.DefineMethod (Name, Attrs, 
				CallConv, return_type, CreateTypeList (host.CodeGen.TypeManager));
		}