Ejemplo n.º 1
0
 public void ResolvePhis()
 {
     foreach (var de in unresolvedPhis)
     {
         var args  = new Expression[de.Value.Arguments.Count];
         var block = de.Key.Block;
         var type  = builder.TranslateType(de.Value.Type);
         foreach (var arg in de.Value.Arguments)
         {
             var val = MakeValueExpression(arg.Item1, type);
             args[block.Pred.IndexOf(m.BlockOf(arg.Item2.Name, false))] = val;
         }
         var phi = (PhiAssignment)de.Key.Instruction;
         phi.Src = new PhiFunction(type, args);
     }
 }
Ejemplo n.º 2
0
 public void ResolvePhis()
 {
     foreach (var de in unresolvedPhis)
     {
         var args = new List <PhiArgument>(de.Value.Arguments.Count);
         var type = builder.TranslateType(de.Value.Type);
         foreach (var arg in de.Value.Arguments)
         {
             var val = MakeValueExpression(arg.Item1, type);
             args.Add(new PhiArgument(
                          m.BlockOf(arg.Item2.Name, false),
                          val));
         }
         var phi = (PhiAssignment)de.Key.Instruction;
         phi.Src = new PhiFunction(type, args.ToArray());
     }
 }