Example #1
0
 public void EmitIR(CILEmitter Emitter, bool Reference)
 {
     if (Reference)
     {
         if (Type.IsArray && reference.ArrayIndex != null)
         {
             Emitter.LoadVariable(reference.Name);
             reference.ArrayIndex.EmitIR(Emitter, false);
             Emitter.LoadArrayIndexAddress(Type);
         }
         else
         {
             Emitter.LoadVariableAddress(reference.Name);
         }
     }
     else if (variable.IsReference)
     {
         Emitter.LoadReferenceVariable(variable);
     }
     else
     {
         Emitter.LoadVariable(reference.Name);
         if (reference.ArrayIndex != null)
         {
             reference.ArrayIndex.EmitIR(Emitter, false);
             Emitter.LoadArrayVariable(variable);
         }
     }
 }
Example #2
0
 public void EmitIR(CILEmitter Emitter)
 {
     if (variable.IsReference)
     {
         if (reference.ArrayIndex == null)
         {
             Emitter.LoadVariable(reference.Name);
             assigment.EmitIR(Emitter, false);
             Emitter.SaveReferenceVariable(variable);
         }
         else
         {
             Emitter.LoadReferenceVariable(variable);
             reference.ArrayIndex.EmitIR(Emitter, false);
             assigment.EmitIR(Emitter, false);
             Emitter.SaveArray(variable);
         }
     }
     else
     {
         if (reference.ArrayIndex == null)
         {
             assigment.EmitIR(Emitter, false);
             Emitter.SaveVariable(reference.Name);
         }
         else
         {
             Emitter.LoadVariable(variable.Identifier);
             reference.ArrayIndex.EmitIR(Emitter, false);
             assigment.EmitIR(Emitter, false);
             Emitter.SaveArray(variable);
         }
     }
 }