remove incr/decr_local_scope functions
This commit is contained in:
		
							parent
							
								
									08e22d8ad2
								
							
						
					
					
						commit
						d27ea5155f
					
				
					 1 changed files with 7 additions and 16 deletions
				
			
		
							
								
								
									
										23
									
								
								tccgen.c
									
										
									
									
									
								
							
							
						
						
									
										23
									
								
								tccgen.c
									
										
									
									
									
								
							| 
						 | 
					@ -113,15 +113,6 @@ static void gv_dup(void);
 | 
				
			||||||
static int get_temp_local_var(int size,int align);
 | 
					static int get_temp_local_var(int size,int align);
 | 
				
			||||||
static void clear_temp_local_var_list();
 | 
					static void clear_temp_local_var_list();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void incr_local_scope(void)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    ++local_scope;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void decr_local_scope(void)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    --local_scope;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void reset_local_scope(void)
 | 
					static void reset_local_scope(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -6152,11 +6143,11 @@ static void block(int *bsym, int *csym, int is_expr)
 | 
				
			||||||
        skip(')');
 | 
					        skip(')');
 | 
				
			||||||
        a = gvtst(1, 0);
 | 
					        a = gvtst(1, 0);
 | 
				
			||||||
        b = 0;
 | 
					        b = 0;
 | 
				
			||||||
	incr_local_scope();
 | 
						++local_scope;
 | 
				
			||||||
	saved_nocode_wanted = nocode_wanted;
 | 
						saved_nocode_wanted = nocode_wanted;
 | 
				
			||||||
        block(&a, &b, 0);
 | 
					        block(&a, &b, 0);
 | 
				
			||||||
	nocode_wanted = saved_nocode_wanted;
 | 
						nocode_wanted = saved_nocode_wanted;
 | 
				
			||||||
	decr_local_scope();
 | 
						--local_scope;
 | 
				
			||||||
        gjmp_addr(d);
 | 
					        gjmp_addr(d);
 | 
				
			||||||
        gsym(a);
 | 
					        gsym(a);
 | 
				
			||||||
        gsym_addr(b, d);
 | 
					        gsym_addr(b, d);
 | 
				
			||||||
| 
						 | 
					@ -6170,8 +6161,8 @@ static void block(int *bsym, int *csym, int is_expr)
 | 
				
			||||||
        s = local_stack;
 | 
					        s = local_stack;
 | 
				
			||||||
        llabel = local_label_stack;
 | 
					        llabel = local_label_stack;
 | 
				
			||||||
        lcleanup = current_cleanups;
 | 
					        lcleanup = current_cleanups;
 | 
				
			||||||
        incr_local_scope();
 | 
						++local_scope;
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        /* handle local labels declarations */
 | 
					        /* handle local labels declarations */
 | 
				
			||||||
        while (tok == TOK_LABEL) {
 | 
					        while (tok == TOK_LABEL) {
 | 
				
			||||||
            next();
 | 
					            next();
 | 
				
			||||||
| 
						 | 
					@ -6232,7 +6223,7 @@ static void block(int *bsym, int *csym, int is_expr)
 | 
				
			||||||
        /* pop locally defined labels */
 | 
					        /* pop locally defined labels */
 | 
				
			||||||
        label_pop(&local_label_stack, llabel, is_expr);
 | 
					        label_pop(&local_label_stack, llabel, is_expr);
 | 
				
			||||||
        /* pop locally defined symbols */
 | 
					        /* pop locally defined symbols */
 | 
				
			||||||
	decr_local_scope();
 | 
						--local_scope;
 | 
				
			||||||
	/* In the is_expr case (a statement expression is finished here),
 | 
						/* In the is_expr case (a statement expression is finished here),
 | 
				
			||||||
	   vtop might refer to symbols on the local_stack.  Either via the
 | 
						   vtop might refer to symbols on the local_stack.  Either via the
 | 
				
			||||||
	   type or via vtop->sym.  We can't pop those nor any that in turn
 | 
						   type or via vtop->sym.  We can't pop those nor any that in turn
 | 
				
			||||||
| 
						 | 
					@ -6291,7 +6282,7 @@ static void block(int *bsym, int *csym, int is_expr)
 | 
				
			||||||
        next();
 | 
					        next();
 | 
				
			||||||
        skip('(');
 | 
					        skip('(');
 | 
				
			||||||
        s = local_stack;
 | 
					        s = local_stack;
 | 
				
			||||||
	incr_local_scope();
 | 
						++local_scope;
 | 
				
			||||||
        if (tok != ';') {
 | 
					        if (tok != ';') {
 | 
				
			||||||
            /* c99 for-loop init decl? */
 | 
					            /* c99 for-loop init decl? */
 | 
				
			||||||
            if (!decl0(VT_LOCAL, 1, NULL)) {
 | 
					            if (!decl0(VT_LOCAL, 1, NULL)) {
 | 
				
			||||||
| 
						 | 
					@ -6327,7 +6318,7 @@ static void block(int *bsym, int *csym, int is_expr)
 | 
				
			||||||
        gjmp_addr(c);
 | 
					        gjmp_addr(c);
 | 
				
			||||||
        gsym(a);
 | 
					        gsym(a);
 | 
				
			||||||
        gsym_addr(b, c);
 | 
					        gsym_addr(b, c);
 | 
				
			||||||
	decr_local_scope();
 | 
						--local_scope;
 | 
				
			||||||
        sym_pop(&local_stack, s, 0);
 | 
					        sym_pop(&local_stack, s, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    } else 
 | 
					    } else 
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue