]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/dump-context.h
PR fortran/95090 - ICE: identifier overflow
[thirdparty/gcc.git] / gcc / dump-context.h
index 347477f331ef62f775cc2e2757bbc9e300ec8032..3f72cc932a9fb459de83fe51b33758b0f5efad0a 100644 (file)
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 
 class optrecord_json_writer;
 namespace selftest { class temp_dump_context; }
+class debug_dump_context;
 
 /* A class for handling the various dump_* calls.
 
@@ -42,6 +43,7 @@ namespace selftest { class temp_dump_context; }
 class dump_context
 {
   friend class selftest::temp_dump_context;
+  friend class debug_dump_context;
 
  public:
   static dump_context &get () { return *s_current; }
@@ -195,6 +197,25 @@ private:
   auto_vec<stashed_item> m_stashed_items;
 };
 
+/* An RAII-style class for use in debug dumpers for temporarily using a
+   different dump_context.  It enables full details and outputs to
+   stderr instead of the currently active dump_file.  */
+
+class debug_dump_context
+{
+ public:
+  debug_dump_context ();
+  ~debug_dump_context ();
+
+ private:
+  dump_context m_context;
+  dump_context *m_saved;
+  dump_flags_t m_saved_flags;
+  dump_flags_t m_saved_pflags;
+  FILE *m_saved_file;
+};
+
+
 #if CHECKING_P
 
 namespace selftest {