/// <summary>
 /// Allocates the virtual register or stack slot.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <returns></returns>
 public Operand AllocateVirtualRegisterOrStackSlot(MosaType type)
 {
     if (MosaTypeLayout.IsStoredOnStack(type))
     {
         return(AddStackLocal(type));
     }
     else
     {
         return(CreateVirtualRegister(type.GetStackType()));
     }
 }
Example #2
0
 public static Operand CreateResultOperand(IInstructionDecoder decoder, MosaType type)
 {
     return(decoder.Compiler.CreateVirtualRegister(type.GetStackType()));
 }
 /// <summary>
 /// Allocates the virtual register or stack slot.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <returns></returns>
 public Operand AllocateVirtualRegisterOrStackSlot(MosaType type)
 {
     if (StoreOnStack(type))
     {
         return AddStackLocal(type);
     }
     else
     {
         return CreateVirtualRegister(type.GetStackType());
     }
 }
 public static Operand CreateResultOperand(IInstructionDecoder decoder, MosaType type)
 {
     return decoder.Compiler.CreateVirtualRegister(type.GetStackType());
 }