This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

addin new pass to gimple


hi 

i am trying to add new pass to gimple , my task is to find out how many
Arithmetic operators are there in a given program.

1) i know that i have to create a struct tree_opt_pass  i have done that
also, 
2) i have added the following line s to tree-pass.h  
extern struct tree_opt_pass 
3) included next pass in passes.c 
4) i have got the function to print the assigiment statements but i have
doubts in that kindly help me 


the code is ------------------

void process_statement(tree stmt)
{
  tree lval,rval;
		switch (TREE_CODE(stmt)){
			case GIMPLE_MODIFY_STMT:					 
				lval=GIMPLE_STMT_OPERAND(stmt,0);
				rval=GIMPLE_STMT_OPERAND(stmt,1);
				if(TREE_CODE(lval) == VAR_DECL) {
					if(!DECL_ARTIFICIAL(lval)){
						//print_generic_stmt(stderr,stmt,0);
						numassigns++;
					}	
					totalassigns++;				
				}
				break;
			default :
				break;	
		}    		
}

Now i want to know what is VAR_DECL and where can i search for that , if I
have to change my code to print Arithmetic statements what other than
VAR_DECL can I use kindly any body know abut gimple optimization help me in
this regard
-- 
View this message in context: http://www.nabble.com/addin-new-pass-to-gimple-tp24625142p24625142.html
Sent from the gcc - Help mailing list archive at Nabble.com.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]