Exemplo n.º 1
0
        private void AnalyzeandDiagnoseRoutine(SourceRoutineSymbol routine)
        {
            Contract.ThrowIfNull(routine);

            if (routine.ControlFlowGraph != null)   // non-abstract method
            {
                PhylDiagnosingVisitor diagnosingVisitor = new PhylDiagnosingVisitor(Engine, _diagnostics, routine);
                diagnosingVisitor.VisitCFG(routine.ControlFlowGraph);
                AdjacencyGraph <ControlFlowGraphVertex, ControlFlowGraphEdge> g = diagnosingVisitor.Graph;
                ControlFlowGraphs.TryAdd(routine, g);
            }
        }
Exemplo n.º 2
0
 internal void ProcessWorklist()
 {
     try
     {
         _worklist.DoAll();
     }
     catch (Exception e)
     {
         LangElement l = PhylDiagnosingVisitor.PickFirstSyntaxNode(currentBlock);
         if (l != null && l.ContainingSourceUnit != null)
         {
             L.Error(e, "Exception thrown binding block {block} in file {file} at position {pos}.", currentBlock.DebugDisplay, l.ContainingSourceUnit?.FilePath, Engine.GetLineFromTokenPosition(l.Span.Start, l.ContainingSourceUnit.FilePath));
         }
         else
         {
             L.Error(e, "Exception thrown binding block {0}", currentBlock.DebugDisplay);
         }
     }
 }