int choose_action(cmdLine *pCmdLine, linked_list *head, var_list *var_head){ if(strcmp(pCmdLine->arguments[0], "quit") == 0){ return 1; } else if(strcmp(pCmdLine->arguments[0], "cd") == 0){ if((chdir(pCmdLine->arguments[1])) < 0){ perror("Error changing a dir: "); } return 0; } else if(strcmp(pCmdLine->arguments[0], "history") == 0){ if(head == 0){ perror("Error-no history"); return 0; } list_print(head); return 0; } else if(strcmp(pCmdLine->arguments[0], "env") == 0){ print_var(var_head); return 0; } else if(strcmp(pCmdLine->arguments[0], "rename") == 0){ rename_var(var_head, pCmdLine->arguments[1], pCmdLine->arguments[2]); return 0; } else{ execute(pCmdLine); return 0; } }
void ssa_cal() { int i=0; for(i=0;i<num_fuc;i++) { for(int j=0;j<fuction[i].n_b;j++) fuction[i].block[j].phi=-1; dom_cal_fuc(i); find_df(i); find_phi(i); rename_var(i); } }