GCC Middle and Back End API Reference
context.h
Go to the documentation of this file.
1/* context.h - Holder for global state
2 Copyright (C) 2013-2026 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef GCC_CONTEXT_H
21#define GCC_CONTEXT_H
22
23namespace gcc {
24
25class pass_manager;
26class dump_manager;
28
29/* GCC's internal state can be divided into zero or more
30 "parallel universe" of state; an instance of this class is one such
31 context of state. */
33{
34public:
35 context ();
36 ~context ();
37
38 /* The flag shows if there are symbols to be streamed for offloading. */
40
41 /* Pass-management. */
42
44 {
46 m_passes = m;
47 }
48
50
51 /* Handling dump files. */
52
54
55 /* Publish/subscribe channels for events
56 on various compiler-specific topics. */
58 get_channels () const
59 {
61 return *m_channels;
62 }
63
64private:
65 /* Pass-management. */
67
68 /* Dump files. */
70
72
73}; // class context
74
75} // namespace gcc
76
77/* The global singleton context aka "g".
78 (the name is chosen to be easy to type in a debugger). */
79extern gcc::context *g;
80
81#endif /* ! GCC_CONTEXT_H */
Definition context.h:33
~context()
Definition context.cc:41
context()
Definition context.cc:33
pass_manager * get_passes()
Definition context.h:49
compiler_channels & get_channels() const
Definition context.h:58
void set_passes(pass_manager *m)
Definition context.h:43
pass_manager * m_passes
Definition context.h:66
dump_manager * get_dumps()
Definition context.h:53
bool have_offload
Definition context.h:39
compiler_channels * m_channels
Definition context.h:71
dump_manager * m_dumps
Definition context.h:69
Definition dumpfile.h:666
Definition pass_manager.h:48
gcc::context * g
Definition context.cc:31
Definition channels.h:26
Definition channels.h:38
#define gcc_assert(EXPR)
Definition system.h:817