Author: jbevain
Date: 2005-12-14 18:21:19 -0500 (Wed, 14 Dec 2005)
New Revision: 54421

Modified:
   trunk/cecil/lib/ChangeLog
   trunk/cecil/lib/Mono.Cecil.Cil/CilWorker.cs
   trunk/cecil/lib/Mono.Cecil.Cil/ICilWorker.cs
Log:
2005-12-14  Jb Evain  <[EMAIL PROTECTED]>

        * Mono.Cecil.Cil/ICilWorker.cs
          Mono.Cecil.Cil/CilWorker.cs:
                Add a remove method.


Modified: trunk/cecil/lib/ChangeLog
===================================================================
--- trunk/cecil/lib/ChangeLog   2005-12-14 22:32:05 UTC (rev 54420)
+++ trunk/cecil/lib/ChangeLog   2005-12-14 23:21:19 UTC (rev 54421)
@@ -1,5 +1,9 @@
 2005-12-14  Jb Evain  <[EMAIL PROTECTED]>
 
+       * Mono.Cecil.Cil/ICilWorker.cs
+         Mono.Cecil.Cil/CilWorker.cs:
+               Add a remove method.
+
        * CodeGen/templates/ImageWriter.cs
          Mono.Cecil.Binary/ImageWriter.cs:
                Don't allocate potential big arrays here.

Modified: trunk/cecil/lib/Mono.Cecil.Cil/CilWorker.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil.Cil/CilWorker.cs 2005-12-14 22:32:05 UTC (rev 
54420)
+++ trunk/cecil/lib/Mono.Cecil.Cil/CilWorker.cs 2005-12-14 23:21:19 UTC (rev 
54421)
@@ -330,5 +330,17 @@
 
                        m_instrs.Add (current);
                }
+
+               public void Remove (Instruction instr)
+               {
+                       if (!m_instrs.Contains (instr))
+                               throw new ReflectionException ("Instruction not 
in method body");
+
+                       if (instr.Previous != null)
+                               instr.Previous.Next = instr.Next;
+                       if (instr.Next != null)
+                               instr.Next.Previous = instr.Previous;
+                       m_instrs.Remove (instr);
+               }
        }
 }

Modified: trunk/cecil/lib/Mono.Cecil.Cil/ICilWorker.cs
===================================================================
--- trunk/cecil/lib/Mono.Cecil.Cil/ICilWorker.cs        2005-12-14 22:32:05 UTC 
(rev 54420)
+++ trunk/cecil/lib/Mono.Cecil.Cil/ICilWorker.cs        2005-12-14 23:21:19 UTC 
(rev 54421)
@@ -77,5 +77,6 @@
                void InsertBefore (Instruction target, Instruction instr);
                void InsertAfter (Instruction target, Instruction instr);
                void Append (Instruction instr);
+               void Remove (Instruction instr);
        }
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to