This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: a question about code instrumentation in RTL level
- From: Jim Wilson <wilson at specifix dot com>
- To: sean yang <seanatpurdue at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 17 Jul 2006 15:58:40 -0700
- Subject: Re: a question about code instrumentation in RTL level
- References: <BAY105-F119BEB0A4FE218A2F440E8C0620@phx.gbl>
sean yang wrote:
The GCC internals explicitly introduced code manipulation APIs in TREE
representation (bsi_insert_before, bsi_remove etc). But I did not see
the equivalent for RTL representation.
There is emit_insn_after, emit_insn_before.
There is also the sequence stuff: start_sequence, end_sequence,
push_to_sequence, etc. This allows you to emit multiple insns into a
sequence, which can then be passed to emit_insn_{after,before}.
Try looking at the function definitions in emit-rtl.c, and various code
that uses them.
--
Jim Wilson, GNU Tools Support, http://www.specifix.com