示例#1
0
 // somewhere, so bug, is leaving an empty block, I think because of switches
 public bool RemoveRedundentBlocks(IList <ILNode> body, ILBasicBlock head, int pos)
 {
     if (!labelGlobalRefCount.ContainsKey(head.EntryLabel()) && body.Contains(head))
     {
         if (head.Body.Count != 2)
         {
             // we have an empty block that has data in it? throw it as an error.
             // Might just be extra code like after an exit that was never used or a programer error but lets record it anyway
             error.Warning("BasicBlock with data removed, not linked to anything so should be safe", head);
         }
         body.RemoveOrThrow(head);
         return(true);
     }
     return(false);
 }