/// <summary> /// Constructs a new phi binding allocator. /// </summary> /// <param name="parent">The parent code generator.</param> /// <param name="cfg">The CFG to use.</param> public PhiBindingAllocator(CLCodeGenerator parent, CFG cfg) { phiMapping = new Dictionary <BasicBlock, List <Variable> >(cfg.Count); Parent = parent; CFG = cfg; Dominators = Dominators.Create(cfg); }
/// <summary> /// Constructs a new statement emitter using the given target. /// </summary> /// <param name="codeGenerator">The parent code generator.</param> internal StatementEmitter(CLCodeGenerator codeGenerator) { CodeGenerator = codeGenerator; stringBuilder = codeGenerator.Builder; argumentCount = 0; argMode = false; codeGenerator.AppendIndent(); }
/// <summary> /// Constructs a new statement emitter using the given target. /// </summary> /// <param name="codeGenerator">The parent code generator.</param> /// <param name="indent">The current indentation.</param> internal StatementEmitter(CLCodeGenerator codeGenerator, int indent) { CodeGenerator = codeGenerator; stringBuilder = codeGenerator.Builder; argumentCount = 0; argMode = false; Indent = indent; stringBuilder.Append('\t', indent); }