Ejemplo n.º 1
0
        public override void Emit(FleeILGenerator ilg, IServiceProvider services)
        {
            BranchManager bm = new BranchManager();

            bm.GetLabel("falseLabel", ilg);
            bm.GetLabel("endLabel", ilg);

            if (ilg.IsTemp == true)
            {
                // If this is a fake emit, then do a fake emit and return
                this.EmitConditional(ilg, services, bm);
                return;
            }

            FleeILGenerator ilgTemp = this.CreateTempFleeILGenerator(ilg);

            Utility.SyncFleeILGeneratorLabels(ilg, ilgTemp);

            // Emit fake conditional to get branch target positions
            this.EmitConditional(ilgTemp, services, bm);

            bm.ComputeBranches();

            // Emit real conditional now that we have the branch target locations
            this.EmitConditional(ilg, services, bm);
        }
Ejemplo n.º 2
0
        public override void Emit(FleeILGenerator ilg, IServiceProvider services)
        {
            if ((MyTargetCollectionType != null))
            {
                this.EmitCollectionIn(ilg, services);
            }
            else
            {
                BranchManager bm = new BranchManager();
                bm.GetLabel("endLabel", ilg);
                bm.GetLabel("trueTerminal", ilg);

                // Do a fake emit to get branch positions
                FleeILGenerator ilgTemp = this.CreateTempFleeILGenerator(ilg);
                Utility.SyncFleeILGeneratorLabels(ilg, ilgTemp);

                this.EmitListIn(ilgTemp, services, bm);

                bm.ComputeBranches();

                // Do the real emit
                this.EmitListIn(ilg, services, bm);
            }
        }