using System.Collections.Generic;
using System.IO;
-#if STATIC
-using IKVM.Reflection.Emit;
-#else
-using System.Reflection.Emit;
-#endif
-
namespace Mono.CSharp
{
public enum LookupMode
{
FlowBranching current_flow_branching;
- TypeSpec return_type;
-
- /// <summary>
- /// The location where return has to jump to return the
- /// value
- /// </summary>
- public Label ReturnLabel; // TODO: It's emit dependant
-
- /// <summary>
- /// If we already defined the ReturnLabel
- /// </summary>
- public bool HasReturnLabel;
+ readonly TypeSpec return_type;
public int FlowOffset;
get { return current_flow_branching; }
}
+ public TypeSpec ReturnType {
+ get { return return_type; }
+ }
+
// <summary>
// Starts a new code branching. This inherits the state of all local
// variables and parameters from the current branching.
return branching;
}
- public FlowBranchingIterator StartFlowBranching (StateMachineInitializer iterator, FlowBranching parent)
+ public FlowBranchingIterator StartFlowBranching (Iterator iterator, FlowBranching parent)
{
FlowBranchingIterator branching = new FlowBranchingIterator (parent, iterator);
current_flow_branching = branching;
return branching;
}
+ public FlowBranchingAsync StartFlowBranching (AsyncInitializer asyncBody, FlowBranching parent)
+ {
+ var branching = new FlowBranchingAsync (parent, asyncBody);
+ current_flow_branching = branching;
+ return branching;
+ }
+
public FlowBranchingToplevel StartFlowBranching (ParametersBlock stmt, FlowBranching parent)
{
FlowBranchingToplevel branching = new FlowBranchingToplevel (parent, stmt);
current_flow_branching = current_flow_branching.Parent;
}
- //
- // This method is used during the Resolution phase to flag the
- // need to define the ReturnLabel
- //
+#if !STATIC
public void NeedReturnLabel ()
{
- if (!HasReturnLabel)
- HasReturnLabel = true;
- }
-
- public TypeSpec ReturnType {
- get { return return_type; }
}
+#endif
}
//