/// <summary> /// Run analysis starting at EntryMethodGraph /// </summary> private void analyse() { EntryInput.CommitTransaction(); ProgramPointGraph = ProgramPointGraph.FromSource(EntryCFG); _services.SetProgramEnd(ProgramPointGraph.End); _services.SetServices(ProgramPointGraph); var output = _services.CreateEmptySet(); ProgramPointGraph.Start.Initialize(EntryInput, output); _services.EnqueueEntryPoint(ProgramPointGraph.Start, ProgramPointGraph.End); //fix point computation while (_workList.HasWork) { var point = _workList.GetWork(); //during flow through are enqueued all needed flow children point.FlowThrough(); } //because of avoid incorrect use //_services.UnSetServices(ProgramPointGraph); }
private void extendCallSink(ExtensionSinkPoint point, FlowOutputSet inSet) { inSet.StartTransaction(); inSet.Extend(point.OwningExtension.Owner.OutSet); //Services.FlowResolver.CallDispatchMerge(_inSet, OwningExtension.Branches); inSet.CommitTransaction(); }
/// <summary> /// Commits the flow. /// </summary> protected virtual void commitFlow() { _outSet.CommitTransaction(); if (!OutSet.HasChanges) { //nothing has changed during last commit return; } enqueueChildren(); }
/// <summary> /// Extends the input. /// </summary> protected virtual void extendInput() { var inputs = getInputsForExtension(); if (inputs.Length > 0) { _inSet.StartTransaction(); _inSet.Extend(inputs.ToArray()); _inSet.CommitTransaction(); } }
private void extendCallExtension(ExtensionPoint point, FlowOutputSet inSet) { inSet.StartTransaction(); if (point.Type == ExtensionType.ParallelCall) { inSet.ExtendAsCall(point.Caller.OutSet, point.Graph, point.Flow.CalledObject, point.Flow.Arguments); } else { inSet.Extend(point.Caller.OutSet); } inSet.CommitTransaction(); }
private void standardExtend(IEnumerable <ProgramPointBase> inputs, FlowOutputSet inSet) { var inputSets = new List <FlowInputSet>(); foreach (var input in inputs) { var outSet = GetOutSet(input); var assumeParent = input as AssumePoint; if (outSet == null || (assumeParent != null && !assumeParent.Assumed)) { continue; } inputSets.Add(outSet); } inSet.StartTransaction(); inSet.Extend(inputSets.ToArray()); inSet.CommitTransaction(); }