Mono.CSharp.ToplevelBlock.AddThisVariable C# (CSharp) Method

AddThisVariable() public method

This is used by non-static `struct' constructors which do not have an initializer - in this case, the constructor must initialize all of the struct's fields. To do this, we add a "this" variable and use the flow analysis code to ensure that it's been fully initialized before control leaves the constructor.
public AddThisVariable ( BlockContext bc, TypeContainer ds, Mono.CSharp.Location l ) : LocalVariable
bc BlockContext
ds TypeContainer
l Mono.CSharp.Location
return LocalVariable
		public LocalVariable AddThisVariable (BlockContext bc, TypeContainer ds, Location l)
		{
			if (this_variable == null) {
				this_variable = new LocalVariable (this, "this", LocalVariable.Flags.IsThis | LocalVariable.Flags.Used, l);
				this_variable.Type = ds.CurrentType;
				this_variable.PrepareForFlowAnalysis (bc);
			}

			return this_variable;
		}