xref: /netbsd-src/external/gpl3/gcc/dist/gcc/toplev.h (revision b1e838363e3c6fc78a55519254d99869742dd33c)
1 /* toplev.h - Various declarations for functions found in toplev.cc
2    Copyright (C) 1998-2022 Free Software Foundation, Inc.
3 
4 This file is part of GCC.
5 
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
8 Software Foundation; either version 3, or (at your option) any later
9 version.
10 
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.
15 
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3.  If not see
18 <http://www.gnu.org/licenses/>.  */
19 
20 #ifndef GCC_TOPLEV_H
21 #define GCC_TOPLEV_H
22 
23 /* Decoded options, and number of such options.  */
24 extern struct cl_decoded_option *save_decoded_options;
25 extern unsigned int save_decoded_options_count;
26 extern vec<cl_decoded_option> *save_opt_decoded_options;
27 
28 class timer;
29 
30 /* Invoking the compiler.  */
31 class toplev
32 {
33 public:
34   toplev (timer *external_timer,
35 	  bool init_signals);
36   ~toplev ();
37 
38   int main (int argc, char **argv);
39 
40   void finalize ();
41 
42 private:
43 
44   void start_timevars ();
45 
46   void run_self_tests ();
47 
48   bool m_use_TV_TOTAL;
49   bool m_init_signals;
50 };
51 
52 extern void rest_of_decl_compilation (tree, int, int);
53 extern void rest_of_type_compilation (tree, int);
54 extern void init_optimization_passes (void);
55 extern bool enable_rtl_dump_file (void);
56 
57 /* In except.cc.  Initialize exception handling.  This is used by the Ada
58    and LTO front ends to initialize EH "on demand".  See lto-streamer-in.cc
59    and ada/gcc-interface/misc.cc.  */
60 extern void init_eh (void);
61 
62 extern void announce_function (tree);
63 
64 extern void wrapup_global_declaration_1 (tree);
65 extern bool wrapup_global_declaration_2 (tree);
66 extern bool wrapup_global_declarations (tree *, int);
67 
68 extern void global_decl_processing (void);
69 
70 extern void
71 dump_memory_report (const char *);
72 extern void dump_profile_report (void);
73 
74 extern void target_reinit (void);
75 
76 /* A unique local time stamp, might be zero if none is available.  */
77 extern unsigned local_tick;
78 
79 /* See toplev.cc.  */
80 extern int flag_rerun_cse_after_global_opts;
81 
82 extern void print_version (FILE *, const char *, bool);
83 
84 /* The hashtable, so that the C front ends can pass it to cpplib.  */
85 extern struct ht *ident_hash;
86 
87 /* Functions used to get and set GCC's notion of in what directory
88    compilation was started.  */
89 
90 extern const char *get_src_pwd	       (void);
91 extern bool set_src_pwd		       (const char *);
92 
93 /* Functions used to manipulate the random seed.  */
94 
95 extern HOST_WIDE_INT get_random_seed (bool);
96 extern void set_random_seed (const char *);
97 
98 extern void parse_alignment_opts (void);
99 
100 extern void initialize_rtl (void);
101 
102 #endif /* ! GCC_TOPLEV_H */
103