public void FlowAnalysis(FlowAnalysisContext fc) { bool has_out = false; foreach (var arg in args) { if (arg.ArgType == Argument.AType.Out) { has_out = true; continue; } arg.FlowAnalysis(fc); } if (!has_out) { return; } foreach (var arg in args) { if (arg.ArgType != Argument.AType.Out) { continue; } arg.FlowAnalysis(fc); } }
public void FlowAnalysis(FlowAnalysisContext fc) { if (ArgType == AType.Out) { var vr = Expr as VariableReference; if (vr != null) { if (vr.VariableInfo != null) { fc.SetVariableAssigned(vr.VariableInfo); } return; } var fe = Expr as FieldExpr; if (fe != null) { fe.SetFieldAssigned(fc); return; } return; } Expr.FlowAnalysis(fc); }
public override void FlowAnalysis(FlowAnalysisContext fc) { foreach (var expr in targetExprs) { expr.FlowAnalysis(fc); } }
// <summary> // A struct's constructor must always assign all fields. // This method checks whether it actually does so. // </summary> public bool IsFullyInitialized(FlowAnalysisContext fc, VariableInfo vi, Location loc) { if (struct_info == null) { return(true); } bool ok = true; for (int i = 0; i < struct_info.Count; i++) { var field = struct_info.Fields[i]; if (!fc.IsStructFieldDefinitelyAssigned(vi, field.Name)) { if (field.MemberDefinition is Property.BackingField) { fc.Report.Error(843, loc, "An automatically implemented property `{0}' must be fully assigned before control leaves the constructor. Consider calling the default struct contructor from a constructor initializer", field.GetSignatureForError()); } else { fc.Report.Error(171, loc, "Field `{0}' must be fully assigned before control leaves the constructor", field.GetSignatureForError()); } ok = false; } } return(ok); }
public override void FlowAnalysis(FlowAnalysisContext fc) { base.FlowAnalysis(fc); var vr = target as VariableReference; if (vr != null) { if (vr.VariableInfo != null) { fc.SetVariableAssigned(vr.VariableInfo); } return; } var fe = target as FieldExpr; if (fe != null) { fe.SetFieldAssigned(fc); return; } var pe = target as PropertyExpr; if (pe != null) { pe.SetBackingFieldAssigned(fc); return; } }
public override void FlowAnalysis(FlowAnalysisContext fc) { InstanceExpr.FlowAnalysis(fc); if (arguments != null) { arguments.FlowAnalysis(fc); } }
protected override bool DoFlowAnalysis(FlowAnalysisContext fc) { expr.FlowAnalysis(fc); RegisterResumePoint(); return(false); }
public override void FlowAnalysis(FlowAnalysisContext fc) { source.FlowAnalysis(fc); if (target is ArrayAccess || target is IndexerExpr || target is PropertyExpr) { target.FlowAnalysis(fc); } }
public override void FlowAnalysis(FlowAnalysisContext fc) { base.FlowAnalysis(fc); method_group.FlowAnalysis(fc); if (conditional_access_receiver) { fc.ConditionalAccessEnd(); } }
public override void FlowAnalysis(FlowAnalysisContext fc) { var da = conditional_access_receiver ? fc.BranchDefiniteAssignment() : null; base.FlowAnalysis(fc); method_group.FlowAnalysis(fc); if (conditional_access_receiver) { fc.DefiniteAssignment = da; } }
public void SetGeneratedFieldAssigned(FlowAnalysisContext fc) { if (variablesToInfer == null) { return; } foreach (var lv in variablesToInfer) { fc.SetVariableAssigned(lv.VariableInfo); } }
public override void FlowAnalysis(FlowAnalysisContext fc, List <MovableArgument> movable = null) { foreach (var arg in ordered) { if (arg.ArgType != Argument.AType.Out) { arg.FlowAnalysis(fc); } } base.FlowAnalysis(fc, ordered); }
protected override bool DoFlowAnalysis(FlowAnalysisContext fc) { base.DoFlowAnalysis(fc); var init = (AsyncInitializer)Expr; var res = !init.Block.HasReachableClosingBrace; var storey = (AsyncTaskStorey)init.Storey; if (storey.ReturnType.IsGenericTask) { return(res); } return(true); }
public override void FlowAnalysis(FlowAnalysisContext fc) { source.FlowAnalysis(fc); if (target is ArrayAccess || target is IndexerExpr) { target.FlowAnalysis(fc); return; } var pe = target as PropertyExpr; if (pe != null && !pe.IsAutoPropertyAccess) { target.FlowAnalysis(fc); } }
public virtual void FlowAnalysis(FlowAnalysisContext fc, List <MovableArgument> movable = null) { bool has_out = false; foreach (var arg in args) { if (arg.ArgType == Argument.AType.Out) { has_out = true; continue; } if (movable == null) { arg.FlowAnalysis(fc); continue; } var ma = arg as MovableArgument; if (ma != null && !movable.Contains(ma)) { arg.FlowAnalysis(fc); } } if (!has_out) { return; } foreach (var arg in args) { if (arg.ArgType != Argument.AType.Out) { continue; } arg.FlowAnalysis(fc); } }
public override void FlowAnalysis(FlowAnalysisContext fc) { invoke.FlowAnalysis(fc); }
public bool IsFullyInitialized(FlowAnalysisContext fc, Location loc) { return(TypeInfo.IsFullyInitialized(fc, this, loc)); }
public override void FlowAnalysis(FlowAnalysisContext fc) { arguments.FlowAnalysis(fc); }
public override void FlowAnalysis(FlowAnalysisContext fc) { source.FlowAnalysis(fc); ((FieldExpr)target).SetFieldAssigned(fc); }
public override void FlowAnalysis (FlowAnalysisContext fc, List<MovableArgument> movable = null) { foreach (var arg in ordered) { if (arg.ArgType != Argument.AType.Out) arg.FlowAnalysis (fc); } base.FlowAnalysis (fc, ordered); }
public void FlowAnalysis (FlowAnalysisContext fc) { if (ArgType == AType.Out) { var vr = Expr as VariableReference; if (vr != null) { if (vr.VariableInfo != null) fc.SetVariableAssigned (vr.VariableInfo); return; } var fe = Expr as FieldExpr; if (fe != null) { fe.SetFieldAssigned (fc); return; } return; } Expr.FlowAnalysis (fc); }
public override void FlowAnalysis (FlowAnalysisContext fc) { base.FlowAnalysis (fc); var vr = target as VariableReference; if (vr != null) { if (vr.VariableInfo != null) fc.SetVariableAssigned (vr.VariableInfo); return; } var fe = target as FieldExpr; if (fe != null) { fe.SetFieldAssigned (fc); return; } }
public override void FlowAnalysis (FlowAnalysisContext fc) { source.FlowAnalysis (fc); ((FieldExpr) target).SetFieldAssigned (fc); }
public override void FlowAnalysis(FlowAnalysisContext fc) { base.FlowAnalysis(fc); method_group.FlowAnalysis(fc); }
protected override bool DoFlowAnalysis(FlowAnalysisContext fc) { return(true); }
protected override bool DoFlowAnalysis(FlowAnalysisContext fc) { throw new NotImplementedException(); }
public bool IsFullyInitialized (FlowAnalysisContext fc, Location loc) { return TypeInfo.IsFullyInitialized (fc, this, loc); }
// <summary> // A struct's constructor must always assign all fields. // This method checks whether it actually does so. // </summary> public bool IsFullyInitialized (FlowAnalysisContext fc, VariableInfo vi, Location loc) { if (struct_info == null) return true; bool ok = true; for (int i = 0; i < struct_info.Count; i++) { var field = struct_info.Fields[i]; if (!fc.IsStructFieldDefinitelyAssigned (vi, field.Name)) { var bf = field.MemberDefinition as Property.BackingFieldDeclaration; if (bf != null) { if (bf.Initializer != null) continue; fc.Report.Error (843, loc, "An automatically implemented property `{0}' must be fully assigned before control leaves the constructor. Consider calling the default struct contructor from a constructor initializer", field.GetSignatureForError ()); ok = false; continue; } fc.Report.Error (171, loc, "Field `{0}' must be fully assigned before control leaves the constructor", field.GetSignatureForError ()); ok = false; } } return ok; }
public void FlowAnalysis (FlowAnalysisContext fc) { bool has_out = false; foreach (var arg in args) { if (arg.ArgType == Argument.AType.Out) { has_out = true; continue; } arg.FlowAnalysis (fc); } if (!has_out) return; foreach (var arg in args) { if (arg.ArgType != Argument.AType.Out) continue; arg.FlowAnalysis (fc); } }
public override void FlowAnalysis (FlowAnalysisContext fc) { base.FlowAnalysis (fc); method_group.FlowAnalysis (fc); if (conditional_access_receiver) fc.ConditionalAccessEnd (); }
protected override bool DoFlowAnalysis (FlowAnalysisContext fc) { return false; }
public override void FlowAnalysis (FlowAnalysisContext fc) { InstanceExpr.FlowAnalysis (fc); if (arguments != null) arguments.FlowAnalysis (fc); }
public override void FlowAnalysis(FlowAnalysisContext fc) { target.FlowAnalysis(fc); source.FlowAnalysis(fc); }
public virtual void FlowAnalysis (FlowAnalysisContext fc, List<MovableArgument> movable = null) { bool has_out = false; foreach (var arg in args) { if (arg.ArgType == Argument.AType.Out) { has_out = true; continue; } if (movable == null) { arg.FlowAnalysis (fc); continue; } var ma = arg as MovableArgument; if (ma != null && !movable.Contains (ma)) arg.FlowAnalysis (fc); } if (!has_out) return; foreach (var arg in args) { if (arg.ArgType != Argument.AType.Out) continue; arg.FlowAnalysis (fc); } }
public void FlowAnalysis (FlowAnalysisContext fc) { foreach (var arg in args) arg.FlowAnalysis (fc); }
public override void FlowAnalysis (FlowAnalysisContext fc) { // We are reachable, mark block body reachable too MarkReachable (new Reachability ()); CheckReachableExit (fc.Report); var das = fc.BranchDefiniteAssignment (); var prev_pb = fc.ParametersBlock; fc.ParametersBlock = Block; var da_ontrue = fc.DefiniteAssignmentOnTrue; var da_onfalse = fc.DefiniteAssignmentOnFalse; block.FlowAnalysis (fc); fc.ParametersBlock = prev_pb; fc.DefiniteAssignment = das; fc.DefiniteAssignmentOnTrue = da_ontrue; fc.DefiniteAssignmentOnFalse = da_onfalse; }
public override void FlowAnalysis (FlowAnalysisContext fc) { base.FlowAnalysis (fc); method_group.FlowAnalysis (fc); }
public override void FlowAnalysis (FlowAnalysisContext fc) { source.FlowAnalysis (fc); if (target is ArrayAccess || target is IndexerExpr || target is PropertyExpr) target.FlowAnalysis (fc); }
public override void FlowAnalysis (FlowAnalysisContext fc) { source.FlowAnalysis (fc); if (target is ArrayAccess || target is IndexerExpr) { target.FlowAnalysis (fc); return; } var pe = target as PropertyExpr; if (pe != null && !pe.IsAutoPropertyAccess) target.FlowAnalysis (fc); }
public override void FlowAnalysis (FlowAnalysisContext fc) { target.FlowAnalysis (fc); source.FlowAnalysis (fc); }
public override void FlowAnalysis (FlowAnalysisContext fc) { side_effect.FlowAnalysis (fc); }
public override void FlowAnalysis(FlowAnalysisContext fc) { stmt.Expr.FlowAnalysis(fc); stmt.RegisterResumePoint(); }
public override void FlowAnalysis (FlowAnalysisContext fc) { arguments.FlowAnalysis (fc); }
protected override bool DoFlowAnalysis(FlowAnalysisContext fc) { return(state_machine.ReturnType.Kind != MemberKind.Void); }
public override void FlowAnalysis (FlowAnalysisContext fc) { invoke.FlowAnalysis (fc); }
public override void FlowAnalysis (FlowAnalysisContext fc) { if (argument_list != null) argument_list.FlowAnalysis (fc); }
public override void FlowAnalysis (FlowAnalysisContext fc) { var da = conditional_access_receiver ? fc.BranchDefiniteAssignment () : null; base.FlowAnalysis (fc); method_group.FlowAnalysis (fc); if (conditional_access_receiver) fc.DefiniteAssignment = da; }