Ejemplo n.º 1
0
        /// <summary>
        /// Renders and cleans up the <see cref="Relooper"/> instance.
        /// </summary>
        /// <param name="entry">The entry block.</param>
        /// <param name="labelHelper">The label helper variable.</param>
        /// <param name="module">The parent module.</param>
        /// <returns>An <see cref="Expression"/> instance.</returns>
        /// <exception cref="OutOfMemoryException">the expression could not be created.</exception>
        public Expression RenderAndDispose(RelooperBlock entry, uint labelHelper, Module module)
        {
            var exprPtr = RelooperRenderAndDispose(Handle, entry.Handle, labelHelper, module.Handle);

            if (exprPtr == IntPtr.Zero)
            {
                throw new OutOfMemoryException();
            }

            return(new Expression(exprPtr));
        }
Ejemplo n.º 2
0
 public void AddBranchForSwitch(RelooperBlock from, RelooperBlock to, uint[] indexes, Expression code)
 {
     RelooperAddBranchForSwitch(from.Handle, to.Handle, indexes, (uint)indexes.Length, code.Handle);
 }
Ejemplo n.º 3
0
 public void AddBranch(RelooperBlock from, RelooperBlock to, Expression condition, Expression code)
 {
     RelooperAddBranch(from.Handle, to.Handle, condition.Handle, code.Handle);
 }