1 /* pass_manager.h - The pipeline of optimization passes
2 Copyright (C) 2013 Free Software Foundation, Inc.
4 This file is part of GCC.
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
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
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/>. */
20 #ifndef GCC_PASS_MANAGER_H
21 #define GCC_PASS_MANAGER_H
24 struct register_pass_info
;
26 /* Define a list of pass lists so that both passes.c and plugins can easily
27 find all the pass lists. */
28 #define GCC_PASS_LISTS \
29 DEF_PASS_LIST (all_lowering_passes) \
30 DEF_PASS_LIST (all_small_ipa_passes) \
31 DEF_PASS_LIST (all_regular_ipa_passes) \
32 DEF_PASS_LIST (all_lto_gen_passes) \
33 DEF_PASS_LIST (all_passes)
35 #define DEF_PASS_LIST(LIST) PASS_LIST_NO_##LIST,
50 pass_manager(context
*ctxt
);
52 void register_pass (struct register_pass_info
*pass_info
);
53 void register_one_dump_file (struct opt_pass
*pass
);
55 opt_pass
*get_pass_for_id (int id
) const;
57 void dump_passes () const;
59 void dump_profile_report () const;
62 /* The root of the compilation pass tree, once constructed. */
64 opt_pass
*all_small_ipa_passes
;
65 opt_pass
*all_lowering_passes
;
66 opt_pass
*all_regular_ipa_passes
;
67 opt_pass
*all_lto_gen_passes
;
68 opt_pass
*all_late_ipa_passes
;
70 /* A map from static pass id to optimization pass. */
71 opt_pass
**passes_by_id
;
72 int passes_by_id_size
;
74 opt_pass
**pass_lists
[PASS_LIST_NUM
];
77 void set_pass_for_id (int id
, opt_pass
*pass
);
78 int register_dump_files_1 (struct opt_pass
*pass
, int properties
);
79 void register_dump_files (struct opt_pass
*pass
, int properties
);
84 }; // class pass_manager
88 #endif /* ! GCC_PASS_MANAGER_H */