本文整理汇总了C#中UsageVector类的典型用法代码示例。如果您正苦于以下问题:C# UsageVector类的具体用法?C# UsageVector怎么用?C# UsageVector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UsageVector类属于命名空间,在下文中一共展示了UsageVector类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FlowBranching
// <summary>
// Creates a new flow branching which is contained in `parent'.
// You should only pass non-null for the `block' argument if this block
// introduces any new variables - in this case, we need to create a new
// usage vector with a different size than our parent's one.
// </summary>
protected FlowBranching(FlowBranching parent, BranchingType type, SiblingType stype,
Block block, Location loc)
{
Parent = parent;
Block = block;
Location = loc;
Type = type;
id = ++next_id;
UsageVector vector;
if (Block != null) {
UsageVector parent_vector = parent != null ? parent.CurrentUsageVector : null;
vector = new UsageVector (stype, parent_vector, Block, loc, Block.AssignableSlots);
} else {
vector = new UsageVector (stype, Parent.CurrentUsageVector, null, loc);
}
AddSibling (vector);
}
开发者ID:speier,项目名称:shake,代码行数:25,代码来源:flowanalysis.cs
示例2: MergeSiblings
public static UsageVector MergeSiblings (UsageVector sibling_list, Location loc)
{
if (sibling_list.Next == null)
return sibling_list;
MyBitVector locals = null;
bool is_unreachable = sibling_list.is_unreachable;
if (!sibling_list.IsUnreachable)
locals &= sibling_list.locals;
for (UsageVector child = sibling_list.Next; child != null; child = child.Next) {
is_unreachable &= child.is_unreachable;
if (!child.IsUnreachable)
locals &= child.locals;
}
return new UsageVector (locals, is_unreachable, null, loc);
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:20,代码来源:flowanalysis.cs
示例3: AddSibling
protected override void AddSibling (UsageVector sibling)
{
switch (sibling.Type) {
case SiblingType.Try:
try_vector = sibling;
break;
case SiblingType.Finally:
finally_vector = sibling;
break;
default:
throw new InvalidOperationException ();
}
current_vector = sibling;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:14,代码来源:flowanalysis.cs
示例4: ReturnOrigin
public ReturnOrigin (SavedOrigin next, UsageVector vector, ExitStatement stmt)
: base (next, vector)
{
Stmt = stmt;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:flowanalysis.cs
示例5: BreakOrigin
public BreakOrigin (SavedOrigin next, UsageVector vector, Location loc)
: base (next, vector)
{
Loc = loc;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:flowanalysis.cs
示例6: SavedOrigin
protected SavedOrigin (SavedOrigin next, UsageVector vector)
{
Next = next;
Vector = vector.Clone ();
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:flowanalysis.cs
示例7: AddReturnOrigin
public override bool AddReturnOrigin (UsageVector vector, ExitStatement exit_stmt)
{
Parent.AddReturnOrigin (vector, exit_stmt);
return true;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:flowanalysis.cs
示例8: AddBreakOrigin
public override bool AddBreakOrigin (UsageVector vector, Location loc)
{
Parent.AddBreakOrigin (vector, loc);
tc.SomeCodeFollows ();
return true;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:6,代码来源:flowanalysis.cs
示例9: AddGotoOrigin
// returns true if we crossed an unwind-protected region (try/catch/finally, lock, using, ...)
public virtual bool AddGotoOrigin (UsageVector vector, Goto goto_stmt)
{
return Parent.AddGotoOrigin (vector, goto_stmt);
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:flowanalysis.cs
示例10: AddContinueOrigin
// returns true if we crossed an unwind-protected region (try/catch/finally, lock, using, ...)
public virtual bool AddContinueOrigin (UsageVector vector, Location loc)
{
return Parent.AddContinueOrigin (vector, loc);
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:flowanalysis.cs
示例11: CreateSibling
// <summary>
// Creates a sibling of the current usage vector.
// </summary>
public virtual void CreateSibling (Block block, SiblingType type)
{
UsageVector vector = new UsageVector (
type, Parent.CurrentUsageVector, block, Location);
AddSibling (vector);
Report.Debug (1, " CREATED SIBLING", CurrentUsageVector);
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:11,代码来源:flowanalysis.cs
示例12: MergeOrigins
public void MergeOrigins (UsageVector o_vectors)
{
Report.Debug (1, " MERGING BREAK ORIGINS", this);
if (o_vectors == null)
return;
if (IsUnreachable && locals != null)
locals.SetAll (true);
for (UsageVector vector = o_vectors; vector != null; vector = vector.Next) {
Report.Debug (1, " MERGING BREAK ORIGIN", vector);
if (vector.IsUnreachable)
continue;
locals &= vector.locals;
is_unreachable &= vector.is_unreachable;
}
Report.Debug (1, " MERGING BREAK ORIGINS DONE", this);
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:20,代码来源:flowanalysis.cs
示例13: MergeChild
// <summary>
// Merges a child branching.
// </summary>
public UsageVector MergeChild (UsageVector child, bool overwrite)
{
Report.Debug (2, " MERGING CHILD EFFECTS", this, child, Type);
bool new_isunr = child.is_unreachable;
//
// We've now either reached the point after the branching or we will
// never get there since we always return or always throw an exception.
//
// If we can reach the point after the branching, mark all locals and
// parameters as initialized which have been initialized in all branches
// we need to look at (see above).
//
if ((Type == SiblingType.SwitchSection) && !new_isunr) {
Report.Error (163, Location,
"Control cannot fall through from one " +
"case label to another");
return child;
}
locals |= child.locals;
// throw away un-necessary information about variables in child blocks
if (locals.Count != CountLocals)
locals = new MyBitVector (locals, CountLocals);
if (overwrite)
is_unreachable = new_isunr;
else
is_unreachable |= new_isunr;
return child;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:38,代码来源:flowanalysis.cs
示例14: PropagateFinally
public void PropagateFinally (UsageVector finally_vector, FlowBranching parent)
{
if (finally_vector != null)
Vector.MergeChild (finally_vector, false);
DoPropagateFinally (parent);
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:6,代码来源:flowanalysis.cs
示例15: ContinueOrigin
public ContinueOrigin (SavedOrigin next, UsageVector vector, Location loc)
: base (next, vector)
{
Loc = loc;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:flowanalysis.cs
示例16: FlowBranchingLabeled
public FlowBranchingLabeled (FlowBranching parent, LabeledStatement stmt)
: base (parent, BranchingType.Labeled, SiblingType.Conditional, null, stmt.loc)
{
this.stmt = stmt;
CurrentUsageVector.MergeOrigins (stmt.JumpOrigins);
actual = CurrentUsageVector.Clone ();
// stand-in for backward jumps
CurrentUsageVector.ResetBarrier ();
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:10,代码来源:flowanalysis.cs
示例17: GotoOrigin
public GotoOrigin (SavedOrigin next, UsageVector vector, Goto stmt)
: base (next, vector)
{
Stmt = stmt;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:5,代码来源:flowanalysis.cs
注:本文中的UsageVector类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论