]>
Commit | Line | Data |
---|---|---|
7f0b0c27 | 1 | /* Header file for modules that link with gcc.c |
fbd26352 | 2 | Copyright (C) 1999-2019 Free Software Foundation, Inc. |
7f0b0c27 | 3 | |
f12b58b3 | 4 | This file is part of GCC. |
7f0b0c27 | 5 | |
f12b58b3 | 6 | GCC is free software; you can redistribute it and/or modify it under |
7 | the terms of the GNU General Public License as published by the Free | |
8c4c00c1 | 8 | Software Foundation; either version 3, or (at your option) any later |
f12b58b3 | 9 | version. |
7f0b0c27 | 10 | |
f12b58b3 | 11 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
12 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | for more details. | |
7f0b0c27 | 15 | |
16 | You should have received a copy of the GNU General Public License | |
8c4c00c1 | 17 | along with GCC; see the file COPYING3. If not see |
18 | <http://www.gnu.org/licenses/>. */ | |
7f0b0c27 | 19 | |
2a281353 | 20 | #ifndef GCC_GCC_H |
21 | #define GCC_GCC_H | |
7f0b0c27 | 22 | |
56fc5f02 | 23 | #include "version.h" |
460b8bb3 | 24 | #include "diagnostic-core.h" |
56fc5f02 | 25 | |
cbbb2345 | 26 | /* The top-level "main" within the driver would be ~1000 lines long. |
27 | This class breaks it up into smaller functions and contains some | |
28 | state shared by them. */ | |
29 | ||
30 | class driver | |
31 | { | |
32 | public: | |
26a4a13d | 33 | driver (bool can_finalize, bool debug); |
34 | ~driver (); | |
cbbb2345 | 35 | int main (int argc, char **argv); |
26a4a13d | 36 | void finalize (); |
cbbb2345 | 37 | |
38 | private: | |
39 | void set_progname (const char *argv0) const; | |
40 | void expand_at_files (int *argc, char ***argv) const; | |
41 | void decode_argv (int argc, const char **argv); | |
42 | void global_initializations (); | |
43 | void build_multilib_strings () const; | |
44 | void set_up_specs () const; | |
45 | void putenv_COLLECT_GCC (const char *argv0) const; | |
46 | void maybe_putenv_COLLECT_LTO_WRAPPER () const; | |
47 | void maybe_putenv_OFFLOAD_TARGETS () const; | |
da7d5066 | 48 | void handle_unrecognized_options (); |
cbbb2345 | 49 | int maybe_print_and_exit () const; |
50 | bool prepare_infiles (); | |
51 | void do_spec_on_infiles () const; | |
52 | void maybe_run_linker (const char *argv0) const; | |
53 | void final_actions () const; | |
54 | int get_exit_code () const; | |
55 | ||
56 | private: | |
57 | char *explicit_link_files; | |
58 | struct cl_decoded_option *decoded_options; | |
59 | unsigned int decoded_options_count; | |
2abdff38 | 60 | option_proposer m_option_proposer; |
cbbb2345 | 61 | }; |
62 | ||
c21b3276 | 63 | /* The mapping of a spec function name to the C function that |
64 | implements it. */ | |
65 | struct spec_function | |
952f0048 | 66 | { |
c21b3276 | 67 | const char *name; |
952f0048 | 68 | const char *(*func) (int, const char **); |
c21b3276 | 69 | }; |
70 | ||
88b5b080 | 71 | /* These are exported by gcc.c. */ |
952f0048 | 72 | extern int do_spec (const char *); |
73 | extern void record_temp_file (const char *, int, int); | |
952f0048 | 74 | extern void set_input (const char *); |
7f0b0c27 | 75 | |
88b5b080 | 76 | /* Spec files linked with gcc.c must provide definitions for these. */ |
7f0b0c27 | 77 | |
88b5b080 | 78 | /* Called before processing to change/add/remove arguments. */ |
cb22f930 | 79 | extern void lang_specific_driver (struct cl_decoded_option **, |
80 | unsigned int *, int *); | |
7f0b0c27 | 81 | |
88b5b080 | 82 | /* Called before linking. Returns 0 on success and -1 on failure. */ |
952f0048 | 83 | extern int lang_specific_pre_link (void); |
7f0b0c27 | 84 | |
943bf3c7 | 85 | extern int n_infiles; |
86 | ||
88b5b080 | 87 | /* Number of extra output files that lang_specific_pre_link may generate. */ |
7f0b0c27 | 88 | extern int lang_specific_extra_outfiles; |
89 | ||
943bf3c7 | 90 | /* A vector of corresponding output files is made up later. */ |
91 | ||
92 | extern const char **outfiles; | |
93 | ||
cbbb2345 | 94 | extern void |
95 | driver_get_configure_time_options (void (*cb)(const char *option, | |
96 | void *user_data), | |
97 | void *user_data); | |
98 | ||
2a281353 | 99 | #endif /* ! GCC_GCC_H */ |