Thanks,
Can you give me a hint of the three following fields? Some passes defined
them (such as pass_lower_cf), but soem passes leave them as NULL/0.
Thanks,
37 struct tree_opt_pass
38 {
....
63 /* Sets of properties input and output from this pass. */
64 unsigned int properties_required; //
65 unsigned int properties_provided;
66 unsigned int properties_destroyed;
..}
pass_lower_cf defined them as
135 PROP_gimple_any, /* properties_required */
136 PROP_gimple_lcf, /* properties_provided */
137 PROP_gimple_any, /* properties_destroyed */
From: Zdenek Dvorak <[EMAIL PROTECTED]>
To: sean yang <[EMAIL PROTECTED]>
CC: gcc@gcc.gnu.org
Subject: Re: traverse the gimple tree
Date: Tue, 11 Apr 2006 13:56:48 +0200
Hello,
> I want to write a pass to walk the gimple tree and add some
intrumentation
> code. I read the chapter 9 of "GCC Internals" document, and it seems not
to
> describe the Macros to do so.
>
> Can I get some information about this? Specifically, if someone can show
me
> which .h file I should look at to find the Macros, that would be great.
Or,
> Is there any other pass do the similar thing(traverse the gimple tree)
that
> I can read (--I did not find)?
depending on what you need, you may use walk_tree and/or combination of
special-handling for structured statements and tsi_ iterators, at that
point. See e.g. pass_lower_cf.
Zdenek
> ------------------------------------------------
> //in gcc.4.0.2, tree-optimize.c
> 323 void
> 324 init_tree_optimization_passes (void)
> 325 {
> 326 struct tree_opt_pass **p;
> 327
> 328 #define NEXT_PASS(PASS) (p = next_pass_1 (p, &PASS))
> 329
> 330 p = &all_passes;
> 331 NEXT_PASS (pass_gimple);
> 332
> 333 NEXT_PASS (MYPASS_code_instrument); //this is what I want to do
> 334 //the reason I want to add the pass here is: both C/C++(any
other
> front end, later) can use this;
> 335 NEXT_PASS (pass_remove_useless_stmts);
> 336 NEXT_PASS (pass_mudflap_1);
> 337 NEXT_PASS (pass_lower_cf);
> 338 NEXT_PASS (pass_lower_eh);
> 339 NEXT_PASS (pass_build_cfg);
> ......
> }
> --------------------------------------------------------
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's
FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement