context.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* context.h - Holder for global state
  2. Copyright (C) 2013-2015 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free
  6. Software Foundation; either version 3, or (at your option) any later
  7. version.
  8. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11. for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GCC; see the file COPYING3. If not see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef GCC_CONTEXT_H
  16. #define GCC_CONTEXT_H
  17. namespace gcc {
  18. class pass_manager;
  19. class dump_manager;
  20. /* GCC's internal state can be divided into zero or more
  21. "parallel universe" of state; an instance of this class is one such
  22. context of state. */
  23. class context
  24. {
  25. public:
  26. context ();
  27. ~context ();
  28. /* The flag shows if there are symbols to be streamed for offloading. */
  29. bool have_offload;
  30. /* Pass-management. */
  31. pass_manager *get_passes () { gcc_assert (m_passes); return m_passes; }
  32. /* Handling dump files. */
  33. dump_manager *get_dumps () {gcc_assert (m_dumps); return m_dumps; }
  34. private:
  35. /* Pass-management. */
  36. pass_manager *m_passes;
  37. /* Dump files. */
  38. dump_manager *m_dumps;
  39. }; // class context
  40. } // namespace gcc
  41. /* The global singleton context aka "g".
  42. (the name is chosen to be easy to type in a debugger). */
  43. extern gcc::context *g;
  44. #endif /* ! GCC_CONTEXT_H */