a question about code instrumentation in RTL level

Jim Wilson wilson@specifix.com
Mon Jul 17 23:13:00 GMT 2006


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



More information about the Gcc mailing list