#include <stdio.h>#include <stdlib.h>#include <strings.h>#include <unistd.h>#include <errno.h>#include <sys/param.h>#include <sys/utsname.h>#include <sys/resource.h>#include <sys/time.h>#include "pathscale_defs.h"#include "phases.h"#include "options.h"#include "lang_defs.h"#include "option_seen.h"#include "option_names.h"#include "string_utils.h"#include "errors.h"#include "file_names.h"#include "file_utils.h"#include "run.h"#include "objects.h"#include "opt_actions.h"#include "profile_type.h"#include "lib_phase_dir.h"

Go to the source code of this file.
| #define EXE "" |
| #define is_shell_quote_special | ( | c | ) |
Value:
Definition at line 3343 of file phases.c.
Referenced by quote_shell_arg(), and quoted_length().
| #define is_shell_special | ( | c | ) |
Value:
( (c) == '\'' || \ (c) == '|' || \ (c) == '&' || \ (c) == '*' || \ (c) == '?' || \ (c) == '[' || \ (c) == ']' || \ (c) == ';' || \ (c) == '!' || \ (c) == '(' || \ (c) == ')' || \ (c) == '^' || \ (c) == '<' || \ (c) == '>' || \ (c) <= ' ' || \ (c) == '\t' || \ is_shell_quote_special(c) )
Definition at line 3312 of file phases.c.
Referenced by quoted_length().
| #define MAX_PHASE_ORDER 10 |
| static void static void add_arg | ( | string_list_t * | args, | |
| const char * | format, | |||
| ... | ||||
| ) | [static] |
Definition at line 488 of file phases.c.
References add_string(), free(), va_end, va_start, and vasprintf().
Referenced by add_libgcc_s().
| static void add_command_line_arg | ( | string_list_t * | args, | |
| char * | sourcefile | |||
| ) | [static] |
Definition at line 3536 of file phases.c.
References add_string(), concat_strings(), convert_saved_command_line_into_string(), create_temp_file_name(), error(), execute_flag, FALSE, fclose(), fopen, L_cc, L_CC, L_f77, L_f90, NULL, source_lang, and write_command_string_into_file().
Referenced by run_compiler().
| static void add_file_args | ( | string_list_t * | args, | |
| phases_t | index | |||
| ) | [static] |
Definition at line 755 of file phases.c.
References ABI_N32, add_inc_path(), add_language_option(), add_library_dir(), add_string(), add_targ_options(), ansi, append_libraries_to_list(), append_string_lists(), asprintf(), buf, concat_strings(), construct_file_with_extension(), construct_given_name(), construct_name(), count_files, create_temp_file_name(), current_phase, dashdash_flag, directory_path(), Disable_old_mp, Disable_open_mp, do_f90_common_args(), drop_path(), DSO_SHARED, endian, ENDIAN_LITTLE, error(), expand_ftpp_macros, FALSE, fb_cdir, fb_file, fb_xdir, find_crt_path(), find_obj_path(), fix_name_by_phase(), ftz_crt, get_executable_dir(), get_gcc_version(), get_object_file(), get_suffix(), get_suffix_string(), getenv(), string_list_rec::head, inline_t, input_source, instrumentation_invoked, internal_error(), internal_fb_file, invoked_lang, keep_cif, keep_flag, keep_list, keep_listing, keep_mp, L_as, L_cc, L_CC, L_f77, L_f90, last_phase, ldpath_for_pixie, len, make_rii_file_name(), mark_for_cleanup(), multiple_source_files, string_item_rec::name, string_item_rec::next, NULL, O3_flag, opt_file, optargs, option_was_seen(), outfile, P_any_as, P_any_cpp, P_any_ld, P_as, P_be, P_c_cpp, P_c_gfe, P_collect, P_cord, P_cplus_cpp, P_cplus_gfe, P_cpp, P_cppf90_fe, P_cppf_fe, P_f90_cpp, P_f90_fe, P_f_cpp, P_f_fe, P_gas, P_gcpp, P_gcpp_plus, P_inline, P_ipa_link, P_ipl, P_ld, P_ldplus, P_lister, P_m4, P_mpc, P_NONE, P_pca, P_pfa, P_pixie, P_prof, P_ratfor, perror(), post_fe_phase(), prof_file, program_name, quiet_flag, RELOCATABLE, remember_last_phase, replace_string(), root, roundoff, run_m4, s, S_B, S_I, S_N, S_O, S_S, set_f90_source_form(), set_library_paths(), show_but_not_run, show_version, source_file, source_kind, source_lang, sprintf(), strcmp(), STRICT_ANSI, string_copy(), strlen(), strrchr(), strstr(), target_cpu, TRUE, and uname().
Referenced by run_compiler(), run_ld(), run_pixie(), and run_prof().
| static void add_final_ld_args | ( | string_list_t * | args, | |
| phases_t | ld_phase | |||
| ) | [static] |
Definition at line 1908 of file phases.c.
References add_libgcc_s(), add_library(), add_string(), asprintf(), DSO_SHARED, error(), find_crt_path(), getenv(), invoked_lang, L_cc, L_CC, L_f90, NULL, option_was_seen(), P_ld, P_ldplus, RELOCATABLE, source_lang, strcmp(), target_cpu, and TRUE.
Referenced by run_ld().
| static void add_implied_string | ( | string_list_t * | list, | |
| int | iflag, | |||
| int | flag, | |||
| phases_t | phase | |||
| ) | [static] |
Definition at line 182 of file phases.c.
References add_multi_strings(), add_string(), change_suffix(), drop_path(), FALSE, get_current_implied_name(), get_option_name(), option_has_blank(), outfile, previous_mf_exists(), remove_previous_mf(), source_file, strcmp(), string_md, string_mmd, strncmp(), and TRUE.
Referenced by copy_phase_options().
| static void static void add_inc_path | ( | string_list_t * | args, | |
| const char * | fmt, | |||
| ... | ||||
| ) | [static] |
Definition at line 612 of file phases.c.
References add_string(), free(), is_directory(), path, va_end, va_start, and vasprintf().
Referenced by add_file_args().
Definition at line 2253 of file phases.c.
References add_phase_for_option(), FALSE, inline_t, option_was_seen(), P_inline, P_ipa_link, P_ipl, and post_fe_phase().
Referenced by run_compiler(), and run_ld().
| static void add_instr_archive | ( | string_list_t * | args | ) | [static] |
Definition at line 2637 of file phases.c.
References add_libgcc_s(), add_library(), CG_EDGE_PROFILE, CG_STRIDE_PROFILE, CG_VALUE_PROFILE, f, fprintf(), instrumentation_invoked, option_was_seen(), profile_type, UNDEFINED, and WHIRL_PROFILE.
Referenced by run_ld().
| static void add_ipl_cmd_string | ( | int | iflag | ) | [static] |
Definition at line 3714 of file phases.c.
References add_multi_strings(), concat_strings(), debug, FALSE, fprintf(), get_current_implied_name(), is_derived_option(), is_internal_option(), option_matches_phase(), P_be, and strcmp().
Referenced by save_ipl_commands().
| static void add_language_option | ( | string_list_t * | args | ) | [static] |
Definition at line 333 of file phases.c.
References add_string(), ansi, invoked_lang, KR_ANSI, L_cc, L_CC, L_f77, and L_f90.
Referenced by add_file_args().
| static void add_libgcc_s | ( | string_list_t * | args | ) | [static] |
Definition at line 1843 of file phases.c.
References add_arg(), add_library(), asprintf(), file_exists(), free(), get_libgcc_s_name(), get_library_dirs(), string_item_rec::name, string_item_rec::next, NULL, and strstr().
Referenced by add_final_ld_args(), and add_instr_archive().
Definition at line 2210 of file phases.c.
References internal_error(), and MAX_PHASE_ORDER.
Referenced by determine_phase_order().
| static void add_targ_options | ( | string_list_t * | args | ) | [static] |
Definition at line 365 of file phases.c.
References add_string(), buf, NULL, sprintf(), target_cpu, and TRUE.
Referenced by add_file_args(), and save_ipl_commands().
| void cancel_saved_arg | ( | int | count | ) |
Definition at line 2586 of file phases.c.
References concat_strings(), DSO, error(), EXE, FALSE, file_exists(), get_full_phase_name(), get_phase_dir(), i, P_be, P_ipl, P_mpc, P_NONE, P_pfa, TRUE, and warning.
Referenced by run_compiler().
| int check_for_saved_option | ( | char * | opt | ) |
Definition at line 3432 of file phases.c.
References strcmp().
Referenced by print_file_path(), and print_magic_path().
Definition at line 3465 of file phases.c.
References command_line, malloc, NULL, quote_shell_arg(), and quoted_length().
Referenced by add_command_line_arg().
| static void copy_phase_options | ( | string_list_t * | phase_list, | |
| phases_t | phase | |||
| ) | [static] |
Definition at line 272 of file phases.c.
References add_implied_string(), FALSE, FOREACH_IMPLIED_OPTION, FOREACH_OPTION_SEEN, get_option_name(), get_phase_mask(), is_matching_phase(), is_object_option(), L_cpp, option_matches_language(), option_matches_phase(), P_any_cpp, source_lang, strcmp(), and TRUE.
Referenced by run_ar(), run_compiler(), run_dsm_prelink(), run_ld(), run_pixie(), and run_prof().
Definition at line 2903 of file phases.c.
References invoked_lang, L_CC, L_cc, P_collect, P_ipa_link, P_ld, and P_ldplus.
Referenced by add_object(), find_crt_path(), and init_stdc_plus_plus_path().
Definition at line 2268 of file phases.c.
References ABI_I32, ABI_I64, ABI_IA32, add_phase(), first_phase, internal_error(), invoked_lang, keep_listing, L_as, L_CC, L_cc, L_f77, L_f90, last_phase, option_was_seen(), P_any_cpp, P_ar, P_as, P_be, P_c_cpp, P_c_gfe, P_collect, P_cord, P_cplus_cpp, P_cplus_gfe, P_cpp, P_cppf90_fe, P_cppf_fe, P_f90_fe, P_f_cpp, P_f_fe, P_gas, P_gcpp, P_gcpp_plus, P_inline, P_ipa_link, P_ipl, P_ld, P_ldplus, P_lister, P_m4, P_NONE, P_pfa, P_ratfor, post_fe_phase(), run_m4, S_B, S_C, S_c, S_F, S_f, S_F90, S_f90, S_I, S_i, S_ii, S_N, S_O, S_o, S_r, S_S, S_s, source_kind, source_lang, and TRUE.
Referenced by run_compiler().
| char* dirname | ( | char *const | s | ) |
| static void do_f90_common_args | ( | string_list_t * | args | ) | [static] |
Definition at line 3828 of file phases.c.
References add_string(), FALSE, and set_f90_source_form().
Referenced by add_file_args().
| char* driver_basename | ( | char *const | s | ) |
Definition at line 412 of file phases.c.
References basebuf, is_dir_separator, NULL, p, strcpy, and strlen().
Referenced by make_ii_file_name(), and make_rii_file_name().
| static char* find_toolroot | ( | char * | program_name, | |
| char * | toolroot | |||
| ) | [static] |
Definition at line 2696 of file phases.c.
References directory_path(), fgets(), fp, is_absolute_file_name, NULL, PATH_BUF_LEN, pclose(), popen(), realpath(), sprintf(), strcat(), strchr, strcpy, and strlen().
Referenced by init_phase_info().
| char* fix_name_by_lang | ( | char * | name | ) |
| static char* fix_name_by_phase | ( | char * | name, | |
| phases_t | phase | |||
| ) | [static] |
| char* get_binutils_lib_path | ( | void | ) |
Definition at line 253 of file run.c.
References asprintf(), and get_executable_dir().
Referenced by init_phase_info(), and run_phase().
| static void get_libgcc_s_name | ( | char ** | libgcc_s_std, | |
| char ** | libgcc_s_dir32 | |||
| ) | [static] |
Definition at line 1816 of file phases.c.
References ABI_N32, NULL, and platform_is_64bit().
Referenced by add_libgcc_s().
| if | ( | ) |
Definition at line 2859 of file phases.c.
References concat_strings(), get_phase_name(), phase_name, set_phase_name(), and strcmp().
| void init_frontend_phase_names | ( | int | gnu_major_version, | |
| int | gnu_minor_version | |||
| ) |
Definition at line 2743 of file phases.c.
References asprintf(), find_toolroot(), free(), get_binutils_lib_path(), get_phases_real_path(), getenv(), global_toolroot, i, ld_libraryn32_path, LIB_MASK, malloc, NULL, old_ld_library_path, OPEN64_PHASE_MASK, orig_program_name, PATH_BUF_LEN, PHASE_MASK, prefix_all_phase_dirs(), string_copy(), strlen(), toolroot, TRUE, and xpg_flag.
Referenced by main().
| static char * make_ii_file_name | ( | char * | objname | ) | [static] |
Definition at line 3602 of file phases.c.
References base, concat_strings(), dirname, driver_basename(), strcpy, and strlen().
Referenced by run_compiler().
| static char * make_rii_file_name | ( | char * | objname | ) | [static] |
Definition at line 3621 of file phases.c.
References base, concat_strings(), dirname, driver_basename(), strcpy, and strlen().
Referenced by add_file_args(), and run_compiler().
Definition at line 627 of file phases.c.
References FALSE, strcmp(), TRUE, and uname().
Referenced by get_libgcc_s_name(), and target_is_native().
Definition at line 2230 of file phases.c.
References inline_t, P_inline, P_ipl, TRUE, and UNDEFINED.
Referenced by add_file_args(), add_inline_option(), and determine_phase_order().
| static void postprocess_ld_args | ( | string_list_t * | args | ) | [static] |
Definition at line 2169 of file phases.c.
References add_after_string(), add_library(), concat_strings(), string_list_rec::head, string_item_rec::name, string_item_rec::next, NULL, option_was_seen(), prof_lib_exists(), strlen(), and strncmp().
Referenced by run_ld().
| static boolean previous_mf_exists | ( | string_list_t * | list | ) | [static] |
Definition at line 156 of file phases.c.
References FALSE, string_list_rec::head, string_item_rec::name, string_item_rec::next, NULL, p, strcmp(), and TRUE.
Referenced by add_implied_string().
| int quote_shell_arg | ( | char * | p, | |
| char * | buf | |||
| ) |
Definition at line 3378 of file phases.c.
References c, is_shell_quote_special, and quoted_length().
Referenced by convert_saved_command_line_into_string(), and save_cpp_output().
| int quoted_length | ( | char * | p, | |
| int * | quoted | |||
| ) |
Definition at line 3354 of file phases.c.
References c, is_shell_quote_special, and is_shell_special.
Referenced by convert_saved_command_line_into_string(), and quote_shell_arg().
| static void remove_previous_mf | ( | string_list_t * | list | ) | [static] |
Definition at line 169 of file phases.c.
References string_list_rec::head, string_item_rec::name, string_item_rec::next, NULL, p, replace_string(), and strcmp().
Referenced by add_implied_string().
Definition at line 3053 of file phases.c.
References add_string(), append_ar_objects_to_list(), copy_phase_options(), get_full_phase_name(), init_string_list(), outfile, P_ar, and run_phase().
Referenced by if().
| void run_compiler | ( | int | argc, | |
| char * | argv[] | |||
| ) |
Definition at line 3151 of file phases.c.
References add_command_line_arg(), add_file_args(), add_inline_option(), check_existence_of_phases(), clear_current_errors(), construct_file_with_extension(), copy_phase_options(), determine_phase_order(), execute_flag, FALSE, fix_name_by_lang(), Gen_feedback, get_full_phase_name(), get_phase_mask(), get_source_lang(), has_current_errors(), string_list_rec::head, init_string_list(), inline_t, input_source, is_matching_phase(), L_CC, make_ii_file_name(), make_rii_file_name(), multiple_source_files, string_item_rec::name, string_item_rec::next, NULL, option_was_seen(), outfile, P_any_fe, P_any_ld, P_any_optfe, P_c_gfe, P_cplus_gfe, P_gcpp_plus, P_inline, P_NONE, prelink_flag, remember_last_phase, replace_string(), rii_file_name, run_ld(), run_phase(), run_pixie(), S_o, source_file, source_kind, source_lang, sprintf(), strcmp(), string_md, string_mmd, TRUE, unsetenv, and update_instantiation_info_file().
Definition at line 2893 of file phases.c.
References append_objects_to_list(), copy_phase_options(), get_full_phase_name(), init_string_list(), P_dsm_prelink, and run_phase().
Referenced by if().
Definition at line 2937 of file phases.c.
References ABI_N32, add_file_args(), add_final_ld_args(), add_inline_option(), add_instr_archive(), add_string(), append_objects_to_list(), asprintf(), concat_strings(), construct_given_name(), copy_phase_options(), directory_path(), error(), file_exists(), fix_name_by_lang(), free(), get_executable_dir(), get_full_phase_name(), get_phase_dir(), init_crt_paths(), init_stdc_plus_plus_path(), init_string_list(), instrumentation_invoked, internal_error(), invoked_lang, keep_flag, L_cc, L_CC, L_f77, L_f90, mark_saved_object_for_cleanup(), multiple_source_files, NULL, old_ld_library_path, option_was_seen(), outfile, P_ipa_link, P_ld, P_ldplus, postprocess_ld_args(), RELOCATABLE, run_phase(), source_file, specify_dyn_linker(), specify_ipa_dyn_linker(), str, and TRUE.
Referenced by if(), and run_compiler().
Definition at line 3069 of file phases.c.
References add_file_args(), concat_strings(), copy_phase_options(), drop_path(), errno, fb_xdir, get_full_phase_name(), init_string_list(), internal_error(), NULL, outfile, P_pixie, perror(), run_phase(), string_copy(), symlink(), and warning.
Referenced by if(), and run_compiler().
Definition at line 3105 of file phases.c.
References add_file_args(), concat_strings(), copy_phase_options(), ENOENT, errno, FALSE, get_full_phase_name(), init_string_list(), internal_error(), link(), NULL, P_prof, perror(), prof_file, run_phase(), string_copy(), TRUE, unlink, and warning.
Referenced by if().
| void save_command_line | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 3759 of file phases.c.
References add_ipl_cmd_string(), add_string(), add_targ_options(), FOREACH_IMPLIED_OPTION, FOREACH_OPTION_SEEN, init_string_list(), invoked_lang, NON_SHARED, and option_matches_language().
| static void set_f90_source_form | ( | string_list_t * | args, | |
| boolean | set_line_length | |||
| ) | [static] |
Definition at line 3798 of file phases.c.
References add_string(), fortran_line_length, S_F90, S_f90, source_kind, and sprintf().
Referenced by add_file_args(), and do_f90_common_args().
| static void set_library_paths | ( | string_list_t * | args | ) | [static] |
Definition at line 505 of file phases.c.
References ABI_N32, add_string(), asprintf(), concat_strings(), directory_path(), free(), get_executable_dir(), get_phase_dir(), global_toolroot, P_alt_library, and P_library.
Referenced by add_file_args().
| static void specify_dyn_linker | ( | string_list_t * | args | ) | [static] |
Definition at line 677 of file phases.c.
References add_string(), CALL_SHARED, and dynamic_linker.
Referenced by run_ld().
| static void specify_ipa_dyn_linker | ( | string_list_t * | args | ) | [static] |
Definition at line 695 of file phases.c.
References add_string(), CALL_SHARED, and ipa_dynamic_linker.
Referenced by run_ld().
| void turn_down_opt_level | ( | int | new_olevel, | |
| char * | msg | |||
| ) |
Definition at line 211 of file special_options.c.
References fullwarn, get_olevel_flag(), internal_error(), option_was_seen(), replace_option_seen(), and warning.
Referenced by add_special_options().
| int update_instantiation_info_file | ( | char * | ii_file_name, | |
| char * | sourcefile | |||
| ) | [static] |
Definition at line 3641 of file phases.c.
References c, concat_strings(), EOF, error(), fclose(), fopen, fprintf(), free(), getc(), NULL, perror(), putc(), rename(), show_flag, skip_old_ii_controls(), TRUE, and write_command_string_into_file().
Referenced by run_compiler().
| static void write_command_string_into_file | ( | FILE * | cmdfile, | |
| char * | sourcefile, | |||
| int | for_ii_file | |||
| ) | [static] |
Definition at line 3496 of file phases.c.
References command_line, fprintf(), fputs(), get_cwd(), invoked_lang, L_CC, multiple_source_files, NULL, option_was_seen(), orig_program_name, outfile, P_any_ld, and remember_last_phase.
Referenced by add_command_line_arg(), and update_instantiation_info_file().
int add_c = 0 [static] |
| boolean auto_parallelize = FALSE |
char basebuf[4096] [static] |
| char* command_line = NULL |
Definition at line 85 of file phases.c.
Referenced by build_link_order(), closest_target_match(), convert_saved_command_line_into_string(), lang_add_output_format(), lang_check(), lang_common(), lang_do_version_exports_section(), lang_gc_sections(), lang_map(), lang_place_orphans(), lang_process(), lang_size_sections_1(), ldfile_try_open_bfd(), main(), open_output(), parse_args(), print_input_section(), write_command_string_into_file(), and yyparse().
| boolean Disable_old_mp = FALSE |
| boolean Disable_open_mp = FALSE |
Definition at line 102 of file phases.c.
Referenced by add_file_args(), add_special_options(), and Process_Mp_Group().
const char* dynamic_linker [static] |
| boolean expand_ftpp_macros = FALSE |
| char* fb_cdir = NULL |
| char* fb_file = NULL |
Definition at line 80 of file phases.c.
Referenced by add_file_args(), if(), Process_fb_create(), and run_phase().
| char* fb_phase = NULL |
| char* fb_type = NULL |
Definition at line 87 of file phases.c.
Referenced by FB_EDGE_TYPE_fprintf(), and Process_fb_type().
| char* fb_xdir = NULL |
Definition at line 83 of file phases.c.
Referenced by add_file_args(), Process_fb_xdir(), and run_pixie().
| int fortran_line_length = 72 |
| boolean Gen_feedback = FALSE |
Definition at line 100 of file phases.c.
Referenced by add_special_options(), check_for_driver_controls(), if(), Process_Ofast(), and run_compiler().
| char* global_toolroot = NULL |
Definition at line 115 of file phases.c.
Referenced by init_phase_info(), run_phase(), and set_library_paths().
char* input_source [static] |
| char* internal_fb_file = NULL |
const char* ipa_dynamic_linker [static] |
string_list_t* ipl_cmds = 0 [static] |
| boolean keep_listing = FALSE |
Definition at line 98 of file phases.c.
Referenced by add_file_args(), determine_phase_order(), and run_phase().
| char* ld_library_path = NULL |
char ld_library_path_found[PATH_BUF_LEN] [static] |
| char* ld_libraryn32_path = NULL |
| boolean multiple_source_files = FALSE |
Definition at line 93 of file phases.c.
Referenced by add_file_args(), check_makedepend_flags(), for(), if(), run_compiler(), run_ld(), and write_command_string_into_file().
| boolean nocpp_flag = FALSE |
| char* old_ld_library_path = NULL |
| char* opt_file = NULL |
| char* orig_program_name = NULL |
Definition at line 118 of file phases.c.
Referenced by init_phase_info(), init_phase_names(), main(), and write_command_string_into_file().
| char* outfile = NULL |
Definition at line 78 of file phases.c.
Referenced by add_file_args(), add_implied_string(), add_special_options(), check_makedepend_flags(), construct_name(), debug_rtx(), flushout(), main(), pex_msdos_exec_child(), print_inline_rtx(), print_rtl(), print_rtl_single(), print_rtx(), run_ar(), run_compiler(), run_ld(), run_pixie(), and write_command_string_into_file().
phases_t phase_order[MAX_PHASE_ORDER] [static] |
int phase_order_index = 0 [static] |
| char* prof_file = NULL |
Definition at line 79 of file phases.c.
Referenced by add_file_args(), if(), Process_fbexe(), Process_fbuse(), run_phase(), and run_prof().
| char roundoff = 0 |
| int saved_argc |
| char** saved_argv |
| char* source_file = NULL |
boolean string_mmd = FALSE [static] |
| int subverbose |
| boolean Use_feedback = FALSE |
Definition at line 101 of file phases.c.
Referenced by check_for_driver_controls(), and Process_fbuse().
1.5.6