示例#1
0
 public Assignment FindAssignment(LocalValue local)
 {
     foreach (var b in Blocks)
     {
         foreach (var a in b.AllAssignments)
         {
             if (ReferenceEquals(a.Result, local.Symbol))
             {
                 return(a);
             }
         }
     }
     return(null);
 }
示例#2
0
 public Assignment GetAssignment(LocalValue local)
 {
     foreach (var b in Blocks)
     {
         foreach (var a in b.AllAssignments)
         {
             if (ReferenceEquals(a.Result, local.Symbol))
             {
                 return(a);
             }
         }
     }
     throw new KeyNotFoundException($"Undeclared local {local} in `{Symbol}`");
 }