fixed problem with size option
This commit is contained in:
		
							parent
							
								
									6030127779
								
							
						
					
					
						commit
						bb7b8d6490
					
				
					 2 changed files with 6 additions and 2 deletions
				
			
		|  | @ -285,7 +285,6 @@ il_flags(p) | ||||||
| 		while (*p != '\0') { | 		while (*p != '\0') { | ||||||
| 			space = 10*space +*p++ -'0'; | 			space = 10*space +*p++ -'0'; | ||||||
| 		} | 		} | ||||||
| 		space = total_size * space / 100 ; |  | ||||||
| 		break; | 		break; | ||||||
| 	case 'a': | 	case 'a': | ||||||
| 		complete_program = 1; | 		complete_program = 1; | ||||||
|  | @ -306,6 +305,7 @@ main(argc,argv) | ||||||
| 	mktemp(sname); | 	mktemp(sname); | ||||||
| 	mktemp(cname2); | 	mktemp(cname2); | ||||||
| 	pass1(lname,bname,cname); /* grep calls, analyse procedures */ | 	pass1(lname,bname,cname); /* grep calls, analyse procedures */ | ||||||
|  | 	space = total_size * space / 100 ; | ||||||
| 	pass2(cname,space);  /* select calls to be expanded */ | 	pass2(cname,space);  /* select calls to be expanded */ | ||||||
| 	pass3(lname,lname2); /* do substitutions */ | 	pass3(lname,lname2); /* do substitutions */ | ||||||
| 	f = openfile(dname2,"w"); | 	f = openfile(dname2,"w"); | ||||||
|  |  | ||||||
|  | @ -254,9 +254,10 @@ assign_ratio(c) | ||||||
| 	/* Extra points for constants as parameters */ | 	/* Extra points for constants as parameters */ | ||||||
| 	if (ratio <= 0) ratio = 1; | 	if (ratio <= 0) ratio = 1; | ||||||
| 	ll = c->cl_looplevel+1;  | 	ll = c->cl_looplevel+1;  | ||||||
|  | 	if (IS_CALLED_IN_LOOP(c->cl_caller)) ll++; | ||||||
| 	/* Commented out; I don't see the point; Even if it is not called
 | 	/* Commented out; I don't see the point; Even if it is not called
 | ||||||
| 	   from a loop, inline expansion is better | 	   from a loop, inline expansion is better | ||||||
| 	if (ll == 1 && !IS_CALLED_IN_LOOP(c->cl_caller)) ll = 0; | 	if (ll == 1) ll = 0; | ||||||
| 	/* If the call is not in a loop and the called proc. is never called
 | 	/* If the call is not in a loop and the called proc. is never called
 | ||||||
| 	 * in a loop, ll is set to 0. | 	 * in a loop, ll is set to 0. | ||||||
| 	*/ | 	*/ | ||||||
|  | @ -536,6 +537,9 @@ select_calls(proclist,ccf,space) | ||||||
| 			space -= (best->cl_proc->P_SIZE - space_saved(best)); | 			space -= (best->cl_proc->P_SIZE - space_saved(best)); | ||||||
| 		} | 		} | ||||||
| 		else space += space_saved(best); | 		else space += space_saved(best); | ||||||
|  | #ifdef VERBOSE | ||||||
|  | 		if (verbose_flag) fprintf(stderr, "space left: %ld\n", space); | ||||||
|  | #endif | ||||||
| 		selected(best); | 		selected(best); | ||||||
| 		CHANGED(chp); | 		CHANGED(chp); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue