toplev.c
来自「GCC编译器源代码」· C语言 代码 · 共 2,599 行 · 第 1/5 页
C
2,599 行
int flag_no_inline;/* Nonzero means that we should emit static const variables regardless of whether or not optimization is turned on. */int flag_keep_static_consts = 1;/* Nonzero means we should be saving declaration info into a .X file. */int flag_gen_aux_info = 0;/* Specified name of aux-info file. */static char *aux_info_file_name;/* Nonzero means make the text shared if supported. */int flag_shared_data;/* Nonzero means schedule into delayed branch slots if supported. */int flag_delayed_branch;/* Nonzero if we are compiling pure (sharable) code. Value is 1 if we are doing reasonable (i.e. simple offset into offset table) pic. Value is 2 if we can only perform register offsets. */int flag_pic;/* Nonzero means generate extra code for exception handling and enable exception handling. */int flag_exceptions = 2;/* Nonzero means don't place uninitialized global data in common storage by default. */int flag_no_common;/* Nonzero means pretend it is OK to examine bits of target floats, even if that isn't true. The resulting code will have incorrect constants, but the same series of instructions that the native compiler would make. */int flag_pretend_float;/* Nonzero means change certain warnings into errors. Usually these are warnings about failure to conform to some standard. */int flag_pedantic_errors = 0;/* flag_schedule_insns means schedule insns within basic blocks (before local_alloc). flag_schedule_insns_after_reload means schedule insns after global_alloc. */int flag_schedule_insns = 0;int flag_schedule_insns_after_reload = 0;/* -finhibit-size-directive inhibits output of .size for ELF. This is used only for compiling crtstuff.c, and it may be extended to other effects needed for crtstuff.c on other systems. */int flag_inhibit_size_directive = 0;/* -fverbose-asm causes extra commentary information to be produced in the generated assembly code (to make it more readable). This option is generally only of use to those who actually need to read the generated assembly code (perhaps while debugging the compiler itself). -fno-verbose-asm, the default, causes the extra information to be omitted and is useful when comparing two assembler files. */int flag_verbose_asm = 0;/* -dA causes debug commentary information to be produced in the generated assembly code (to make it more readable). This option is generally only of use to those who actually need to read the generated assembly code (perhaps while debugging the compiler itself). Currently, this switch is only used by dwarfout.c; however, it is intended to be a catchall for printing debug information in the assembler file. */int flag_debug_asm = 0;/* -fgnu-linker specifies use of the GNU linker for initializations. (Or, more generally, a linker that handles initializations.) -fno-gnu-linker says that collect2 will be used. */#ifdef USE_COLLECT2int flag_gnu_linker = 0;#elseint flag_gnu_linker = 1;#endif/* Tag all structures with __attribute__(packed) */int flag_pack_struct = 0;/* Emit code to check for stack overflow; also may cause large objects to be allocated dynamically. */int flag_stack_check;/* -fcheck-memory-usage causes extra code to be generated in order to check memory accesses. This is used by a detector of bad memory accesses such as Checker. */int flag_check_memory_usage = 0;/* -fprefix-function-name causes function name to be prefixed. This can be used with -fcheck-memory-usage to isolate code compiled with -fcheck-memory-usage. */int flag_prefix_function_name = 0;/* Table of language-independent -f options. STRING is the option name. VARIABLE is the address of the variable. ON_VALUE is the value to store in VARIABLE if `-fSTRING' is seen as an option. (If `-fno-STRING' is seen as an option, the opposite value is stored.) */struct { char *string; int *variable; int on_value;} f_options[] ={ {"float-store", &flag_float_store, 1}, {"volatile", &flag_volatile, 1}, {"volatile-global", &flag_volatile_global, 1}, {"defer-pop", &flag_defer_pop, 1}, {"omit-frame-pointer", &flag_omit_frame_pointer, 1}, {"cse-follow-jumps", &flag_cse_follow_jumps, 1}, {"cse-skip-blocks", &flag_cse_skip_blocks, 1}, {"expensive-optimizations", &flag_expensive_optimizations, 1}, {"thread-jumps", &flag_thread_jumps, 1}, {"strength-reduce", &flag_strength_reduce, 1}, {"unroll-loops", &flag_unroll_loops, 1}, {"unroll-all-loops", &flag_unroll_all_loops, 1}, {"writable-strings", &flag_writable_strings, 1}, {"peephole", &flag_no_peephole, 0}, {"force-mem", &flag_force_mem, 1}, {"force-addr", &flag_force_addr, 1}, {"function-cse", &flag_no_function_cse, 0}, {"inline-functions", &flag_inline_functions, 1}, {"keep-inline-functions", &flag_keep_inline_functions, 1}, {"inline", &flag_no_inline, 0}, {"keep-static-consts", &flag_keep_static_consts, 1}, {"syntax-only", &flag_syntax_only, 1}, {"shared-data", &flag_shared_data, 1}, {"caller-saves", &flag_caller_saves, 1}, {"pcc-struct-return", &flag_pcc_struct_return, 1}, {"reg-struct-return", &flag_pcc_struct_return, 0}, {"delayed-branch", &flag_delayed_branch, 1}, {"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1}, {"pretend-float", &flag_pretend_float, 1}, {"schedule-insns", &flag_schedule_insns, 1}, {"schedule-insns2", &flag_schedule_insns_after_reload, 1}, {"pic", &flag_pic, 1}, {"PIC", &flag_pic, 2}, {"exceptions", &flag_exceptions, 1}, {"sjlj-exceptions", &exceptions_via_longjmp, 1}, {"asynchronous-exceptions", &asynchronous_exceptions, 1}, {"profile-arcs", &profile_arc_flag, 1}, {"test-coverage", &flag_test_coverage, 1}, {"branch-probabilities", &flag_branch_probabilities, 1}, {"fast-math", &flag_fast_math, 1}, {"common", &flag_no_common, 0}, {"inhibit-size-directive", &flag_inhibit_size_directive, 1}, {"function-sections", &flag_function_sections, 1}, {"verbose-asm", &flag_verbose_asm, 1}, {"gnu-linker", &flag_gnu_linker, 1}, {"pack-struct", &flag_pack_struct, 1}, {"stack-check", &flag_stack_check, 1}, {"bytecode", &output_bytecode, 1}, {"check-memory-usage", &flag_check_memory_usage, 1}, {"prefix-function-name", &flag_prefix_function_name, 1}};/* Table of language-specific options. */char *lang_options[] ={ "-ansi", "-fallow-single-precision", "-fsigned-bitfields", "-funsigned-bitfields", "-fno-signed-bitfields", "-fno-unsigned-bitfields", "-fsigned-char", "-funsigned-char", "-fno-signed-char", "-fno-unsigned-char", "-ftraditional", "-traditional", "-fnotraditional", "-fno-traditional", "-fasm", "-fno-asm", "-fbuiltin", "-fno-builtin", "-fhosted", "-fno-hosted", "-ffreestanding", "-fno-freestanding", "-fcond-mismatch", "-fno-cond-mismatch", "-fdollars-in-identifiers", "-fno-dollars-in-identifiers", "-fident", "-fno-ident", "-fshort-double", "-fno-short-double", "-fshort-enums", "-fno-short-enums", "-Wall", "-Wbad-function-cast", "-Wno-bad-function-cast", "-Wcast-qual", "-Wno-cast-qual", "-Wchar-subscripts", "-Wno-char-subscripts", "-Wcomment", "-Wno-comment", "-Wcomments", "-Wno-comments", "-Wconversion", "-Wno-conversion", "-Wformat", "-Wno-format", "-Wimport", "-Wno-import", "-Wimplicit-function-declaration", "-Wno-implicit-function-declaration", "-Werror-implicit-function-declaration", "-Wimplicit-int", "-Wno-implicit-int", "-Wimplicit", "-Wno-implicit", "-Wmain", "-Wno-main", "-Wmissing-braces", "-Wno-missing-braces", "-Wmissing-declarations", "-Wno-missing-declarations", "-Wmissing-prototypes", "-Wno-missing-prototypes", "-Wnested-externs", "-Wno-nested-externs", "-Wparentheses", "-Wno-parentheses", "-Wpointer-arith", "-Wno-pointer-arith", "-Wredundant-decls", "-Wno-redundant-decls", "-Wsign-compare", "-Wno-sign-compare", "-Wstrict-prototypes", "-Wno-strict-prototypes", "-Wtraditional", "-Wno-traditional", "-Wtrigraphs", "-Wno-trigraphs", "-Wundef", "-Wno-undef", "-Wwrite-strings", "-Wno-write-strings", /* these are for obj c */ "-lang-objc", "-gen-decls", "-fgnu-runtime", "-fno-gnu-runtime", "-fnext-runtime", "-fno-next-runtime", "-Wselector", "-Wno-selector", "-Wprotocol", "-Wno-protocol", "-print-objc-runtime-info",#include "options.h" 0};/* Options controlling warnings *//* Don't print warning messages. -w. */int inhibit_warnings = 0;/* Print various extra warnings. -W. */int extra_warnings = 0;/* Treat warnings as errors. -Werror. */int warnings_are_errors = 0;/* Nonzero to warn about unused local variables. */int warn_unused;/* Nonzero to warn about variables used before they are initialized. */int warn_uninitialized;/* Nonzero means warn about all declarations which shadow others. */int warn_shadow;/* Warn if a switch on an enum fails to have a case for every enum value. */int warn_switch;/* Nonzero means warn about function definitions that default the return type or that use a null return and have a return-type other than void. */int warn_return_type;/* Nonzero means warn about pointer casts that increase the required alignment of the target type (and might therefore lead to a crash due to a misaligned access). */int warn_cast_align;/* Nonzero means warn about any identifiers that match in the first N characters. The value N is in `id_clash_len'. */int warn_id_clash;unsigned id_clash_len;/* Nonzero means warn about any objects definitions whose size is larger than N bytes. Also want about function definitions whose returned values are larger than N bytes. The value N is in `larger_than_size'. */ int warn_larger_than;unsigned larger_than_size;/* Nonzero means warn if inline function is too large. */int warn_inline;/* Warn if a function returns an aggregate, since there are often incompatible calling conventions for doing this. */int warn_aggregate_return;/* Likewise for -W. */struct { char *string; int *variable; int on_value;} W_options[] ={ {"unused", &warn_unused, 1}, {"error", &warnings_are_errors, 1}, {"shadow", &warn_shadow, 1}, {"switch", &warn_switch, 1}, {"aggregate-return", &warn_aggregate_return, 1}, {"cast-align", &warn_cast_align, 1}, {"uninitialized", &warn_uninitialized, 1}, {"inline", &warn_inline, 1}};/* Output files for assembler code (real compiler output) and debugging dumps. */FILE *asm_out_file;FILE *aux_info_file;FILE *rtl_dump_file;FILE *jump_opt_dump_file;FILE *addressof_dump_file;FILE *cse_dump_file;FILE *loop_dump_file;FILE *cse2_dump_file;FILE *branch_prob_dump_file;FILE *flow_dump_file;FILE *combine_dump_file;FILE *sched_dump_file;FILE *local_reg_dump_file;FILE *global_reg_dump_file;FILE *sched2_dump_file;FILE *jump2_opt_dump_file;FILE *dbr_sched_dump_file;FILE *stack_reg_dump_file;/* Time accumulators, to count the total time spent in various passes. */int parse_time;int varconst_time;int integration_time;int jump_time;int cse_time;int loop_time;int cse2_time;int branch_prob_time;int flow_time;int combine_time;int sched_time;int local_alloc_time;int global_alloc_time;int sched2_time;int dbr_sched_time;int shorten_branch_time;int stack_reg_time;int final_time;int symout_time;int dump_time;/* Return time used so far, in microseconds. */intget_run_time (){#ifndef _WIN32#ifdef USG struct tms tms;#else#ifndef VMS struct rusage rusage;#else struct { int proc_user_time; int proc_system_time; int child_user_time; int child_system_time; } vms_times;#endif#endif#endif if (quiet_flag) return 0;#ifdef _WIN32 if (clock() < 0) return 0; else return (clock() * 1000);#else /* not _WIN32 */#ifdef USG times (&tms); return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);#else#ifndef VMS getrusage (0, &rusage); return (rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec + rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec);#else /* VMS */ times ((void *) &vms_times); return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000;#endif#endif#endif}#define TIMEVAR(VAR, BODY) \do { int otime = get_run_time (); BODY; VAR += get_run_time () - otime; } while (0)voidprint_time (str, total) char *str; int total;{ fprintf (stderr, "time in %s: %d.%06d\n", str, total / 1000000, total % 1000000);}/* Count an error or warning. Return 1 if the message should be printed. */intcount_error (warningp) int warningp;{ if (warningp && inhibit_warnings) return 0; if (warningp && !warnings_are_errors) warningcount++; else { static int warning_message = 0; if (warningp && !warning_message) { fprintf (stderr, "%s: warnings being treated as errors\n", progname); warning_message = 1; } errorcount++; } return 1;}/* Print a fatal error message. NAME is the text. Also include a system error message based on `errno'. */voidpfatal_with_name (name) char *name;{ fprintf (stderr, "%s: ", progname); perror (name); exit (FATAL_EXIT_CODE);}voidfatal_io_error (name) char *name;{ fprintf (stderr, "%s: %s: I/O error\n", progname, name); exit (FATAL_EXIT_CODE);}/* Called to give a better error message for a bad insn rather than just calling abort(). */voidfatal_insn (message, insn) char *message; rtx insn;{ if (!output_bytecode) { error (message); debug_rtx (insn); }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?