本文整理汇总了C#中Mono.CSharp.ToplevelBlock.ResolveMeta方法的典型用法代码示例。如果您正苦于以下问题:C# ToplevelBlock.ResolveMeta方法的具体用法?C# ToplevelBlock.ResolveMeta怎么用?C# ToplevelBlock.ResolveMeta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.ToplevelBlock
的用法示例。
在下文中一共展示了ToplevelBlock.ResolveMeta方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResolveTopBlock
public bool ResolveTopBlock (EmitContext anonymous_method_host, ToplevelBlock block,
Parameters ip, IMethodData md, out bool unreachable)
{
if (resolved) {
unreachable = this.unreachable;
return true;
}
current_phase = Phase.Resolving;
unreachable = false;
if (!loc.IsNull)
CurrentFile = loc.File;
#if PRODUCTION
try {
#endif
if (!block.ResolveMeta (this, ip))
return false;
using (this.With (EmitContext.Flags.DoFlowAnalysis, true)) {
FlowBranchingToplevel top_level;
if (anonymous_method_host != null)
top_level = new FlowBranchingToplevel (anonymous_method_host.CurrentBranching, block);
else
top_level = block.TopLevelBranching;
current_flow_branching = top_level;
bool ok = block.Resolve (this);
current_flow_branching = null;
if (!ok)
return false;
bool flow_unreachable = top_level.End ();
if (flow_unreachable)
this.unreachable = unreachable = true;
}
#if PRODUCTION
} catch (Exception e) {
Console.WriteLine ("Exception caught by the compiler while compiling:");
Console.WriteLine (" Block that caused the problem begin at: " + loc);
if (CurrentBlock != null){
Console.WriteLine (" Block being compiled: [{0},{1}]",
CurrentBlock.StartLocation, CurrentBlock.EndLocation);
}
Console.WriteLine (e.GetType ().FullName + ": " + e.Message);
throw;
}
#endif
if (return_type != TypeManager.void_type && !unreachable) {
if (CurrentAnonymousMethod == null) {
Report.Error (161, md.Location, "`{0}': not all code paths return a value", md.GetSignatureForError ());
return false;
} else if (!CurrentAnonymousMethod.IsIterator) {
Report.Error (1643, CurrentAnonymousMethod.Location, "Not all code paths return a value in anonymous method of type `{0}'",
CurrentAnonymousMethod.GetSignatureForError ());
return false;
}
}
resolved = true;
return true;
}