public void InitializeStateType(Module module, string functionName)
        {
            var stateFieldTypes = new List <LLVMTypeRef>();

            // fixed fields
            stateFieldTypes.Add(FunctionCompletionStatusType(Context)); // function completion status: 0 = not done, 1 = completed successfully, 2 = panic
            stateFieldTypes.Add(Context.WakerType());                   // caller waker
            // end fixed fields
            stateFieldTypes.AddRange(_stateFields.Select(a => Context.AsLLVMType(a.Type)));
            StateType = Context.NamedStructType(functionName + "_state_t", stateFieldTypes.ToArray());
        }