extern void maybe_propagate_warmth_attributes (tree, tree);
/* in error.cc */
+/* A class for pretty-printing to -flang-dump-XXX files. Used like
+
+ if (cxx_dump_pretty_printer pp {foo_dump_id})
+ {
+ pp_printf (&pp, ...);
+ }
+
+ If the dump is enabled, the pretty printer will open the dump file and
+ attach to it, and flush and close the file on destruction. */
+
+class cxx_dump_pretty_printer: public pretty_printer
+{
+ int phase;
+ FILE *outf;
+ dump_flags_t flags;
+
+public:
+ cxx_dump_pretty_printer (int phase);
+ operator bool() { return outf != nullptr; }
+ bool has_flag (dump_flags_t f) { return (flags & f); }
+ ~cxx_dump_pretty_printer ();
+};
+
extern const char *type_as_string (tree, int);
extern const char *type_as_string_translate (tree, int);
extern const char *decl_as_string (tree, int);
deferred_printed_type m_type_b;
};
+/* Constructor and destructor for cxx_dump_pretty_printer, defined here to
+ avoid needing to move cxx_format_postprocessor into the header as well. */
+
+cxx_dump_pretty_printer::
+cxx_dump_pretty_printer (int phase)
+ : phase (phase)
+{
+ outf = dump_begin (phase, &flags);
+ if (outf)
+ {
+ pp_format_decoder (this) = cp_printer;
+ /* This gets deleted in ~pretty_printer. */
+ pp_format_postprocessor (this) = new cxx_format_postprocessor ();
+ set_output_stream (outf);
+ }
+}
+
+cxx_dump_pretty_printer::
+~cxx_dump_pretty_printer ()
+{
+ if (outf)
+ {
+ pp_flush (this);
+ dump_end (phase, outf);
+ }
+}
+
/* Return the in-scope template that's currently being parsed, or
NULL_TREE otherwise. */