public LabelInfo(string name, int pos)
 {
     Name      = name;
     Pos       = pos;
     Label     = null;
     UseOffset = false;
 }
Beispiel #2
0
        public override void Emit(CodeGen code_gen, MethodDef meth,
                                  PEAPI.CILInstructions cil)
        {
            int count = 0;

            PEAPI.CILLabel[] label_array;

            if (label_list != null)
            {
                label_array = new PEAPI.CILLabel[label_list.Count];
                foreach (object lab in label_list)
                {
                    if (lab is LabelInfo)
                    {
                        label_array[count++] = ((LabelInfo)lab).Label;
                    }
                    else
                    {
                        throw new InternalErrorException("offsets in switch statements.");
                    }
                }
            }
            else
            {
                label_array = new PEAPI.CILLabel [0];
            }

            cil.Switch(label_array);
        }
Beispiel #3
0
 public LabelInfo (string name, int pos)
 {
         Name = name;
         Pos = pos;
         Label = null;
         UseOffset = false;
 }
 public LabelInfo(string name, int pos, uint offset)
 {
     Name      = name;
     Pos       = pos;
     Offset    = offset;
     Label     = null;
     UseOffset = true;
 }
Beispiel #5
0
 public LabelInfo (string name, int pos, uint offset)
 {
         Name = name;
         Pos = pos;
         Offset = offset;
         Label = null;
         UseOffset = true;
 }
        public PEAPI.HandlerBlock Resolve(CodeGen code_gen, MethodDef method)
        {
            PEAPI.CILLabel from     = handler_block.GetFromLabel(code_gen, method);
            PEAPI.CILLabel to       = handler_block.GetToLabel(code_gen, method);
            PEAPI.Finally  phinally = new PEAPI.Finally(from, to);

            return(phinally);
        }
        public PEAPI.HandlerBlock Resolve(CodeGen code_gen, MethodDef method)
        {
            PEAPI.CILLabel from  = handler_block.GetFromLabel(code_gen, method);
            PEAPI.CILLabel to    = handler_block.GetToLabel(code_gen, method);
            PEAPI.Fault    fault = new PEAPI.Fault(from, to);

            return(fault);
        }
Beispiel #8
0
        public PEAPI.HandlerBlock Resolve(CodeGen code_gen, MethodDef method)
        {
            PEAPI.CILLabel label  = this_block.GetFromLabel(code_gen, method);
            PEAPI.CILLabel from   = handler_block.GetFromLabel(code_gen, method);
            PEAPI.CILLabel to     = handler_block.GetToLabel(code_gen, method);
            PEAPI.Filter   filter = new PEAPI.Filter(label, from, to);

            return(filter);
        }
        public PEAPI.HandlerBlock Resolve(CodeGen code_gen, MethodDef method)
        {
            PEAPI.CILLabel from = handler_block.GetFromLabel(code_gen, method);
            PEAPI.CILLabel to   = handler_block.GetToLabel(code_gen, method);
            PEAPI.Catch    katch;

            type_ref.Resolve(code_gen);

            katch = new PEAPI.Catch(type_ref.PeapiType, from, to);

            return(katch);
        }
Beispiel #10
0
        public override void Emit(CodeGen code_gen, MethodDef meth,
                                  PEAPI.CILInstructions cil)
        {
            PEAPI.CILLabel from      = block.GetFromLabel(code_gen, meth);
            PEAPI.CILLabel to        = block.GetToLabel(code_gen, meth);
            PEAPI.TryBlock try_block = new PEAPI.TryBlock(from, to);

            foreach (ISehClause clause in clause_list)
            {
                try_block.AddHandler(clause.Resolve(code_gen, meth));
            }

            cil.AddTryBlock(try_block);
        }
Beispiel #11
0
                public override void Emit (CodeGen code_gen, MethodDef meth,
					   PEAPI.CILInstructions cil)
                {
                        int count = 0;
                        PEAPI.CILLabel[] label_array;

                        if (label_list != null) {
                                label_array = new PEAPI.CILLabel[label_list.Count];
                                foreach (object lab in label_list) {
                                        if (lab is LabelInfo) {
                                                label_array[count++] = ((LabelInfo)lab).Label;
                                        } else {                                                
                                                throw new InternalErrorException ("offsets in switch statements.");
                                        }
                                }
                        } else {
                                label_array = new PEAPI.CILLabel [0];
                        }

                        cil.Switch (label_array);
                }
 public void Define(PEAPI.CILLabel label)
 {
     Label = label;
 }
Beispiel #13
0
 public void Define (PEAPI.CILLabel label)
 {
         Label = label;
 }