[RTL] -- How to insert code into functions?

王 逸 cnnjuwy@hotmail.com
Wed Mar 31 14:06:00 GMT 2004


Hi, everyone!
I'd like to patch GCC to insert some RTL code into all compiled functions.
 
For example, I'd like the following instructions to be inserted 
automatically by GCC:
int main()
{
//instructions1 generated by my patch.
......
function body;
......
//instructions2 generated by my patch.
}
 
Where should I insert RTL codes?
 
In gcc/toplev.c, there is a function rest_of_compilation(), may be I should 
modify this function?
But I'm not familiar with this function and this function is so~~~~ long, 
would someone give me some advice?
thanks.
 
 
Wang Yi
Graduate student @ NJU P.R.C.

_________________________________________________________________
ÓëÁª»úµÄÅóÓѽøÐн»Á÷£¬ÇëʹÓà MSN Messenger:  http://messenger.msn.com/cn  



More information about the Gcc mailing list