diff --git a/gcc/ada/gcc-interface/misc.cc b/gcc/ada/gcc-interface/misc.cc
index 2aa1bfd410b..8c921db7dcd 100644
--- a/gcc/ada/gcc-interface/misc.cc
+++ b/gcc/ada/gcc-interface/misc.cc
@@ -23,6 +23,7 @@
* *
****************************************************************************/
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc
index a073b2d94f1..5f5cbe5b477 100644
--- a/gcc/ada/gcc-interface/trans.cc
+++ b/gcc/ada/gcc-interface/trans.cc
@@ -23,6 +23,7 @@
* *
****************************************************************************/
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc
index a88a23860d3..951d3848d09 100644
--- a/gcc/ada/gcc-interface/utils.cc
+++ b/gcc/ada/gcc-interface/utils.cc
@@ -23,6 +23,7 @@
* *
****************************************************************************/
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/analyzer/analyzer-logging.cc b/gcc/analyzer/analyzer-logging.cc
index d3b04f2d9b1..2a4d02f83ba 100644
--- a/gcc/analyzer/analyzer-logging.cc
+++ b/gcc/analyzer/analyzer-logging.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -50,12 +51,12 @@ logger::logger (FILE *f_out,
m_log_refcount_changes (false),
m_pp (reference_pp.clone ())
{
- pp_show_color (m_pp) = 0;
- pp_buffer (m_pp)->m_stream = f_out;
+ pp_show_color (m_pp.get ()) = 0;
+ pp_buffer (m_pp.get ())->m_stream = f_out;
/* %qE in logs for SSA_NAMEs should show the ssa names, rather than
trying to prettify things by showing the underlying var. */
- pp_format_decoder (m_pp) = default_tree_printer;
+ pp_format_decoder (m_pp.get ()) = default_tree_printer;
/* Begin the log by writing the GCC version. */
print_version (f_out, "", false);
@@ -70,7 +71,6 @@ logger::~logger ()
/* This should be the last message emitted. */
log ("%s", __PRETTY_FUNCTION__);
gcc_assert (m_refcount == 0);
- delete m_pp;
}
/* Increment the reference count of the logger. */
@@ -145,15 +145,15 @@ void
logger::log_va_partial (const char *fmt, va_list *ap)
{
text_info text (fmt, ap, 0);
- pp_format (m_pp, &text);
- pp_output_formatted_text (m_pp);
+ pp_format (m_pp.get (), &text);
+ pp_output_formatted_text (m_pp.get ());
}
void
logger::end_log_line ()
{
- pp_flush (m_pp);
- pp_clear_output_area (m_pp);
+ pp_flush (m_pp.get ());
+ pp_clear_output_area (m_pp.get ());
fprintf (m_f_out, "\n");
fflush (m_f_out);
}
diff --git a/gcc/analyzer/analyzer-logging.h b/gcc/analyzer/analyzer-logging.h
index eb2cde7a306..aaa3d79a30e 100644
--- a/gcc/analyzer/analyzer-logging.h
+++ b/gcc/analyzer/analyzer-logging.h
@@ -57,7 +57,7 @@ class logger
void inc_indent () { m_indent_level++; }
void dec_indent () { m_indent_level--; }
- pretty_printer *get_printer () const { return m_pp; }
+ pretty_printer *get_printer () const { return m_pp.get (); }
FILE *get_file () const { return m_f_out; }
private:
@@ -67,7 +67,7 @@ private:
FILE *m_f_out;
int m_indent_level;
bool m_log_refcount_changes;
- pretty_printer *m_pp;
+ std::unique_ptr m_pp;
};
/* The class log_scope is an RAII-style class intended to make
diff --git a/gcc/analyzer/analyzer.cc b/gcc/analyzer/analyzer.cc
index 4a1a3615713..0f998e3f66f 100644
--- a/gcc/analyzer/analyzer.cc
+++ b/gcc/analyzer/analyzer.cc
@@ -494,11 +494,11 @@ get_user_facing_name (const gcall *call)
label_text
make_label_text (bool can_colorize, const char *fmt, ...)
{
- pretty_printer *pp = global_dc->m_printer->clone ();
- pp_clear_output_area (pp);
+ std::unique_ptr pp (global_dc->clone_printer ());
+ pp_clear_output_area (pp.get ());
if (!can_colorize)
- pp_show_color (pp) = false;
+ pp_show_color (pp.get ()) = false;
rich_location rich_loc (line_table, UNKNOWN_LOCATION);
@@ -507,13 +507,12 @@ make_label_text (bool can_colorize, const char *fmt, ...)
va_start (ap, fmt);
text_info ti (_(fmt), &ap, 0, NULL, &rich_loc);
- pp_format (pp, &ti);
- pp_output_formatted_text (pp);
+ pp_format (pp.get (), &ti);
+ pp_output_formatted_text (pp.get ());
va_end (ap);
- label_text result = label_text::take (xstrdup (pp_formatted_text (pp)));
- delete pp;
+ label_text result = label_text::take (xstrdup (pp_formatted_text (pp.get ())));
return result;
}
@@ -524,11 +523,11 @@ make_label_text_n (bool can_colorize, unsigned HOST_WIDE_INT n,
const char *singular_fmt,
const char *plural_fmt, ...)
{
- pretty_printer *pp = global_dc->m_printer->clone ();
- pp_clear_output_area (pp);
+ std::unique_ptr pp (global_dc->clone_printer ());
+ pp_clear_output_area (pp.get ());
if (!can_colorize)
- pp_show_color (pp) = false;
+ pp_show_color (pp.get ()) = false;
rich_location rich_loc (line_table, UNKNOWN_LOCATION);
@@ -540,13 +539,13 @@ make_label_text_n (bool can_colorize, unsigned HOST_WIDE_INT n,
text_info ti (fmt, &ap, 0, NULL, &rich_loc);
- pp_format (pp, &ti);
- pp_output_formatted_text (pp);
+ pp_format (pp.get (), &ti);
+ pp_output_formatted_text (pp.get ());
va_end (ap);
- label_text result = label_text::take (xstrdup (pp_formatted_text (pp)));
- delete pp;
+ label_text result
+ = label_text::take (xstrdup (pp_formatted_text (pp.get ())));
return result;
}
diff --git a/gcc/analyzer/bar-chart.cc b/gcc/analyzer/bar-chart.cc
index 4a4acf5f377..3a259f80066 100644
--- a/gcc/analyzer/bar-chart.cc
+++ b/gcc/analyzer/bar-chart.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/analyzer/pending-diagnostic.cc b/gcc/analyzer/pending-diagnostic.cc
index ec6f5acf21f..a900839375c 100644
--- a/gcc/analyzer/pending-diagnostic.cc
+++ b/gcc/analyzer/pending-diagnostic.cc
@@ -93,21 +93,19 @@ interesting_t::dump_to_pp (pretty_printer *pp, bool simple) const
label_text
evdesc::event_desc::formatted_print (const char *fmt, ...) const
{
- pretty_printer *pp = global_dc->m_printer->clone ();
+ auto pp = global_dc->clone_printer ();
- pp_show_color (pp) = m_colorize;
+ pp_show_color (pp.get ()) = m_colorize;
rich_location rich_loc (line_table, UNKNOWN_LOCATION);
va_list ap;
va_start (ap, fmt);
text_info ti (_(fmt), &ap, 0, nullptr, &rich_loc);
- pp_format (pp, &ti);
- pp_output_formatted_text (pp);
+ pp_format (pp.get (), &ti);
+ pp_output_formatted_text (pp.get ());
va_end (ap);
- label_text result = label_text::take (xstrdup (pp_formatted_text (pp)));
- delete pp;
- return result;
+ return label_text::take (xstrdup (pp_formatted_text (pp.get ())));
}
/* class diagnostic_emission_context. */
diff --git a/gcc/analyzer/sm-malloc.cc b/gcc/analyzer/sm-malloc.cc
index 11c0e1b1a2f..12465cbe42b 100644
--- a/gcc/analyzer/sm-malloc.cc
+++ b/gcc/analyzer/sm-malloc.cc
@@ -1648,14 +1648,13 @@ private:
static bool sufficiently_similar_p (tree expr_a, tree expr_b)
{
- pretty_printer *pp_a = global_dc->m_printer->clone ();
- pretty_printer *pp_b = global_dc->m_printer->clone ();
- pp_printf (pp_a, "%qE", expr_a);
- pp_printf (pp_b, "%qE", expr_b);
- bool result = (strcmp (pp_formatted_text (pp_a), pp_formatted_text (pp_b))
+ auto pp_a = global_dc->clone_printer ();
+ auto pp_b = global_dc->clone_printer ();
+ pp_printf (pp_a.get (), "%qE", expr_a);
+ pp_printf (pp_b.get (), "%qE", expr_b);
+ bool result = (strcmp (pp_formatted_text (pp_a.get ()),
+ pp_formatted_text (pp_b.get ()))
== 0);
- delete pp_a;
- delete pp_b;
return result;
}
diff --git a/gcc/analyzer/supergraph.cc b/gcc/analyzer/supergraph.cc
index 55bd42a89a1..826f8f614f7 100644
--- a/gcc/analyzer/supergraph.cc
+++ b/gcc/analyzer/supergraph.cc
@@ -437,16 +437,15 @@ supergraph::dump_dot_to_pp (pretty_printer *pp,
void
supergraph::dump_dot_to_file (FILE *fp, const dump_args_t &dump_args) const
{
- pretty_printer *pp = global_dc->m_printer->clone ();
- pp_show_color (pp) = 0;
+ std::unique_ptr pp (global_dc->clone_printer ());
+ pp_show_color (pp.get ()) = 0;
/* %qE in logs for SSA_NAMEs should show the ssa names, rather than
trying to prettify things by showing the underlying var. */
- pp_format_decoder (pp) = default_tree_printer;
+ pp_format_decoder (pp.get ()) = default_tree_printer;
pp->set_output_stream (fp);
- dump_dot_to_pp (pp, dump_args);
- pp_flush (pp);
- delete pp;
+ dump_dot_to_pp (pp.get (), dump_args);
+ pp_flush (pp.get ());
}
/* Dump this graph in .dot format to PATH, using DUMP_ARGS. */
diff --git a/gcc/asan.cc b/gcc/asan.cc
index bc92d9c7a79..99c5d2e50d5 100644
--- a/gcc/asan.cc
+++ b/gcc/asan.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/attribs.cc b/gcc/attribs.cc
index 0be7b83b264..311242815fa 100644
--- a/gcc/attribs.cc
+++ b/gcc/attribs.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#define INCLUDE_STRING
#include "config.h"
#include "system.h"
@@ -2673,10 +2674,9 @@ attr_access::array_as_string (tree type) const
/* Format the type using the current pretty printer. The generic tree
printer does a terrible job. */
- pretty_printer *pp = global_dc->m_printer->clone ();
- pp_printf (pp, "%qT", type);
- typstr = pp_formatted_text (pp);
- delete pp;
+ std::unique_ptr pp (global_dc->clone_printer ());
+ pp_printf (pp.get (), "%qT", type);
+ typstr = pp_formatted_text (pp.get ());
return typstr;
}
diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc
index de59b94bcb3..242b71d1165 100644
--- a/gcc/auto-profile.cc
+++ b/gcc/auto-profile.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#define INCLUDE_MAP
+#define INCLUDE_MEMORY
#define INCLUDE_SET
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c-family/c-ada-spec.cc b/gcc/c-family/c-ada-spec.cc
index fbba4436254..db5c0b5d746 100644
--- a/gcc/c-family/c-ada-spec.cc
+++ b/gcc/c-family/c-ada-spec.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c-family/c-attribs.cc b/gcc/c-family/c-attribs.cc
index 4dd2eecbea5..cf9523aacf5 100644
--- a/gcc/c-family/c-attribs.cc
+++ b/gcc/c-family/c-attribs.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#define INCLUDE_STRING
#include "config.h"
#include "system.h"
diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc
index 7494a2dac0a..28a2d4b17df 100644
--- a/gcc/c-family/c-common.cc
+++ b/gcc/c-family/c-common.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
#define GCC_C_COMMON_C
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c-family/c-format.cc b/gcc/c-family/c-format.cc
index f4a65a5019c..211fb3be7d9 100644
--- a/gcc/c-family/c-format.cc
+++ b/gcc/c-family/c-format.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c-family/c-gimplify.cc b/gcc/c-family/c-gimplify.cc
index 09ea1b79159..7885e295033 100644
--- a/gcc/c-family/c-gimplify.cc
+++ b/gcc/c-family/c-gimplify.cc
@@ -23,6 +23,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c-family/c-indentation.cc b/gcc/c-family/c-indentation.cc
index 38be7d24da0..7adec84ce2b 100644
--- a/gcc/c-family/c-indentation.cc
+++ b/gcc/c-family/c-indentation.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc
index 6be65fb2f73..5eb6940a976 100644
--- a/gcc/c-family/c-opts.cc
+++ b/gcc/c-family/c-opts.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c-family/c-pch.cc b/gcc/c-family/c-pch.cc
index f104575d3d0..50479ad43f4 100644
--- a/gcc/c-family/c-pch.cc
+++ b/gcc/c-family/c-pch.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c-family/c-pragma.cc b/gcc/c-family/c-pragma.cc
index ed2a7a00e9e..9d7153489f9 100644
--- a/gcc/c-family/c-pragma.cc
+++ b/gcc/c-family/c-pragma.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c-family/c-pretty-print.cc b/gcc/c-family/c-pretty-print.cc
index 13806714446..fadb9e3ecfe 100644
--- a/gcc/c-family/c-pretty-print.cc
+++ b/gcc/c-family/c-pretty-print.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -36,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "basic-block.h"
#include "gimple.h"
+#include "make-unique.h"
/* The pretty-printer code is primarily designed to closely follow
(GNU) C and C++ grammars. That is to be contrasted with spaghetti
@@ -2986,10 +2988,10 @@ c_pretty_printer::c_pretty_printer ()
/* c_pretty_printer's implementation of pretty_printer::clone vfunc. */
-pretty_printer *
+std::unique_ptr
c_pretty_printer::clone () const
{
- return new c_pretty_printer (*this);
+ return ::make_unique (*this);
}
/* Print the tree T in full, on file FILE. */
diff --git a/gcc/c-family/c-pretty-print.h b/gcc/c-family/c-pretty-print.h
index 550e4cb6882..80854b07917 100644
--- a/gcc/c-family/c-pretty-print.h
+++ b/gcc/c-family/c-pretty-print.h
@@ -51,7 +51,7 @@ class c_pretty_printer : public pretty_printer
{
public:
c_pretty_printer ();
- pretty_printer *clone () const override;
+ std::unique_ptr clone () const override;
// Format string, possibly translated.
void translate_string (const char *);
diff --git a/gcc/c-family/c-type-mismatch.cc b/gcc/c-family/c-type-mismatch.cc
index 89646854f3c..abc8cb83cc5 100644
--- a/gcc/c-family/c-type-mismatch.cc
+++ b/gcc/c-family/c-type-mismatch.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c-family/c-warn.cc b/gcc/c-family/c-warn.cc
index 05d6e37edae..8c94888bda0 100644
--- a/gcc/c-family/c-warn.cc
+++ b/gcc/c-family/c-warn.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#define INCLUDE_STRING
#include "config.h"
#include "system.h"
diff --git a/gcc/c/c-aux-info.cc b/gcc/c/c-aux-info.cc
index f6b5980aa83..b422da0e726 100644
--- a/gcc/c/c-aux-info.cc
+++ b/gcc/c/c-aux-info.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c/c-convert.cc b/gcc/c/c-convert.cc
index 7c1064c6691..9180c6ae14e 100644
--- a/gcc/c/c-convert.cc
+++ b/gcc/c/c-convert.cc
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
Every language front end must have a `convert' function
but what kind of conversions it does will depend on the language. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c/c-errors.cc b/gcc/c/c-errors.cc
index c6b7c108354..38b11a7c70a 100644
--- a/gcc/c/c-errors.cc
+++ b/gcc/c/c-errors.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c/c-fold.cc b/gcc/c/c-fold.cc
index 9ea174f79c4..06085f5f58f 100644
--- a/gcc/c/c-fold.cc
+++ b/gcc/c/c-fold.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c/c-lang.cc b/gcc/c/c-lang.cc
index 870e23b4a33..7e5604fce6b 100644
--- a/gcc/c/c-lang.cc
+++ b/gcc/c/c-lang.cc
@@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c/c-objc-common.cc b/gcc/c/c-objc-common.cc
index eb0c4b85772..dc91373f5b9 100644
--- a/gcc/c/c-objc-common.cc
+++ b/gcc/c/c-objc-common.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -295,11 +296,11 @@ print_type (c_pretty_printer *cpp, tree t, bool *quoted,
void
pp_markup::element_quoted_type::print_type (pp_markup::context &ctxt)
{
- c_pretty_printer *cpp = (c_pretty_printer *) ctxt.m_pp.clone ();
+ auto pp = ctxt.m_pp.clone ();
+ c_pretty_printer *cpp = (c_pretty_printer *)pp.get ();
cpp->set_padding (pp_none);
::print_type (cpp, m_type, &ctxt.m_quoted, m_highlight_color);
pp_string (&ctxt.m_pp, pp_formatted_text (cpp));
- delete cpp;
}
/* Called during diagnostic message formatting process to print a
diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index 108ea5ca3e8..2a99c0e435d 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
including computing the types of the result, C-specific error checks,
and some optimization. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/c/gimple-parser.cc b/gcc/c/gimple-parser.cc
index d156d83cd37..8d1db33b844 100644
--- a/gcc/c/gimple-parser.cc
+++ b/gcc/c/gimple-parser.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/calls.cc b/gcc/calls.cc
index c5c26f65280..05eaa0d7b14 100644
--- a/gcc/calls.cc
+++ b/gcc/calls.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cfganal.cc b/gcc/cfganal.cc
index 35c59f3f5d2..863f88ff1ea 100644
--- a/gcc/cfganal.cc
+++ b/gcc/cfganal.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
/* This file contains various simple utilities to analyze the CFG. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cfgexpand.cc b/gcc/cfgexpand.cc
index 6c1096363af..885f488a9d4 100644
--- a/gcc/cfgexpand.cc
+++ b/gcc/cfgexpand.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cfghooks.cc b/gcc/cfghooks.cc
index 3ced91c9639..55fdf983e1c 100644
--- a/gcc/cfghooks.cc
+++ b/gcc/cfghooks.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cfgloop.cc b/gcc/cfgloop.cc
index 5202c3865d1..df0ec7722bc 100644
--- a/gcc/cfgloop.cc
+++ b/gcc/cfgloop.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc
index b5d096d530c..45f851d0f4a 100644
--- a/gcc/cgraph.cc
+++ b/gcc/cgraph.cc
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
optimization. It represents a multi-graph where nodes are functions
(symbols within symbol table) and edges are call sites. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cgraphclones.cc b/gcc/cgraphclones.cc
index 4fff6873a36..ede720f4b15 100644
--- a/gcc/cgraphclones.cc
+++ b/gcc/cgraphclones.cc
@@ -64,6 +64,7 @@ along with GCC; see the file COPYING3. If not see
only difference is that clones are not visible during the
Generate Summary stage. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cgraphunit.cc b/gcc/cgraphunit.cc
index 2bd0289ffba..0052b92715a 100644
--- a/gcc/cgraphunit.cc
+++ b/gcc/cgraphunit.cc
@@ -157,6 +157,7 @@ along with GCC; see the file COPYING3. If not see
and apply simple transformations
*/
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/collect-utils.cc b/gcc/collect-utils.cc
index 981a14a554b..5397fe2c7a0 100644
--- a/gcc/collect-utils.cc
+++ b/gcc/collect-utils.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/collect2.cc b/gcc/collect2.cc
index 902014a9cc1..2bd618d27c1 100644
--- a/gcc/collect2.cc
+++ b/gcc/collect2.cc
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
/* Build tables of static constructors and destructors and run ld. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc
index 64b65b7ff9e..2bfc597e333 100644
--- a/gcc/common/config/aarch64/aarch64-common.cc
+++ b/gcc/common/config/aarch64/aarch64-common.cc
@@ -19,6 +19,7 @@
. */
#include "config.h"
+#define INCLUDE_MEMORY
#define INCLUDE_STRING
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/common/config/arm/arm-common.cc b/gcc/common/config/arm/arm-common.cc
index dbcbe3f6e99..68674575ccf 100644
--- a/gcc/common/config/arm/arm-common.cc
+++ b/gcc/common/config/arm/arm-common.cc
@@ -18,6 +18,7 @@
. */
#define INCLUDE_LIST
+#define INCLUDE_MEMORY
#define INCLUDE_VECTOR
#define INCLUDE_ALGORITHM
#include "config.h"
diff --git a/gcc/common/config/avr/avr-common.cc b/gcc/common/config/avr/avr-common.cc
index bb454a20856..f14a4a48e7c 100644
--- a/gcc/common/config/avr/avr-common.cc
+++ b/gcc/common/config/avr/avr-common.cc
@@ -17,6 +17,7 @@
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/aarch64/aarch64-cc-fusion.cc b/gcc/config/aarch64/aarch64-cc-fusion.cc
index 3af8c00d846..3cae4c4d8bd 100644
--- a/gcc/config/aarch64/aarch64-cc-fusion.cc
+++ b/gcc/config/aarch64/aarch64-cc-fusion.cc
@@ -64,6 +64,7 @@
#define INCLUDE_ALGORITHM
#define INCLUDE_FUNCTIONAL
#define INCLUDE_ARRAY
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/aarch64/aarch64-early-ra.cc b/gcc/config/aarch64/aarch64-early-ra.cc
index 6e544dd6191..bbd84686e13 100644
--- a/gcc/config/aarch64/aarch64-early-ra.cc
+++ b/gcc/config/aarch64/aarch64-early-ra.cc
@@ -40,6 +40,7 @@
#define INCLUDE_ALGORITHM
#define INCLUDE_FUNCTIONAL
+#define INCLUDE_MEMORY
#define INCLUDE_ARRAY
#include "config.h"
#include "system.h"
diff --git a/gcc/config/aarch64/aarch64-sve-builtins.cc b/gcc/config/aarch64/aarch64-sve-builtins.cc
index af6469fff71..ef14f8cd39d 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins.cc
+++ b/gcc/config/aarch64/aarch64-sve-builtins.cc
@@ -19,6 +19,7 @@
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/arc/arc.cc b/gcc/config/arc/arc.cc
index ba7bde1de44..db8168650c7 100644
--- a/gcc/config/arc/arc.cc
+++ b/gcc/config/arc/arc.cc
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/arm/aarch-common.cc b/gcc/config/arm/aarch-common.cc
index aa405af8192..44012feb5be 100644
--- a/gcc/config/arm/aarch-common.cc
+++ b/gcc/config/arm/aarch-common.cc
@@ -23,6 +23,7 @@
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/arm/arm-mve-builtins.cc b/gcc/config/arm/arm-mve-builtins.cc
index 252744596ce..804eb88b6a5 100644
--- a/gcc/config/arm/arm-mve-builtins.cc
+++ b/gcc/config/arm/arm-mve-builtins.cc
@@ -19,6 +19,7 @@
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/avr/avr-devices.cc b/gcc/config/avr/avr-devices.cc
index 456a6b72c8b..83b4a2ec64c 100644
--- a/gcc/config/avr/avr-devices.cc
+++ b/gcc/config/avr/avr-devices.cc
@@ -20,6 +20,7 @@
#ifndef IN_GEN_AVR_MMCU_TEXI
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/avr/driver-avr.cc b/gcc/config/avr/driver-avr.cc
index 4dcabc604e8..3eefcabe48d 100644
--- a/gcc/config/avr/driver-avr.cc
+++ b/gcc/config/avr/driver-avr.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc
index 2051fa5b08b..aa00d149c4d 100644
--- a/gcc/config/bpf/bpf.cc
+++ b/gcc/config/bpf/bpf.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/bpf/btfext-out.cc b/gcc/config/bpf/btfext-out.cc
index b3df7b555d5..ca6241aa52e 100644
--- a/gcc/config/bpf/btfext-out.cc
+++ b/gcc/config/bpf/btfext-out.cc
@@ -19,6 +19,7 @@
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/bpf/core-builtins.cc b/gcc/config/bpf/core-builtins.cc
index 86e2e9d6e39..deb368a1d3d 100644
--- a/gcc/config/bpf/core-builtins.cc
+++ b/gcc/config/bpf/core-builtins.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/darwin.cc b/gcc/config/darwin.cc
index 47e41ac8a12..ae821e32012 100644
--- a/gcc/config/darwin.cc
+++ b/gcc/config/darwin.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/i386/driver-i386.cc b/gcc/config/i386/driver-i386.cc
index 445f5640155..26f094cd45d 100644
--- a/gcc/config/i386/driver-i386.cc
+++ b/gcc/config/i386/driver-i386.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/i386/i386-builtins.cc b/gcc/config/i386/i386-builtins.cc
index 4286eeb80e6..a778f049a88 100644
--- a/gcc/config/i386/i386-builtins.cc
+++ b/gcc/config/i386/i386-builtins.cc
@@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index 63f5e348d64..a5094b5b2cc 100644
--- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc
@@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/i386/i386-features.cc b/gcc/config/i386/i386-features.cc
index 3434d006943..16b1e6ca66e 100644
--- a/gcc/config/i386/i386-features.cc
+++ b/gcc/config/i386/i386-features.cc
@@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index 55e0210260f..5fa6e021778 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/loongarch/loongarch-builtins.cc b/gcc/config/loongarch/loongarch-builtins.cc
index cf92770de30..64529da8250 100644
--- a/gcc/config/loongarch/loongarch-builtins.cc
+++ b/gcc/config/loongarch/loongarch-builtins.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/mingw/winnt-cxx.cc b/gcc/config/mingw/winnt-cxx.cc
index f4d7a50262b..621366e9974 100644
--- a/gcc/config/mingw/winnt-cxx.cc
+++ b/gcc/config/mingw/winnt-cxx.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/mingw/winnt.cc b/gcc/config/mingw/winnt.cc
index 803e5f5ec85..fb4b8a48415 100644
--- a/gcc/config/mingw/winnt.cc
+++ b/gcc/config/mingw/winnt.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc
index 173f792bf55..cd5c5970f0b 100644
--- a/gcc/config/mips/mips.cc
+++ b/gcc/config/mips/mips.cc
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/msp430/driver-msp430.cc b/gcc/config/msp430/driver-msp430.cc
index a11fd3d7dec..5ffa8ef35e6 100644
--- a/gcc/config/msp430/driver-msp430.cc
+++ b/gcc/config/msp430/driver-msp430.cc
@@ -20,6 +20,7 @@
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/nvptx/mkoffload.cc b/gcc/config/nvptx/mkoffload.cc
index df16ee64736..ddb1c663164 100644
--- a/gcc/config/nvptx/mkoffload.cc
+++ b/gcc/config/nvptx/mkoffload.cc
@@ -29,6 +29,7 @@
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
index 96a1134220e..3ac61b49894 100644
--- a/gcc/config/nvptx/nvptx.cc
+++ b/gcc/config/nvptx/nvptx.cc
@@ -20,6 +20,7 @@
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include
#include "system.h"
diff --git a/gcc/config/riscv/riscv-avlprop.cc b/gcc/config/riscv/riscv-avlprop.cc
index 91d80aa00d6..066377c5c14 100644
--- a/gcc/config/riscv/riscv-avlprop.cc
+++ b/gcc/config/riscv/riscv-avlprop.cc
@@ -65,6 +65,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
#define INCLUDE_ALGORITHM
#define INCLUDE_FUNCTIONAL
+#define INCLUDE_MEMORY
#define INCLUDE_ARRAY
#include "config.h"
diff --git a/gcc/config/riscv/riscv-vector-builtins.cc b/gcc/config/riscv/riscv-vector-builtins.cc
index 41730c483ee..458d9b0886e 100644
--- a/gcc/config/riscv/riscv-vector-builtins.cc
+++ b/gcc/config/riscv/riscv-vector-builtins.cc
@@ -20,6 +20,7 @@
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
index 030ffbe2ebb..0b53b20f9f6 100644
--- a/gcc/config/riscv/riscv-vsetvl.cc
+++ b/gcc/config/riscv/riscv-vsetvl.cc
@@ -63,6 +63,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
#define INCLUDE_ALGORITHM
#define INCLUDE_FUNCTIONAL
+#define INCLUDE_MEMORY
#define INCLUDE_ARRAY
#include "config.h"
diff --git a/gcc/config/rs6000/driver-rs6000.cc b/gcc/config/rs6000/driver-rs6000.cc
index f4900724b98..fd457e72d97 100644
--- a/gcc/config/rs6000/driver-rs6000.cc
+++ b/gcc/config/rs6000/driver-rs6000.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/rs6000/host-darwin.cc b/gcc/config/rs6000/host-darwin.cc
index e0001776339..15c40b16e67 100644
--- a/gcc/config/rs6000/host-darwin.cc
+++ b/gcc/config/rs6000/host-darwin.cc
@@ -19,6 +19,7 @@
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc
index 04882c396bf..5ff346edc2e 100644
--- a/gcc/config/rs6000/rs6000-c.cc
+++ b/gcc/config/rs6000/rs6000-c.cc
@@ -22,6 +22,7 @@
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/s390/s390-c.cc b/gcc/config/s390/s390-c.cc
index 4521a86f048..0332fb4e904 100644
--- a/gcc/config/s390/s390-c.cc
+++ b/gcc/config/s390/s390-c.cc
@@ -29,6 +29,7 @@
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc
index 25d43ae3e13..874b11274a4 100644
--- a/gcc/config/s390/s390.cc
+++ b/gcc/config/s390/s390.cc
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/sol2-cxx.cc b/gcc/config/sol2-cxx.cc
index aa558be585e..4f5fbc60224 100644
--- a/gcc/config/sol2-cxx.cc
+++ b/gcc/config/sol2-cxx.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/vms/vms-c.cc b/gcc/config/vms/vms-c.cc
index d0620b4d7a5..0e9fa2f14d6 100644
--- a/gcc/config/vms/vms-c.cc
+++ b/gcc/config/vms/vms-c.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_TARGET_CODE 1
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/config/xtensa/xtensa-dynconfig.cc b/gcc/config/xtensa/xtensa-dynconfig.cc
index 3bd2760e4d8..6ddc02a6e9b 100644
--- a/gcc/config/xtensa/xtensa-dynconfig.cc
+++ b/gcc/config/xtensa/xtensa-dynconfig.cc
@@ -17,6 +17,7 @@
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/coroutine-passes.cc b/gcc/coroutine-passes.cc
index 0f8e24f8d55..ce74a0278b3 100644
--- a/gcc/coroutine-passes.cc
+++ b/gcc/coroutine-passes.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/coverage.cc b/gcc/coverage.cc
index a964ed5a48f..a9825e53d69 100644
--- a/gcc/coverage.cc
+++ b/gcc/coverage.cc
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#define GCOV_LINKAGE
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/call.cc b/gcc/cp/call.cc
index 309ab01d12d..cc25b48d362 100644
--- a/gcc/cp/call.cc
+++ b/gcc/cp/call.cc
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
/* High-level class interface. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/class.cc b/gcc/cp/class.cc
index 8c39bb4a76b..eed9df7dd95 100644
--- a/gcc/cp/class.cc
+++ b/gcc/cp/class.cc
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
/* High-level class interface. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc
index 4e4df94f420..ad68afef96e 100644
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc
index cf0e5d37571..8a36b9c88c4 100644
--- a/gcc/cp/constraint.cc
+++ b/gcc/cp/constraint.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/contracts.cc b/gcc/cp/contracts.cc
index 4d2849a289a..2a55b87bd03 100644
--- a/gcc/cp/contracts.cc
+++ b/gcc/cp/contracts.cc
@@ -130,6 +130,7 @@ along with GCC; see the file COPYING3. If not see
More helpful for optimization might be to make the contracts a wrapper
function that could be inlined into the caller, the callee, or both. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index 86a5ac8999a..ef64a98972b 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/cp-gimplify.cc b/gcc/cp/cp-gimplify.cc
index 003e68f1ea7..68f651e9605 100644
--- a/gcc/cp/cp-gimplify.cc
+++ b/gcc/cp/cp-gimplify.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/cp-lang.cc b/gcc/cp/cp-lang.cc
index e1e2ab2e396..3959b3194e5 100644
--- a/gcc/cp/cp-lang.cc
+++ b/gcc/cp/cp-lang.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/cp-objcp-common.cc b/gcc/cp/cp-objcp-common.cc
index cd379514991..7a0636f1653 100644
--- a/gcc/cp/cp-objcp-common.cc
+++ b/gcc/cp/cp-objcp-common.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/cp-ubsan.cc b/gcc/cp/cp-ubsan.cc
index c4ae0fe7eea..1055714fa35 100644
--- a/gcc/cp/cp-ubsan.cc
+++ b/gcc/cp/cp-ubsan.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/cvt.cc b/gcc/cp/cvt.cc
index 526937d3618..54e700ceeda 100644
--- a/gcc/cp/cvt.cc
+++ b/gcc/cp/cvt.cc
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
Every language front end must have a `convert' function
but what kind of conversions it does will depend on the language. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/cxx-pretty-print.cc b/gcc/cp/cxx-pretty-print.cc
index 41e6bdfdda5..c0608ac0b26 100644
--- a/gcc/cp/cxx-pretty-print.cc
+++ b/gcc/cp/cxx-pretty-print.cc
@@ -18,12 +18,14 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "cp-tree.h"
#include "cxx-pretty-print.h"
#include "tree-pretty-print.h"
+#include "make-unique.h"
static void pp_cxx_unqualified_id (cxx_pretty_printer *, tree);
static void pp_cxx_nested_name_specifier (cxx_pretty_printer *, tree);
@@ -2927,8 +2929,8 @@ cxx_pretty_printer::cxx_pretty_printer ()
/* cxx_pretty_printer's implementation of pretty_printer::clone vfunc. */
-pretty_printer *
+std::unique_ptr
cxx_pretty_printer::clone () const
{
- return new cxx_pretty_printer (*this);
+ return ::make_unique (*this);
}
diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h
index a4fcf7c7102..f0865cc9d8c 100644
--- a/gcc/cp/cxx-pretty-print.h
+++ b/gcc/cp/cxx-pretty-print.h
@@ -34,7 +34,7 @@ class cxx_pretty_printer : public c_pretty_printer
public:
cxx_pretty_printer ();
- pretty_printer *clone () const override;
+ std::unique_ptr clone () const override;
void constant (tree) final override;
void id_expression (tree) final override;
diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc
index a0c319086d7..a455eb481b1 100644
--- a/gcc/cp/decl2.cc
+++ b/gcc/cp/decl2.cc
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
/* ??? not all decl nodes are given the most useful possible
line numbers. For example, the CONST_DECLs for enum values. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/dump.cc b/gcc/cp/dump.cc
index aafb62ffaa0..8166bbfdee6 100644
--- a/gcc/cp/dump.cc
+++ b/gcc/cp/dump.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/except.cc b/gcc/cp/except.cc
index 7b4abd1f56e..e14a9fd3f9c 100644
--- a/gcc/cp/except.cc
+++ b/gcc/cp/except.cc
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/expr.cc b/gcc/cp/expr.cc
index de4991e616c..e5ec2352f57 100644
--- a/gcc/cp/expr.cc
+++ b/gcc/cp/expr.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/friend.cc b/gcc/cp/friend.cc
index 2e70d0160c4..5261daa4994 100644
--- a/gcc/cp/friend.cc
+++ b/gcc/cp/friend.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/init.cc b/gcc/cp/init.cc
index 10b83efa850..d72964d2b74 100644
--- a/gcc/cp/init.cc
+++ b/gcc/cp/init.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
/* High-level class interface. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/lambda.cc b/gcc/cp/lambda.cc
index d51b513f0fa..1453bc51d92 100644
--- a/gcc/cp/lambda.cc
+++ b/gcc/cp/lambda.cc
@@ -21,6 +21,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/logic.cc b/gcc/cp/logic.cc
index fab2c357dc4..f36abb2d4e4 100644
--- a/gcc/cp/logic.cc
+++ b/gcc/cp/logic.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#define INCLUDE_LIST
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "tm.h"
diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc
index 17988d69e1e..828e3263357 100644
--- a/gcc/cp/mangle.cc
+++ b/gcc/cp/mangle.cc
@@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see
mangle_ctor_vtbl_for_type: `C-in-B' constructor virtual table data
mangle_thunk: thunk function or entry */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/method.cc b/gcc/cp/method.cc
index d704db2af06..adffa9ba0f3 100644
--- a/gcc/cp/method.cc
+++ b/gcc/cp/method.cc
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
/* Handle method declarations. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/optimize.cc b/gcc/cp/optimize.cc
index 8429d856728..f93e0262fa7 100644
--- a/gcc/cp/optimize.cc
+++ b/gcc/cp/optimize.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index b590c32345f..e20038a81ee 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#define INCLUDE_ALGORITHM // for std::equal
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "cp-tree.h"
diff --git a/gcc/cp/ptree.cc b/gcc/cp/ptree.cc
index 15e46752d01..77bffa0b899 100644
--- a/gcc/cp/ptree.cc
+++ b/gcc/cp/ptree.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/rtti.cc b/gcc/cp/rtti.cc
index cc006ea927f..fff89856e6b 100644
--- a/gcc/cp/rtti.cc
+++ b/gcc/cp/rtti.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/search.cc b/gcc/cp/search.cc
index 54eb4f4010f..2f5df8a2d40 100644
--- a/gcc/cp/search.cc
+++ b/gcc/cp/search.cc
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
/* High-level class interface. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc
index dabfb1ff53f..8c1a8b3c68d 100644
--- a/gcc/cp/semantics.cc
+++ b/gcc/cp/semantics.cc
@@ -23,6 +23,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc
index c80ee068958..28c4a7654f4 100644
--- a/gcc/cp/tree.cc
+++ b/gcc/cp/tree.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/typeck.cc b/gcc/cp/typeck.cc
index bfc0c560c10..90da2fa7fa4 100644
--- a/gcc/cp/typeck.cc
+++ b/gcc/cp/typeck.cc
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
including computing the types of the result, C and C++ specific error
checks, and some optimization. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/typeck2.cc b/gcc/cp/typeck2.cc
index 79b397a69fa..9f57020e253 100644
--- a/gcc/cp/typeck2.cc
+++ b/gcc/cp/typeck2.cc
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
including computing the types of the result, C and C++ specific error
checks, and some optimization. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/cp/vtable-class-hierarchy.cc b/gcc/cp/vtable-class-hierarchy.cc
index afe1e96f5e2..7e4f613c205 100644
--- a/gcc/cp/vtable-class-hierarchy.cc
+++ b/gcc/cp/vtable-class-hierarchy.cc
@@ -110,6 +110,7 @@ along with GCC; see the file COPYING3. If not see
gcc/vtable-verify.h, because they are used both here and in
gcc/vtable-verify.cc. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/d-attribs.cc b/gcc/d/d-attribs.cc
index 0f7ca10e017..873140ee7c8 100644
--- a/gcc/d/d-attribs.cc
+++ b/gcc/d/d-attribs.cc
@@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see
/* Implementation of attribute handlers for user defined attributes and
internal built-in functions. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/d-builtins.cc b/gcc/d/d-builtins.cc
index 4546c0e9b56..2ca02fe691c 100644
--- a/gcc/d/d-builtins.cc
+++ b/gcc/d/d-builtins.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc
index 2b3089b5f6d..eeeb48defa2 100644
--- a/gcc/d/d-codegen.cc
+++ b/gcc/d/d-codegen.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/d-convert.cc b/gcc/d/d-convert.cc
index 5c79cdf6e1e..a07c7d8ba68 100644
--- a/gcc/d/d-convert.cc
+++ b/gcc/d/d-convert.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/d-diagnostic.cc b/gcc/d/d-diagnostic.cc
index 373075ca54d..d584d2ac2b2 100644
--- a/gcc/d/d-diagnostic.cc
+++ b/gcc/d/d-diagnostic.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/d-frontend.cc b/gcc/d/d-frontend.cc
index 0d7f4a3ec7f..c3e5d8594ad 100644
--- a/gcc/d/d-frontend.cc
+++ b/gcc/d/d-frontend.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc
index 89ffa7e61ea..2aa2a3f9767 100644
--- a/gcc/d/d-lang.cc
+++ b/gcc/d/d-lang.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/d-longdouble.cc b/gcc/d/d-longdouble.cc
index e4c8c5e6eb0..ba10a356909 100644
--- a/gcc/d/d-longdouble.cc
+++ b/gcc/d/d-longdouble.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/d-target.cc b/gcc/d/d-target.cc
index dd46e535891..17cae450623 100644
--- a/gcc/d/d-target.cc
+++ b/gcc/d/d-target.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/decl.cc b/gcc/d/decl.cc
index 0a87c85ae2e..0afaa71664d 100644
--- a/gcc/d/decl.cc
+++ b/gcc/d/decl.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc
index d055e0b4025..a690f2ef2cf 100644
--- a/gcc/d/expr.cc
+++ b/gcc/d/expr.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/intrinsics.cc b/gcc/d/intrinsics.cc
index c895c1a1a52..34143b343e8 100644
--- a/gcc/d/intrinsics.cc
+++ b/gcc/d/intrinsics.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/modules.cc b/gcc/d/modules.cc
index b111ee90cea..f9b4a1e8e41 100644
--- a/gcc/d/modules.cc
+++ b/gcc/d/modules.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/toir.cc b/gcc/d/toir.cc
index a6848f2ffa2..2bbba1035c7 100644
--- a/gcc/d/toir.cc
+++ b/gcc/d/toir.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/typeinfo.cc b/gcc/d/typeinfo.cc
index cadcbe8164e..56aaf29d54e 100644
--- a/gcc/d/typeinfo.cc
+++ b/gcc/d/typeinfo.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/d/types.cc b/gcc/d/types.cc
index 9fa2f888cb2..2f78c917de2 100644
--- a/gcc/d/types.cc
+++ b/gcc/d/types.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/data-streamer-in.cc b/gcc/data-streamer-in.cc
index 07dbc5e2bc3..64dec35296c 100644
--- a/gcc/data-streamer-in.cc
+++ b/gcc/data-streamer-in.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/data-streamer-out.cc b/gcc/data-streamer-out.cc
index c237e30f704..95715436cdc 100644
--- a/gcc/data-streamer-out.cc
+++ b/gcc/data-streamer-out.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/data-streamer.cc b/gcc/data-streamer.cc
index 896413e8d2b..1caf72f9e96 100644
--- a/gcc/data-streamer.cc
+++ b/gcc/data-streamer.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/diagnostic-buffer.h b/gcc/diagnostic-buffer.h
index 07acd044920..deb933a8763 100644
--- a/gcc/diagnostic-buffer.h
+++ b/gcc/diagnostic-buffer.h
@@ -59,7 +59,6 @@ class diagnostic_buffer
friend class diagnostic_context;
diagnostic_buffer (diagnostic_context &ctxt);
- ~diagnostic_buffer ();
void dump (FILE *out, int indent) const;
void DEBUG_FUNCTION dump () const { dump (stderr, 0); }
@@ -77,7 +76,7 @@ class diagnostic_buffer
void ensure_per_format_buffer ();
diagnostic_context &m_ctxt;
- diagnostic_per_format_buffer *m_per_format_buffer;
+ std::unique_ptr m_per_format_buffer;
/* The number of buffered diagnostics of each kind. */
diagnostic_counters m_diagnostic_counters;
diff --git a/gcc/diagnostic-client-data-hooks.h b/gcc/diagnostic-client-data-hooks.h
index a67a3dbff47..9e2bd606378 100644
--- a/gcc/diagnostic-client-data-hooks.h
+++ b/gcc/diagnostic-client-data-hooks.h
@@ -53,7 +53,7 @@ class diagnostic_client_data_hooks
for use in the compiler (i.e. with knowledge of "tree", access to
langhooks, etc). */
-extern diagnostic_client_data_hooks *make_compiler_data_hooks ();
+extern std::unique_ptr make_compiler_data_hooks ();
class diagnostic_client_plugin_info;
diff --git a/gcc/diagnostic-format-json.cc b/gcc/diagnostic-format-json.cc
index 022e3a9ae7d..7b89ee81d70 100644
--- a/gcc/diagnostic-format-json.cc
+++ b/gcc/diagnostic-format-json.cc
@@ -72,9 +72,10 @@ public:
diagnostic_output_format::dump (out, indent);
}
- diagnostic_per_format_buffer *make_per_format_buffer () final override
+ std::unique_ptr
+ make_per_format_buffer () final override
{
- return new diagnostic_json_format_buffer (*this);
+ return ::make_unique (*this);
}
void set_buffer (diagnostic_per_format_buffer *base_buffer) final override
{
@@ -505,7 +506,7 @@ diagnostic_output_format_init_json (diagnostic_context &context,
pp_show_color (fmt->get_printer ()) = false;
context.set_show_highlight_colors (false);
- context.set_output_format (fmt.release ());
+ context.set_output_format (std::move (fmt));
}
/* Populate CONTEXT in preparation for JSON output to stderr. */
diff --git a/gcc/diagnostic-format-sarif.cc b/gcc/diagnostic-format-sarif.cc
index 4ce35619000..a5c6ce29085 100644
--- a/gcc/diagnostic-format-sarif.cc
+++ b/gcc/diagnostic-format-sarif.cc
@@ -3409,9 +3409,10 @@ public:
diagnostic_output_format::dump (out, indent);
}
- diagnostic_per_format_buffer *make_per_format_buffer () final override
+ std::unique_ptr
+ make_per_format_buffer () final override
{
- return new diagnostic_sarif_format_buffer (m_builder);
+ return ::make_unique (m_builder);
}
void set_buffer (diagnostic_per_format_buffer *base_buffer) final override
{
@@ -3657,7 +3658,7 @@ diagnostic_output_format_init_sarif (diagnostic_context &context,
context.m_printer->set_token_printer
(&fmt->get_builder ().get_token_printer ());
- context.set_output_format (fmt.release ());
+ context.set_output_format (std::move (fmt));
}
/* Populate CONTEXT in preparation for SARIF output to stderr. */
@@ -4255,7 +4256,7 @@ test_message_with_embedded_link (enum sarif_version version)
};
test_sarif_diagnostic_context dc ("test.c", version);
- dc.set_urlifier (new test_urlifier ());
+ dc.set_urlifier (::make_unique ());
rich_location richloc (line_table, UNKNOWN_LOCATION);
dc.report (DK_ERROR, richloc, nullptr, 0,
"foo %<-foption%> % bar");
diff --git a/gcc/diagnostic-format-text.cc b/gcc/diagnostic-format-text.cc
index 03f5518d620..c23ac6c505d 100644
--- a/gcc/diagnostic-format-text.cc
+++ b/gcc/diagnostic-format-text.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
+#define INCLUDE_MEMORY
#define INCLUDE_VECTOR
#include "system.h"
#include "coretypes.h"
@@ -34,6 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-format-text.h"
#include "diagnostic-buffer.h"
#include "text-art/theme.h"
+#include "make-unique.h"
/* Disable warnings about quoting issues in the pp_xxx calls below
that (intentionally) don't follow GCC diagnostic conventions. */
@@ -186,10 +188,10 @@ diagnostic_text_output_format::set_buffer (diagnostic_per_format_buffer *base)
}
}
-diagnostic_per_format_buffer *
+std::unique_ptr
diagnostic_text_output_format::make_per_format_buffer ()
{
- return new diagnostic_text_format_buffer (*this);
+ return ::make_unique (*this);
}
/* Implementation of diagnostic_output_format::on_report_diagnostic vfunc
diff --git a/gcc/diagnostic-format-text.h b/gcc/diagnostic-format-text.h
index 12a65bf6ee8..b43501eaa4a 100644
--- a/gcc/diagnostic-format-text.h
+++ b/gcc/diagnostic-format-text.h
@@ -43,7 +43,8 @@ public:
void dump (FILE *out, int indent) const override;
- diagnostic_per_format_buffer *make_per_format_buffer () final override;
+ std::unique_ptr
+ make_per_format_buffer () final override;
void set_buffer (diagnostic_per_format_buffer *) final override;
void on_begin_group () override {}
diff --git a/gcc/diagnostic-format.h b/gcc/diagnostic-format.h
index e2ae155eec1..a38d177ce8d 100644
--- a/gcc/diagnostic-format.h
+++ b/gcc/diagnostic-format.h
@@ -38,7 +38,8 @@ public:
/* Vfunc for making an appropriate diagnostic_per_format_buffer
subclass for this format. */
- virtual diagnostic_per_format_buffer *make_per_format_buffer () = 0;
+ virtual std::unique_ptr
+ make_per_format_buffer () = 0;
/* Vfunc to be called when call a diagnostic_buffer is set on
a diagnostic_context, to update this format. The per_format_buffer
diff --git a/gcc/diagnostic-global-context.cc b/gcc/diagnostic-global-context.cc
index 9e151905a6b..e82588e5404 100644
--- a/gcc/diagnostic-global-context.cc
+++ b/gcc/diagnostic-global-context.cc
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
/* This file implements the parts of the language independent aspect
of diagnostic messages that implicitly use global_dc. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/diagnostic-macro-unwinding.cc b/gcc/diagnostic-macro-unwinding.cc
index a9838ffb52c..38f827f6638 100644
--- a/gcc/diagnostic-macro-unwinding.cc
+++ b/gcc/diagnostic-macro-unwinding.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/diagnostic-show-locus.cc b/gcc/diagnostic-show-locus.cc
index 415de42cbc7..79499dc549d 100644
--- a/gcc/diagnostic-show-locus.cc
+++ b/gcc/diagnostic-show-locus.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
. */
#include "config.h"
+#define INCLUDE_MEMORY
#define INCLUDE_VECTOR
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/diagnostic-spec.cc b/gcc/diagnostic-spec.cc
index addaf089f03..77e4b67dc88 100644
--- a/gcc/diagnostic-spec.cc
+++ b/gcc/diagnostic-spec.cc
@@ -19,6 +19,7 @@
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc
index 71230089657..f1cef0b01a8 100644
--- a/gcc/diagnostic.cc
+++ b/gcc/diagnostic.cc
@@ -454,19 +454,21 @@ diagnostic_context::execution_failed_p () const
}
void
-diagnostic_context::set_output_format (diagnostic_output_format *output_format)
+diagnostic_context::
+set_output_format (std::unique_ptr output_format)
{
- /* Ideally we'd use a std::unique_ptr here. */
delete m_output_format;
- m_output_format = output_format;
+ /* Ideally this field would be a std::unique_ptr. */
+ m_output_format = output_format.release ();
}
void
-diagnostic_context::set_client_data_hooks (diagnostic_client_data_hooks *hooks)
+diagnostic_context::
+set_client_data_hooks (std::unique_ptr hooks)
{
- /* Ideally we'd use a std::unique_ptr here. */
delete m_client_data_hooks;
- m_client_data_hooks = hooks;
+ /* Ideally the field would be a std::unique_ptr here. */
+ m_client_data_hooks = hooks.release ();
}
void
@@ -483,20 +485,21 @@ diagnostic_context::set_original_argv (unique_argv original_argv)
}
void
-diagnostic_context::set_option_manager (diagnostic_option_manager *mgr,
- unsigned lang_mask)
+diagnostic_context::
+set_option_manager (std::unique_ptr mgr,
+ unsigned lang_mask)
{
delete m_option_mgr;
- m_option_mgr = mgr;
+ m_option_mgr = mgr.release ();
m_lang_mask = lang_mask;
}
void
-diagnostic_context::set_urlifier (urlifier *urlifier)
+diagnostic_context::set_urlifier (std::unique_ptr urlifier)
{
- /* Ideally we'd use a std::unique_ptr here. */
delete m_urlifier;
- m_urlifier = urlifier;
+ /* Ideally the field would be a std::unique_ptr here. */
+ m_urlifier = urlifier.release ();
}
void
@@ -1715,7 +1718,7 @@ diagnostic_context::set_diagnostic_buffer (diagnostic_buffer *buffer)
{
buffer->ensure_per_format_buffer ();
gcc_assert (buffer->m_per_format_buffer);
- m_output_format->set_buffer (buffer->m_per_format_buffer);
+ m_output_format->set_buffer (buffer->m_per_format_buffer.get ());
}
else
m_output_format->set_buffer (nullptr);
@@ -1793,16 +1796,10 @@ diagnostic_counters::clear ()
/* class diagnostic_buffer. */
diagnostic_buffer::diagnostic_buffer (diagnostic_context &ctxt)
-: m_ctxt (ctxt),
- m_per_format_buffer (nullptr)
+: m_ctxt (ctxt)
{
}
-diagnostic_buffer::~diagnostic_buffer ()
-{
- delete m_per_format_buffer;
-}
-
void
diagnostic_buffer::dump (FILE *out, int indent) const
{
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index f1f475540de..3da1ae9c801 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -21,6 +21,14 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_DIAGNOSTIC_H
#define GCC_DIAGNOSTIC_H
+/* This header uses std::unique_ptr, but can't be directly
+ included due to issues with macros. Hence it must be included from
+ system.h by defining INCLUDE_MEMORY in any source file using it. */
+
+#ifndef INCLUDE_MEMORY
+# error "You must define INCLUDE_MEMORY before including system.h to use diagnostic.h"
+#endif
+
#include "unique-argv.h"
#include "rich-location.h"
#include "pretty-print.h"
@@ -574,10 +582,10 @@ public:
}
/* Various setters for use by option-handling logic. */
- void set_output_format (diagnostic_output_format *output_format);
+ void set_output_format (std::unique_ptr output_format);
void set_text_art_charset (enum diagnostic_text_art_charset charset);
- void set_client_data_hooks (diagnostic_client_data_hooks *hooks);
- void set_urlifier (urlifier *);
+ void set_client_data_hooks (std::unique_ptr hooks);
+ void set_urlifier (std::unique_ptr);
void create_edit_context ();
void set_warning_as_error_requested (bool val)
{
@@ -672,7 +680,7 @@ public:
}
void
- set_option_manager (diagnostic_option_manager *mgr,
+ set_option_manager (std::unique_ptr mgr,
unsigned lang_mask);
unsigned get_lang_mask () const
@@ -700,6 +708,7 @@ public:
return m_option_classifier.pch_restore (f);
}
+
void set_diagnostic_buffer (diagnostic_buffer *);
diagnostic_buffer *get_diagnostic_buffer () const
{
@@ -708,6 +717,11 @@ public:
void clear_diagnostic_buffer (diagnostic_buffer &);
void flush_diagnostic_buffer (diagnostic_buffer &);
+ std::unique_ptr clone_printer () const
+ {
+ return m_printer->clone ();
+ }
+
private:
void error_recursion () ATTRIBUTE_NORETURN;
@@ -722,11 +736,15 @@ private:
Ideally, all of these would be private. */
public:
- /* Where most of the diagnostic formatting work is done. */
+ /* Where most of the diagnostic formatting work is done.
+ Owned by the context; this would be a std::unique_ptr if
+ diagnostic_context had a proper ctor. */
pretty_printer *m_printer;
private:
- /* Cache of source code. */
+ /* Cache of source code.
+ Owned by the context; this would be a std::unique_ptr if
+ diagnostic_context had a proper ctor. */
file_cache *m_file_cache;
/* The number of times we have issued diagnostics. */
@@ -818,11 +836,15 @@ public:
void (*m_adjust_diagnostic_info)(diagnostic_context *, diagnostic_info *);
private:
+ /* Owned by the context; this would be a std::unique_ptr if
+ diagnostic_context had a proper ctor. */
diagnostic_option_manager *m_option_mgr;
unsigned m_lang_mask;
/* An optional hook for adding URLs to quoted text strings in
- diagnostics. Only used for the main diagnostic message. */
+ diagnostics. Only used for the main diagnostic message.
+ Owned by the context; this would be a std::unique_ptr if
+ diagnostic_context had a proper ctor. */
urlifier *m_urlifier;
public:
@@ -865,7 +887,9 @@ private:
enum diagnostics_escape_format m_escape_format;
/* If non-NULL, an edit_context to which fix-it hints should be
- applied, for generating patches. */
+ applied, for generating patches.
+ Owned by the context; this would be a std::unique_ptr if
+ diagnostic_context had a proper ctor. */
edit_context *m_edit_context_ptr;
/* Fields relating to diagnostic groups. */
@@ -879,7 +903,9 @@ private:
} m_diagnostic_groups;
/* How to output diagnostics (text vs a structured format such as JSON).
- Must be non-NULL; owned by context. */
+ Must be non-NULL; owned by context.
+ This would be a std::unique_ptr if diagnostic_context had a proper
+ ctor. */
diagnostic_output_format *m_output_format;
/* Callback to set the locations of call sites along the inlining
@@ -891,14 +917,18 @@ private:
/* A bundle of hooks for providing data to the context about its client
e.g. version information, plugins, etc.
Used by SARIF output to give metadata about the client that's
- producing diagnostics. */
+ producing diagnostics.
+ Owned by the context; this would be a std::unique_ptr if
+ diagnostic_context had a proper ctor. */
diagnostic_client_data_hooks *m_client_data_hooks;
/* Support for diagrams. */
struct
{
/* Theme to use when generating diagrams.
- Can be NULL (if text art is disabled). */
+ Can be NULL (if text art is disabled).
+ Owned by the context; this would be a std::unique_ptr if
+ diagnostic_context had a proper ctor. */
text_art::theme *m_theme;
} m_diagrams;
diff --git a/gcc/digraph.cc b/gcc/digraph.cc
index b323764a93c..7b2726d24fe 100644
--- a/gcc/digraph.cc
+++ b/gcc/digraph.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index 38aedb64470..fc23e4ba460 100644
--- a/gcc/dwarf2out.cc
+++ b/gcc/dwarf2out.cc
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
DW_CFA_... = DWARF2 CFA call frame instruction
DW_TAG_... = DWARF2 DIE tag */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/edit-context.cc b/gcc/edit-context.cc
index 37ac4989de0..f51ebf0e515 100644
--- a/gcc/edit-context.cc
+++ b/gcc/edit-context.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/except.cc b/gcc/except.cc
index 5bb5edbd806..4bec795010b 100644
--- a/gcc/except.cc
+++ b/gcc/except.cc
@@ -109,6 +109,7 @@ along with GCC; see the file COPYING3. If not see
output_call_frame_info (dwarf2out.cc) emits the required unwind data. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/expr.cc b/gcc/expr.cc
index 87f9e002c07..51a7e5a60d3 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/file-prefix-map.cc b/gcc/file-prefix-map.cc
index 6b432e2a15a..6841559c5ed 100644
--- a/gcc/file-prefix-map.cc
+++ b/gcc/file-prefix-map.cc
@@ -15,6 +15,7 @@
along with this program; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/final.cc b/gcc/final.cc
index 5d911586de5..11141f2b56c 100644
--- a/gcc/final.cc
+++ b/gcc/final.cc
@@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#define INCLUDE_ALGORITHM /* reverse */
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "backend.h"
diff --git a/gcc/fortran/arith.cc b/gcc/fortran/arith.cc
index a214b8bc1b3..3ecbbd30cfa 100644
--- a/gcc/fortran/arith.cc
+++ b/gcc/fortran/arith.cc
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
would evaluate them. We use the GNU MP library and the MPFR
library to do arithmetic, and this file provides the interface. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/array.cc b/gcc/fortran/array.cc
index 6dedaed3d4d..e650d85eb8c 100644
--- a/gcc/fortran/array.cc
+++ b/gcc/fortran/array.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/bbt.cc b/gcc/fortran/bbt.cc
index f564ce104e8..556baeec71d 100644
--- a/gcc/fortran/bbt.cc
+++ b/gcc/fortran/bbt.cc
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see
This implementation is based on Stefan Nilsson's article in the
July 1997 Doctor Dobb's Journal, "Treaps in Java". */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/check.cc b/gcc/fortran/check.cc
index e90073ad4b0..304ca1b9ae8 100644
--- a/gcc/fortran/check.cc
+++ b/gcc/fortran/check.cc
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
has been sorted into the right order and has NULL arguments in the
correct places for missing optional arguments. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/class.cc b/gcc/fortran/class.cc
index f9e0d416e48..4b2234a958f 100644
--- a/gcc/fortran/class.cc
+++ b/gcc/fortran/class.cc
@@ -56,6 +56,7 @@ along with GCC; see the file COPYING3. If not see
type-bound procedures. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/constructor.cc b/gcc/fortran/constructor.cc
index 942e2639732..8a4e11d8686 100644
--- a/gcc/fortran/constructor.cc
+++ b/gcc/fortran/constructor.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/convert.cc b/gcc/fortran/convert.cc
index 674e3f425e8..187bda64063 100644
--- a/gcc/fortran/convert.cc
+++ b/gcc/fortran/convert.cc
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
different data types for the translation of the gfortran internal
representation to GIMPLE. The only entry point is `convert'. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/cpp.cc b/gcc/fortran/cpp.cc
index 7c5f00cfd69..9d662ac5ab2 100644
--- a/gcc/fortran/cpp.cc
+++ b/gcc/fortran/cpp.cc
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/data.cc b/gcc/fortran/data.cc
index e7202455b3e..3aa869be1aa 100644
--- a/gcc/fortran/data.cc
+++ b/gcc/fortran/data.cc
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
etc., to convert the initial value. Refer to trans-expr.cc and
trans-array.cc. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc
index 151578954dc..499a8462629 100644
--- a/gcc/fortran/decl.cc
+++ b/gcc/fortran/decl.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/dependency.cc b/gcc/fortran/dependency.cc
index 15edf1af9df..2d3db9541bb 100644
--- a/gcc/fortran/dependency.cc
+++ b/gcc/fortran/dependency.cc
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
have different dependency checking functions for different types
if dependencies. Ideally these would probably be merged. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc
index bc8a95a809b..ea5d2ab66a6 100644
--- a/gcc/fortran/dump-parse-tree.cc
+++ b/gcc/fortran/dump-parse-tree.cc
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
TODO: Dump DATA. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/error.cc b/gcc/fortran/error.cc
index 64e1ce5d247..b1eda94ccb6 100644
--- a/gcc/fortran/error.cc
+++ b/gcc/fortran/error.cc
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
for possible use later. If a line does not match a legal
construction, then the saved error message is reported. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc
index b3e0bf1fd91..01fbc442546 100644
--- a/gcc/fortran/expr.cc
+++ b/gcc/fortran/expr.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/f95-lang.cc b/gcc/fortran/f95-lang.cc
index 770f31b221d..611c299b654 100644
--- a/gcc/fortran/f95-lang.cc
+++ b/gcc/fortran/f95-lang.cc
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
/* declare required prototypes: */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/frontend-passes.cc b/gcc/fortran/frontend-passes.cc
index 405074ecb02..3a36b1ddf73 100644
--- a/gcc/fortran/frontend-passes.cc
+++ b/gcc/fortran/frontend-passes.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/interface.cc b/gcc/fortran/interface.cc
index dbcbed8bf30..69519fe3168 100644
--- a/gcc/fortran/interface.cc
+++ b/gcc/fortran/interface.cc
@@ -63,6 +63,7 @@ along with GCC; see the file COPYING3. If not see
formal argument list points to symbols within the same namespace as
the program unit name. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/intrinsic.cc b/gcc/fortran/intrinsic.cc
index 114f1b6c045..83b65d34e43 100644
--- a/gcc/fortran/intrinsic.cc
+++ b/gcc/fortran/intrinsic.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/io.cc b/gcc/fortran/io.cc
index ac4e5c56f45..5e1785e2dbd 100644
--- a/gcc/fortran/io.cc
+++ b/gcc/fortran/io.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/iresolve.cc b/gcc/fortran/iresolve.cc
index 9fb22128492..d8b216bcc67 100644
--- a/gcc/fortran/iresolve.cc
+++ b/gcc/fortran/iresolve.cc
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
code node is passed. The result type and library subroutine name
are generally set according to the function arguments. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc
index 2b3ed4f4cf5..6e9da8c3e68 100644
--- a/gcc/fortran/match.cc
+++ b/gcc/fortran/match.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/matchexp.cc b/gcc/fortran/matchexp.cc
index 9e773cf8fee..f7185d5aa4f 100644
--- a/gcc/fortran/matchexp.cc
+++ b/gcc/fortran/matchexp.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/misc.cc b/gcc/fortran/misc.cc
index 991829516ef..0ef6679fee9 100644
--- a/gcc/fortran/misc.cc
+++ b/gcc/fortran/misc.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/module.cc b/gcc/fortran/module.cc
index 880aef2c7a8..9ab4d2bf1ea 100644
--- a/gcc/fortran/module.cc
+++ b/gcc/fortran/module.cc
@@ -64,6 +64,7 @@ along with GCC; see the file COPYING3. If not see
which are zero based. Symbols are written to the module in no
particular order. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc
index 7aa0d597444..aaede547d00 100644
--- a/gcc/fortran/openmp.cc
+++ b/gcc/fortran/openmp.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#define INCLUDE_VECTOR
#define INCLUDE_STRING
#include "config.h"
diff --git a/gcc/fortran/options.cc b/gcc/fortran/options.cc
index 0004df9278b..c531b898647 100644
--- a/gcc/fortran/options.cc
+++ b/gcc/fortran/options.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/parse.cc b/gcc/fortran/parse.cc
index d2fe22d0edc..9d7d43aa5da 100644
--- a/gcc/fortran/parse.cc
+++ b/gcc/fortran/parse.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/primary.cc b/gcc/fortran/primary.cc
index e57f631eff4..f3f659cf8df 100644
--- a/gcc/fortran/primary.cc
+++ b/gcc/fortran/primary.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index c96523e4ad5..565d4aa5fe9 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/scanner.cc b/gcc/fortran/scanner.cc
index 09d7d8c5e39..7e3237cdd55 100644
--- a/gcc/fortran/scanner.cc
+++ b/gcc/fortran/scanner.cc
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see
From the scanner's viewpoint, the higher level subroutines ask for
new characters and do a lot of jumping backwards. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/simplify.cc b/gcc/fortran/simplify.cc
index 2f6c3c39dad..1e2fa3eb8ea 100644
--- a/gcc/fortran/simplify.cc
+++ b/gcc/fortran/simplify.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/st.cc b/gcc/fortran/st.cc
index 48e4258d10d..2ce61450c0d 100644
--- a/gcc/fortran/st.cc
+++ b/gcc/fortran/st.cc
@@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see
GENERIC tree structures and from there to executable code for a
target. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/symbol.cc b/gcc/fortran/symbol.cc
index e803cdd93c9..5e83fb400e3 100644
--- a/gcc/fortran/symbol.cc
+++ b/gcc/fortran/symbol.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/target-memory.cc b/gcc/fortran/target-memory.cc
index c71c4032090..235ecc49e39 100644
--- a/gcc/fortran/target-memory.cc
+++ b/gcc/fortran/target-memory.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index ec7728cb11a..a52bde90bd2 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -75,6 +75,7 @@ along with GCC; see the file COPYING3. If not see
After the loop code has been added into its parent scope gfc_cleanup_loop
is called to free all the SS allocated by the scalarizer. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/trans-common.cc b/gcc/fortran/trans-common.cc
index 49b0c3de471..7c3681a9308 100644
--- a/gcc/fortran/trans-common.cc
+++ b/gcc/fortran/trans-common.cc
@@ -94,6 +94,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#define INCLUDE_MAP
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "tm.h"
diff --git a/gcc/fortran/trans-const.cc b/gcc/fortran/trans-const.cc
index 204f4df301c..9c2d683b1a1 100644
--- a/gcc/fortran/trans-const.cc
+++ b/gcc/fortran/trans-const.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
/* trans-const.cc -- convert constant values */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc
index a62fe3f0441..a2c15959551 100644
--- a/gcc/fortran/trans-decl.cc
+++ b/gcc/fortran/trans-decl.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
/* trans-decl.cc -- Handling of backend function and variable decls, etc */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index 16feff49527..663d762df88 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
/* trans-expr.cc-- generate GENERIC trees for gfc_expr. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/trans-intrinsic.cc b/gcc/fortran/trans-intrinsic.cc
index 80d75f26b09..20ccbb123c6 100644
--- a/gcc/fortran/trans-intrinsic.cc
+++ b/gcc/fortran/trans-intrinsic.cc
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
/* trans-intrinsic.cc-- generate GENERIC trees for calls to intrinsics. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/trans-io.cc b/gcc/fortran/trans-io.cc
index 961a711c530..41396a3fe4c 100644
--- a/gcc/fortran/trans-io.cc
+++ b/gcc/fortran/trans-io.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc
index 5f7e29c2c64..279090f1c55 100644
--- a/gcc/fortran/trans-openmp.cc
+++ b/gcc/fortran/trans-openmp.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/trans-stmt.cc b/gcc/fortran/trans-stmt.cc
index e1a84f22828..520ab505659 100644
--- a/gcc/fortran/trans-stmt.cc
+++ b/gcc/fortran/trans-stmt.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc
index e596a362c02..2170869206e 100644
--- a/gcc/fortran/trans-types.cc
+++ b/gcc/fortran/trans-types.cc
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
/* trans-types.cc -- gfortran backend types */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/trans.cc b/gcc/fortran/trans.cc
index 7182fa05598..58b93e233a1 100644
--- a/gcc/fortran/trans.cc
+++ b/gcc/fortran/trans.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fwprop.cc b/gcc/fwprop.cc
index 2ebb2f146cc..8cba6b7ce9f 100644
--- a/gcc/fwprop.cc
+++ b/gcc/fwprop.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
#define INCLUDE_ALGORITHM
#define INCLUDE_FUNCTIONAL
+#define INCLUDE_MEMORY
#define INCLUDE_ARRAY
#include "config.h"
#include "system.h"
diff --git a/gcc/gcc-plugin.h b/gcc/gcc-plugin.h
index 8eb33d6a8f5..683fc3ece3a 100644
--- a/gcc/gcc-plugin.h
+++ b/gcc/gcc-plugin.h
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#define IN_GCC
#endif
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gcc-rich-location.cc b/gcc/gcc-rich-location.cc
index 568744b39a3..0fa9db8e66d 100644
--- a/gcc/gcc-rich-location.cc
+++ b/gcc/gcc-rich-location.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gcc-urlifier.cc b/gcc/gcc-urlifier.cc
index be6459e8d7c..0db5429395e 100644
--- a/gcc/gcc-urlifier.cc
+++ b/gcc/gcc-urlifier.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -27,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "opts.h"
#include "options.h"
#include "selftest.h"
+#include "make-unique.h"
namespace {
@@ -213,10 +215,10 @@ gcc_urlifier::make_doc_url (const char *doc_url_suffix)
} // anonymous namespace
-urlifier *
+std::unique_ptr
make_gcc_urlifier (unsigned int lang_mask)
{
- return new gcc_urlifier (lang_mask);
+ return ::make_unique (lang_mask);
}
#if CHECKING_P
diff --git a/gcc/gcc-urlifier.h b/gcc/gcc-urlifier.h
index 660d4f8828e..c4cd03cc34a 100644
--- a/gcc/gcc-urlifier.h
+++ b/gcc/gcc-urlifier.h
@@ -21,6 +21,6 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_GCC_URLIFIER_H
#define GCC_GCC_URLIFIER_H
-extern urlifier *make_gcc_urlifier (unsigned int lang_mask);
+extern std::unique_ptr make_gcc_urlifier (unsigned int lang_mask);
#endif /* GCC_GCC_URLIFIER_H */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 16fed46fb35..9998fd33343 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -27,6 +27,7 @@ CC recognizes how to compile each input file by suffixes in the file names.
Once it knows which kind of compilation to perform, the procedure for
compilation is specified by a string called a "spec". */
+#define INCLUDE_MEMORY
#define INCLUDE_STRING
#include "config.h"
#include "system.h"
@@ -41,6 +42,7 @@ compilation is specified by a string called a "spec". */
#include "gcc.h"
#include "diagnostic.h"
#include "diagnostic-format.h"
+#include "pretty-print-urlifier.h"
#include "flags.h"
#include "opts.h"
#include "filenames.h"
diff --git a/gcc/gcov-dump.cc b/gcc/gcov-dump.cc
index 731172f39ee..a511e37205c 100644
--- a/gcc/gcov-dump.cc
+++ b/gcc/gcov-dump.cc
@@ -17,6 +17,7 @@ along with Gcov; see the file COPYING3. If not see
. */
#include "config.h"
+#define INCLUDE_MEMORY
#define INCLUDE_VECTOR
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gcov-tool.cc b/gcc/gcov-tool.cc
index 100f7357bcf..0f3c5c75110 100644
--- a/gcc/gcov-tool.cc
+++ b/gcc/gcov-tool.cc
@@ -23,6 +23,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gengtype.cc b/gcc/gengtype.cc
index c0ecbe8558b..4cd0974966d 100644
--- a/gcc/gengtype.cc
+++ b/gcc/gengtype.cc
@@ -1724,6 +1724,7 @@ open_base_files (void)
outf_p gtype_desc_c;
gtype_desc_c = create_file ("GCC", "gtype-desc.cc");
+ oprintf (gtype_desc_c, "#define INCLUDE_MEMORY\n");
for (ifp = ifiles; *ifp; ifp++)
oprintf (gtype_desc_c, "#include \"%s\"\n", *ifp);
for (int j = 0; j < (int) num_build_headers; j++)
diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc
index 6287d6a7bc2..317d02a2a4f 100644
--- a/gcc/genmatch.cc
+++ b/gcc/genmatch.cc
@@ -21,6 +21,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "bconfig.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc
index d4ec7475990..00913bbbb11 100644
--- a/gcc/gimple-fold.cc
+++ b/gcc/gimple-fold.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-harden-conditionals.cc b/gcc/gimple-harden-conditionals.cc
index 4ab086e1ab0..7bfa75a5bd6 100644
--- a/gcc/gimple-harden-conditionals.cc
+++ b/gcc/gimple-harden-conditionals.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc
index 70383e6e265..f5654c3bb9f 100644
--- a/gcc/gimple-harden-control-flow.cc
+++ b/gcc/gimple-harden-control-flow.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#define INCLUDE_ALGORITHM /* find */
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "backend.h"
diff --git a/gcc/gimple-if-to-switch.cc b/gcc/gimple-if-to-switch.cc
index 96ce1c380a5..4246e12606f 100644
--- a/gcc/gimple-if-to-switch.cc
+++ b/gcc/gimple-if-to-switch.cc
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
d) We move all GIMPLE statements in the removed blocks into the
first one. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-lower-bitint.cc b/gcc/gimple-lower-bitint.cc
index 58deaf253e9..1d1e300643c 100644
--- a/gcc/gimple-lower-bitint.cc
+++ b/gcc/gimple-lower-bitint.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-predicate-analysis.cc b/gcc/gimple-predicate-analysis.cc
index 01688b8581b..6b9043cc2dd 100644
--- a/gcc/gimple-predicate-analysis.cc
+++ b/gcc/gimple-predicate-analysis.cc
@@ -20,6 +20,7 @@
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#define INCLUDE_STRING
#include "config.h"
#include "system.h"
diff --git a/gcc/gimple-pretty-print.cc b/gcc/gimple-pretty-print.cc
index 01d7c9f6eeb..30da3af36bd 100644
--- a/gcc/gimple-pretty-print.cc
+++ b/gcc/gimple-pretty-print.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc
index 035076be5d8..4210841645c 100644
--- a/gcc/gimple-range-cache.cc
+++ b/gcc/gimple-range-cache.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-range-edge.cc b/gcc/gimple-range-edge.cc
index 0c75ad0519c..6e082ffc9e8 100644
--- a/gcc/gimple-range-edge.cc
+++ b/gcc/gimple-range-edge.cc
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc
index dcd0cae0351..82dd363f2ec 100644
--- a/gcc/gimple-range-fold.cc
+++ b/gcc/gimple-range-fold.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc
index f2e2b5049aa..f5103fd0e98 100644
--- a/gcc/gimple-range-gori.cc
+++ b/gcc/gimple-range-gori.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-range-infer.cc b/gcc/gimple-range-infer.cc
index 98642e2438f..dd748248eaa 100644
--- a/gcc/gimple-range-infer.cc
+++ b/gcc/gimple-range-infer.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-range-op.cc b/gcc/gimple-range-op.cc
index 68a7df8d01b..030030cb156 100644
--- a/gcc/gimple-range-op.cc
+++ b/gcc/gimple-range-op.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc
index f64a7a5e8ca..85c3d15c903 100644
--- a/gcc/gimple-range-path.cc
+++ b/gcc/gimple-range-path.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-range-phi.cc b/gcc/gimple-range-phi.cc
index c679e4ed7f2..aeb6c400ae9 100644
--- a/gcc/gimple-range-phi.cc
+++ b/gcc/gimple-range-phi.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-range-trace.cc b/gcc/gimple-range-trace.cc
index e1679a1bfc9..5302646ed49 100644
--- a/gcc/gimple-range-trace.cc
+++ b/gcc/gimple-range-trace.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc
index 7ba7d464b5e..e250b26281e 100644
--- a/gcc/gimple-range.cc
+++ b/gcc/gimple-range.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-ssa-backprop.cc b/gcc/gimple-ssa-backprop.cc
index e3374b18138..ea3ae0bf043 100644
--- a/gcc/gimple-ssa-backprop.cc
+++ b/gcc/gimple-ssa-backprop.cc
@@ -84,6 +84,7 @@ along with GCC; see the file COPYING3. If not see
Note that this pass does not deal with direct redundancies,
such as cos(-x)->cos(x). match.pd handles those cases instead. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-ssa-sprintf.cc b/gcc/gimple-ssa-sprintf.cc
index 0900710647c..2e06b9112f0 100644
--- a/gcc/gimple-ssa-sprintf.cc
+++ b/gcc/gimple-ssa-sprintf.cc
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3. If not see
character arrays that a character pointer may point to as a bound
on the longest string. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-ssa-store-merging.cc b/gcc/gimple-ssa-store-merging.cc
index 7dba4a7a781..99103076945 100644
--- a/gcc/gimple-ssa-store-merging.cc
+++ b/gcc/gimple-ssa-store-merging.cc
@@ -138,6 +138,7 @@
[p] (32-bit) := 0x12345678; // (val & 0xffffffff0000) >> 16;
[p + 4B] (16-bit) := 0xabcd; // val & 0x00000000ffff; */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-ssa-strength-reduction.cc b/gcc/gimple-ssa-strength-reduction.cc
index 39cd9339c77..13e05b094de 100644
--- a/gcc/gimple-ssa-strength-reduction.cc
+++ b/gcc/gimple-ssa-strength-reduction.cc
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
If desired, it could be extended to floating-point operations under
control of something like -funsafe-math-optimizations. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-ssa-warn-access.cc b/gcc/gimple-ssa-warn-access.cc
index 5061af389c2..f2fea9101b5 100644
--- a/gcc/gimple-ssa-warn-access.cc
+++ b/gcc/gimple-ssa-warn-access.cc
@@ -20,6 +20,7 @@
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#define INCLUDE_STRING
#include "config.h"
#include "system.h"
diff --git a/gcc/gimple-ssa-warn-alloca.cc b/gcc/gimple-ssa-warn-alloca.cc
index f12e55bc795..c85f5c77312 100644
--- a/gcc/gimple-ssa-warn-alloca.cc
+++ b/gcc/gimple-ssa-warn-alloca.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-ssa-warn-restrict.cc b/gcc/gimple-ssa-warn-restrict.cc
index d71f1331c85..4bccca52f0d 100644
--- a/gcc/gimple-ssa-warn-restrict.cc
+++ b/gcc/gimple-ssa-warn-restrict.cc
@@ -19,6 +19,7 @@
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-streamer-in.cc b/gcc/gimple-streamer-in.cc
index 61f6d069875..d7843c5ecaa 100644
--- a/gcc/gimple-streamer-in.cc
+++ b/gcc/gimple-streamer-in.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple-streamer-out.cc b/gcc/gimple-streamer-out.cc
index e63d8b4df0c..f30f06ee720 100644
--- a/gcc/gimple-streamer-out.cc
+++ b/gcc/gimple-streamer-out.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimple.cc b/gcc/gimple.cc
index 6e28cf291e1..13aa3d27844 100644
--- a/gcc/gimple.cc
+++ b/gcc/gimple.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index 769b880cce5..9e7a1b5eb46 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/go/go-backend.cc b/gcc/go/go-backend.cc
index 25e5d35e6f1..69dbef66415 100644
--- a/gcc/go/go-backend.cc
+++ b/gcc/go/go-backend.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/go/go-lang.cc b/gcc/go/go-lang.cc
index 9316425b2aa..42a21594f35 100644
--- a/gcc/go/go-lang.cc
+++ b/gcc/go/go-lang.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/graph.cc b/gcc/graph.cc
index 07da0798f51..677dc50b61b 100644
--- a/gcc/graph.cc
+++ b/gcc/graph.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/graphviz.cc b/gcc/graphviz.cc
index e41c8bc0ef3..daa97066953 100644
--- a/gcc/graphviz.cc
+++ b/gcc/graphviz.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/input.cc b/gcc/input.cc
index 9f5228d255c..04462ef6f5a 100644
--- a/gcc/input.cc
+++ b/gcc/input.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
index fa7bd6a15da..212d9ccbbfe 100644
--- a/gcc/ipa-cp.cc
+++ b/gcc/ipa-cp.cc
@@ -101,6 +101,7 @@ along with GCC; see the file COPYING3. If not see
the second stage. */
#define INCLUDE_ALGORITHM
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-devirt.cc b/gcc/ipa-devirt.cc
index c406e5138db..9f06f597e91 100644
--- a/gcc/ipa-devirt.cc
+++ b/gcc/ipa-devirt.cc
@@ -105,6 +105,7 @@ along with GCC; see the file COPYING3. If not see
pass_ipa_devirt performs simple speculative devirtualization.
*/
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-fnsummary.cc b/gcc/ipa-fnsummary.cc
index b3824783406..42e3efc53b6 100644
--- a/gcc/ipa-fnsummary.cc
+++ b/gcc/ipa-fnsummary.cc
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see
inlined performs analysis via its analyze_function method. */
#include "config.h"
+#define INCLUDE_MEMORY
#define INCLUDE_VECTOR
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-free-lang-data.cc b/gcc/ipa-free-lang-data.cc
index 3ad203fec4c..80e30f58754 100644
--- a/gcc/ipa-free-lang-data.cc
+++ b/gcc/ipa-free-lang-data.cc
@@ -29,6 +29,7 @@
It is intended to be language-independent but can occasionally
calls language-dependent routines. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-icf-gimple.cc b/gcc/ipa-icf-gimple.cc
index 31f6cdbda06..73fc56557fe 100644
--- a/gcc/ipa-icf-gimple.cc
+++ b/gcc/ipa-icf-gimple.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-icf.cc b/gcc/ipa-icf.cc
index b10a6baf109..fbb24186777 100644
--- a/gcc/ipa-icf.cc
+++ b/gcc/ipa-icf.cc
@@ -51,6 +51,7 @@ along with GCC; see the file COPYING3. If not see
*/
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-inline-analysis.cc b/gcc/ipa-inline-analysis.cc
index a190cb6501b..e52199872cf 100644
--- a/gcc/ipa-inline-analysis.cc
+++ b/gcc/ipa-inline-analysis.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-inline.cc b/gcc/ipa-inline.cc
index f15e141aa52..74a0c86a5d0 100644
--- a/gcc/ipa-inline.cc
+++ b/gcc/ipa-inline.cc
@@ -89,6 +89,7 @@ along with GCC; see the file COPYING3. If not see
This should almost always lead to reduction of code size by eliminating
the need for offline copy of the function. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-modref-tree.cc b/gcc/ipa-modref-tree.cc
index 961d46621a0..4bf7158535c 100644
--- a/gcc/ipa-modref-tree.cc
+++ b/gcc/ipa-modref-tree.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc
index 19359662f8f..c1973aa36c4 100644
--- a/gcc/ipa-modref.cc
+++ b/gcc/ipa-modref.cc
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3. If not see
That is a vector recording what function parameters
may escape to a function call (and with what parameter index). */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-param-manipulation.cc b/gcc/ipa-param-manipulation.cc
index ad36b8389c0..e1f6f3db299 100644
--- a/gcc/ipa-param-manipulation.cc
+++ b/gcc/ipa-param-manipulation.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
. */
#define INCLUDE_ALGORITHM
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-polymorphic-call.cc b/gcc/ipa-polymorphic-call.cc
index 7d3df7c474c..eb5f1e78456 100644
--- a/gcc/ipa-polymorphic-call.cc
+++ b/gcc/ipa-polymorphic-call.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-predicate.cc b/gcc/ipa-predicate.cc
index 164aba4a126..fbe1d6d917d 100644
--- a/gcc/ipa-predicate.cc
+++ b/gcc/ipa-predicate.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-profile.cc b/gcc/ipa-profile.cc
index 27f411ce81a..88e7523c0f2 100644
--- a/gcc/ipa-profile.cc
+++ b/gcc/ipa-profile.cc
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
once, executed at startup and executed at exit. These flags are used to
control code size/performance threshold and code placement (by producing
.text.unlikely/.text.hot/.text.startup/.text.exit subsections). */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc
index 78d1fb7086d..e96ade34b34 100644
--- a/gcc/ipa-prop.cc
+++ b/gcc/ipa-prop.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-pure-const.cc b/gcc/ipa-pure-const.cc
index b5a1dcdc154..79fde2449d2 100644
--- a/gcc/ipa-pure-const.cc
+++ b/gcc/ipa-pure-const.cc
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
should be one of the later passes since it's information is used by
the rest of the compilation. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-reference.cc b/gcc/ipa-reference.cc
index 4c8a362b57b..2930888e356 100644
--- a/gcc/ipa-reference.cc
+++ b/gcc/ipa-reference.cc
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
traumatic, promote some statics to registers, and improve aliasing
information. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-split.cc b/gcc/ipa-split.cc
index caf6279ab21..eb1f7937a0b 100644
--- a/gcc/ipa-split.cc
+++ b/gcc/ipa-split.cc
@@ -74,6 +74,7 @@ along with GCC; see the file COPYING3. If not see
7) There is nothing preventing us from producing multiple parts of single function
when needed or splitting also the parts. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-sra.cc b/gcc/ipa-sra.cc
index 04920f2aa8e..585ba53ce63 100644
--- a/gcc/ipa-sra.cc
+++ b/gcc/ipa-sra.cc
@@ -56,6 +56,7 @@ along with GCC; see the file COPYING3. If not see
ipa-param-manipulation.h for more details. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-strub.cc b/gcc/ipa-strub.cc
index 8fa7bdf5300..6dbef204de6 100644
--- a/gcc/ipa-strub.cc
+++ b/gcc/ipa-strub.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/ipa-utils.cc b/gcc/ipa-utils.cc
index 2366fa778d1..38dd4704793 100644
--- a/gcc/ipa-utils.cc
+++ b/gcc/ipa-utils.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/jit/dummy-frontend.cc b/gcc/jit/dummy-frontend.cc
index 17f37a3f405..12167829b27 100644
--- a/gcc/jit/dummy-frontend.cc
+++ b/gcc/jit/dummy-frontend.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/jit/jit-playback.cc b/gcc/jit/jit-playback.cc
index 583956fb463..e732c228751 100644
--- a/gcc/jit/jit-playback.cc
+++ b/gcc/jit/jit-playback.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
. */
#include "config.h"
+#define INCLUDE_MEMORY
#define INCLUDE_MUTEX
#include "libgccjit.h"
#include "system.h"
diff --git a/gcc/jit/jit-recording.cc b/gcc/jit/jit-recording.cc
index cc7f529c9e8..83a36db653d 100644
--- a/gcc/jit/jit-recording.cc
+++ b/gcc/jit/jit-recording.cc
@@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see
. */
#include "config.h"
+#define INCLUDE_MEMORY
#define INCLUDE_SSTREAM
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/langhooks.cc b/gcc/langhooks.cc
index 54fc94e4364..fe32be44956 100644
--- a/gcc/langhooks.cc
+++ b/gcc/langhooks.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/late-combine.cc b/gcc/late-combine.cc
index 1d81b386c3d..1b6cd0bea2c 100644
--- a/gcc/late-combine.cc
+++ b/gcc/late-combine.cc
@@ -30,6 +30,7 @@
#define INCLUDE_ALGORITHM
#define INCLUDE_FUNCTIONAL
+#define INCLUDE_MEMORY
#define INCLUDE_ARRAY
#include "config.h"
#include "system.h"
diff --git a/gcc/lto-cgraph.cc b/gcc/lto-cgraph.cc
index 1d4311a8832..e1d19f909dd 100644
--- a/gcc/lto-cgraph.cc
+++ b/gcc/lto-cgraph.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/lto-compress.cc b/gcc/lto-compress.cc
index bebf0277ef6..1895bb43345 100644
--- a/gcc/lto-compress.cc
+++ b/gcc/lto-compress.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/lto-opts.cc b/gcc/lto-opts.cc
index a3a1d110329..93ac83081f6 100644
--- a/gcc/lto-opts.cc
+++ b/gcc/lto-opts.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/lto-section-in.cc b/gcc/lto-section-in.cc
index fc2ba1906e1..22c203b2262 100644
--- a/gcc/lto-section-in.cc
+++ b/gcc/lto-section-in.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/lto-section-out.cc b/gcc/lto-section-out.cc
index d9c42653713..c05e97133b7 100644
--- a/gcc/lto-section-out.cc
+++ b/gcc/lto-section-out.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/lto-streamer-in.cc b/gcc/lto-streamer-in.cc
index 15181c3f574..c541a0524c8 100644
--- a/gcc/lto-streamer-in.cc
+++ b/gcc/lto-streamer-in.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/lto-streamer-out.cc b/gcc/lto-streamer-out.cc
index a464c2d5ddf..fab0702f99b 100644
--- a/gcc/lto-streamer-out.cc
+++ b/gcc/lto-streamer-out.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/lto-streamer.cc b/gcc/lto-streamer.cc
index 40ca6b2da1b..884861d4dd1 100644
--- a/gcc/lto-streamer.cc
+++ b/gcc/lto-streamer.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc
index 9d7fe18b229..a8bf847eb8c 100644
--- a/gcc/lto-wrapper.cc
+++ b/gcc/lto-wrapper.cc
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see
./ccCJuXGv.lto.ltrans.o
*/
+#define INCLUDE_MEMORY
#define INCLUDE_STRING
#include "config.h"
#include "system.h"
@@ -52,6 +53,7 @@ along with GCC; see the file COPYING3. If not see
#include "opts-diagnostic.h"
#include "opt-suggestions.h"
#include "opts-jobserver.h"
+#include "make-unique.h"
/* Environment variable, used for passing the names of offload targets from GCC
driver to lto-wrapper. */
@@ -2174,7 +2176,8 @@ main (int argc, char *argv[])
diagnostic_initialize (global_dc, 0);
diagnostic_color_init (global_dc);
diagnostic_urls_init (global_dc);
- global_dc->set_option_manager (new lto_diagnostic_option_manager (), 0);
+ global_dc->set_option_manager
+ (::make_unique (), 0);
if (atexit (lto_wrapper_cleanup) != 0)
fatal_error (input_location, "% failed");
diff --git a/gcc/lto/lto-common.cc b/gcc/lto/lto-common.cc
index 34aa63b179c..77607751db5 100644
--- a/gcc/lto/lto-common.cc
+++ b/gcc/lto/lto-common.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/lto/lto-dump.cc b/gcc/lto/lto-dump.cc
index b570bccf8ed..be869c29431 100644
--- a/gcc/lto/lto-dump.cc
+++ b/gcc/lto/lto-dump.cc
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/lto/lto-partition.cc b/gcc/lto/lto-partition.cc
index 2238650fa0e..2267b4edaf4 100644
--- a/gcc/lto/lto-partition.cc
+++ b/gcc/lto/lto-partition.cc
@@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see
. */
#include "config.h"
+#define INCLUDE_MEMORY
#define INCLUDE_VECTOR
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/lto/lto-symtab.cc b/gcc/lto/lto-symtab.cc
index a40218beac5..b12937c6a0a 100644
--- a/gcc/lto/lto-symtab.cc
+++ b/gcc/lto/lto-symtab.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/lto/lto.cc b/gcc/lto/lto.cc
index 1ee215d8f1d..e5b24f24370 100644
--- a/gcc/lto/lto.cc
+++ b/gcc/lto/lto.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#define INCLUDE_STRING
#include "config.h"
#include "system.h"
diff --git a/gcc/m2/gm2-gcc/gcc-consolidation.h b/gcc/m2/gm2-gcc/gcc-consolidation.h
index 637ec0bcc54..e0a94eeb279 100644
--- a/gcc/m2/gm2-gcc/gcc-consolidation.h
+++ b/gcc/m2/gm2-gcc/gcc-consolidation.h
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/m2/gm2-gcc/m2configure.cc b/gcc/m2/gm2-gcc/m2configure.cc
index 9e0e82f86c0..d55d6c25e8f 100644
--- a/gcc/m2/gm2-gcc/m2configure.cc
+++ b/gcc/m2/gm2-gcc/m2configure.cc
@@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include "libiberty.h"
diff --git a/gcc/m2/mc-boot/GASCII.cc b/gcc/m2/mc-boot/GASCII.cc
index a5c59fd3c4b..76e1dd901ed 100644
--- a/gcc/m2/mc-boot/GASCII.cc
+++ b/gcc/m2/mc-boot/GASCII.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GASCII.h b/gcc/m2/mc-boot/GASCII.h
index c157a8b7686..76c961a9d57 100644
--- a/gcc/m2/mc-boot/GASCII.h
+++ b/gcc/m2/mc-boot/GASCII.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_ASCII_H)
# define _ASCII_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GArgs.cc b/gcc/m2/mc-boot/GArgs.cc
index 182def800ea..8fc16a4ebea 100644
--- a/gcc/m2/mc-boot/GArgs.cc
+++ b/gcc/m2/mc-boot/GArgs.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GArgs.h b/gcc/m2/mc-boot/GArgs.h
index 1171cef8d72..752345f691c 100644
--- a/gcc/m2/mc-boot/GArgs.h
+++ b/gcc/m2/mc-boot/GArgs.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_Args_H)
# define _Args_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GAssertion.cc b/gcc/m2/mc-boot/GAssertion.cc
index b6b47952108..34989b9737f 100644
--- a/gcc/m2/mc-boot/GAssertion.cc
+++ b/gcc/m2/mc-boot/GAssertion.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GAssertion.h b/gcc/m2/mc-boot/GAssertion.h
index d909fdee7a3..c5bcdd98d37 100644
--- a/gcc/m2/mc-boot/GAssertion.h
+++ b/gcc/m2/mc-boot/GAssertion.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_Assertion_H)
# define _Assertion_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GBreak.cc b/gcc/m2/mc-boot/GBreak.cc
index 4fea839214b..ffbe2f172a5 100644
--- a/gcc/m2/mc-boot/GBreak.cc
+++ b/gcc/m2/mc-boot/GBreak.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GBreak.h b/gcc/m2/mc-boot/GBreak.h
index bd2f1ccf6f1..df0ee16b5ed 100644
--- a/gcc/m2/mc-boot/GBreak.h
+++ b/gcc/m2/mc-boot/GBreak.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_Break_H)
# define _Break_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GCOROUTINES.h b/gcc/m2/mc-boot/GCOROUTINES.h
index a744d9c6ebe..dff08a0c185 100644
--- a/gcc/m2/mc-boot/GCOROUTINES.h
+++ b/gcc/m2/mc-boot/GCOROUTINES.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_COROUTINES_H)
# define _COROUTINES_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GCmdArgs.cc b/gcc/m2/mc-boot/GCmdArgs.cc
index cb8fa8ace58..0e33d916051 100644
--- a/gcc/m2/mc-boot/GCmdArgs.cc
+++ b/gcc/m2/mc-boot/GCmdArgs.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GCmdArgs.h b/gcc/m2/mc-boot/GCmdArgs.h
index 7f39815bc09..852e8dc0037 100644
--- a/gcc/m2/mc-boot/GCmdArgs.h
+++ b/gcc/m2/mc-boot/GCmdArgs.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_CmdArgs_H)
# define _CmdArgs_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GDebug.cc b/gcc/m2/mc-boot/GDebug.cc
index 3f0ec51507e..edda6c952c5 100644
--- a/gcc/m2/mc-boot/GDebug.cc
+++ b/gcc/m2/mc-boot/GDebug.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GDebug.h b/gcc/m2/mc-boot/GDebug.h
index 8787752b9a3..08c4da1abed 100644
--- a/gcc/m2/mc-boot/GDebug.h
+++ b/gcc/m2/mc-boot/GDebug.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_Debug_H)
# define _Debug_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GDynamicStrings.cc b/gcc/m2/mc-boot/GDynamicStrings.cc
index 2b182b9b2c0..bccbeda2f23 100644
--- a/gcc/m2/mc-boot/GDynamicStrings.cc
+++ b/gcc/m2/mc-boot/GDynamicStrings.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GDynamicStrings.h b/gcc/m2/mc-boot/GDynamicStrings.h
index e0652a7d3bd..fefce9d6f6b 100644
--- a/gcc/m2/mc-boot/GDynamicStrings.h
+++ b/gcc/m2/mc-boot/GDynamicStrings.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_DynamicStrings_H)
# define _DynamicStrings_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GEnvironment.cc b/gcc/m2/mc-boot/GEnvironment.cc
index aad1bb46c01..95dab816595 100644
--- a/gcc/m2/mc-boot/GEnvironment.cc
+++ b/gcc/m2/mc-boot/GEnvironment.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GEnvironment.h b/gcc/m2/mc-boot/GEnvironment.h
index 4f94d583334..2da03aeba75 100644
--- a/gcc/m2/mc-boot/GEnvironment.h
+++ b/gcc/m2/mc-boot/GEnvironment.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_Environment_H)
# define _Environment_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GFIO.cc b/gcc/m2/mc-boot/GFIO.cc
index b05c33000bd..45a39d66116 100644
--- a/gcc/m2/mc-boot/GFIO.cc
+++ b/gcc/m2/mc-boot/GFIO.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GFIO.h b/gcc/m2/mc-boot/GFIO.h
index d82396449ff..04cbc768505 100644
--- a/gcc/m2/mc-boot/GFIO.h
+++ b/gcc/m2/mc-boot/GFIO.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_FIO_H)
# define _FIO_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GFormatStrings.cc b/gcc/m2/mc-boot/GFormatStrings.cc
index d3acec3bc6c..36998f693c5 100644
--- a/gcc/m2/mc-boot/GFormatStrings.cc
+++ b/gcc/m2/mc-boot/GFormatStrings.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GFormatStrings.h b/gcc/m2/mc-boot/GFormatStrings.h
index 1d8ce34ce62..858403d5690 100644
--- a/gcc/m2/mc-boot/GFormatStrings.h
+++ b/gcc/m2/mc-boot/GFormatStrings.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_FormatStrings_H)
# define _FormatStrings_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GFpuIO.cc b/gcc/m2/mc-boot/GFpuIO.cc
index 09fd4fb95cd..3c4fb6121dc 100644
--- a/gcc/m2/mc-boot/GFpuIO.cc
+++ b/gcc/m2/mc-boot/GFpuIO.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GFpuIO.h b/gcc/m2/mc-boot/GFpuIO.h
index 5d830606130..1e0575b7f82 100644
--- a/gcc/m2/mc-boot/GFpuIO.h
+++ b/gcc/m2/mc-boot/GFpuIO.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_FpuIO_H)
# define _FpuIO_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GIO.cc b/gcc/m2/mc-boot/GIO.cc
index 4b76ed6bc80..76495e745fd 100644
--- a/gcc/m2/mc-boot/GIO.cc
+++ b/gcc/m2/mc-boot/GIO.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GIO.h b/gcc/m2/mc-boot/GIO.h
index 4f4af9a59a0..3e58ea5cff2 100644
--- a/gcc/m2/mc-boot/GIO.h
+++ b/gcc/m2/mc-boot/GIO.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_IO_H)
# define _IO_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GIndexing.cc b/gcc/m2/mc-boot/GIndexing.cc
index dd314001108..4dfccd2f991 100644
--- a/gcc/m2/mc-boot/GIndexing.cc
+++ b/gcc/m2/mc-boot/GIndexing.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GIndexing.h b/gcc/m2/mc-boot/GIndexing.h
index b986469c331..e2e728c2566 100644
--- a/gcc/m2/mc-boot/GIndexing.h
+++ b/gcc/m2/mc-boot/GIndexing.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_Indexing_H)
# define _Indexing_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GM2Dependent.cc b/gcc/m2/mc-boot/GM2Dependent.cc
index c965f4bf7f3..f4fe04cd2b6 100644
--- a/gcc/m2/mc-boot/GM2Dependent.cc
+++ b/gcc/m2/mc-boot/GM2Dependent.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GM2Dependent.h b/gcc/m2/mc-boot/GM2Dependent.h
index 0353236f8c1..3b32e165a48 100644
--- a/gcc/m2/mc-boot/GM2Dependent.h
+++ b/gcc/m2/mc-boot/GM2Dependent.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_M2Dependent_H)
# define _M2Dependent_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GM2EXCEPTION.cc b/gcc/m2/mc-boot/GM2EXCEPTION.cc
index 97417cf6c82..af1218f922a 100644
--- a/gcc/m2/mc-boot/GM2EXCEPTION.cc
+++ b/gcc/m2/mc-boot/GM2EXCEPTION.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GM2EXCEPTION.h b/gcc/m2/mc-boot/GM2EXCEPTION.h
index 4ee5404733c..fef5e2b1740 100644
--- a/gcc/m2/mc-boot/GM2EXCEPTION.h
+++ b/gcc/m2/mc-boot/GM2EXCEPTION.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_M2EXCEPTION_H)
# define _M2EXCEPTION_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GM2RTS.cc b/gcc/m2/mc-boot/GM2RTS.cc
index ef5f7cf5ce1..844006ac529 100644
--- a/gcc/m2/mc-boot/GM2RTS.cc
+++ b/gcc/m2/mc-boot/GM2RTS.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GM2RTS.h b/gcc/m2/mc-boot/GM2RTS.h
index 055cc95675b..88e21849c05 100644
--- a/gcc/m2/mc-boot/GM2RTS.h
+++ b/gcc/m2/mc-boot/GM2RTS.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_M2RTS_H)
# define _M2RTS_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GMemUtils.cc b/gcc/m2/mc-boot/GMemUtils.cc
index 1d9feed27d6..04474ecbf39 100644
--- a/gcc/m2/mc-boot/GMemUtils.cc
+++ b/gcc/m2/mc-boot/GMemUtils.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GMemUtils.h b/gcc/m2/mc-boot/GMemUtils.h
index 1d23091ce93..dea7aafda6d 100644
--- a/gcc/m2/mc-boot/GMemUtils.h
+++ b/gcc/m2/mc-boot/GMemUtils.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_MemUtils_H)
# define _MemUtils_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GNumberIO.cc b/gcc/m2/mc-boot/GNumberIO.cc
index 75720dd85e6..15b3be191f0 100644
--- a/gcc/m2/mc-boot/GNumberIO.cc
+++ b/gcc/m2/mc-boot/GNumberIO.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GNumberIO.h b/gcc/m2/mc-boot/GNumberIO.h
index 34aee337383..decd31b4dd8 100644
--- a/gcc/m2/mc-boot/GNumberIO.h
+++ b/gcc/m2/mc-boot/GNumberIO.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_NumberIO_H)
# define _NumberIO_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GPushBackInput.cc b/gcc/m2/mc-boot/GPushBackInput.cc
index 9bc2a83abd4..5c50f967c18 100644
--- a/gcc/m2/mc-boot/GPushBackInput.cc
+++ b/gcc/m2/mc-boot/GPushBackInput.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GPushBackInput.h b/gcc/m2/mc-boot/GPushBackInput.h
index 076b99657a0..27c572b53e0 100644
--- a/gcc/m2/mc-boot/GPushBackInput.h
+++ b/gcc/m2/mc-boot/GPushBackInput.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_PushBackInput_H)
# define _PushBackInput_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GRTExceptions.cc b/gcc/m2/mc-boot/GRTExceptions.cc
index a0eff3ecc8a..d42c1f31107 100644
--- a/gcc/m2/mc-boot/GRTExceptions.cc
+++ b/gcc/m2/mc-boot/GRTExceptions.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GRTExceptions.h b/gcc/m2/mc-boot/GRTExceptions.h
index 9e188bcbad4..b335d800ca6 100644
--- a/gcc/m2/mc-boot/GRTExceptions.h
+++ b/gcc/m2/mc-boot/GRTExceptions.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_RTExceptions_H)
# define _RTExceptions_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GRTco.h b/gcc/m2/mc-boot/GRTco.h
index 778b75f3d2e..2e014d333cf 100644
--- a/gcc/m2/mc-boot/GRTco.h
+++ b/gcc/m2/mc-boot/GRTco.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_RTco_H)
# define _RTco_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GRTentity.h b/gcc/m2/mc-boot/GRTentity.h
index 9acb0775575..3eb8822fc9d 100644
--- a/gcc/m2/mc-boot/GRTentity.h
+++ b/gcc/m2/mc-boot/GRTentity.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_RTentity_H)
# define _RTentity_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GRTint.cc b/gcc/m2/mc-boot/GRTint.cc
index 11b4228074a..f1c268843c8 100644
--- a/gcc/m2/mc-boot/GRTint.cc
+++ b/gcc/m2/mc-boot/GRTint.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GRTint.h b/gcc/m2/mc-boot/GRTint.h
index 4f81546e8d6..a9fb9d182ec 100644
--- a/gcc/m2/mc-boot/GRTint.h
+++ b/gcc/m2/mc-boot/GRTint.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_RTint_H)
# define _RTint_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GSArgs.cc b/gcc/m2/mc-boot/GSArgs.cc
index 93083a056dc..0c99f2d2594 100644
--- a/gcc/m2/mc-boot/GSArgs.cc
+++ b/gcc/m2/mc-boot/GSArgs.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GSArgs.h b/gcc/m2/mc-boot/GSArgs.h
index a7b10bf4a1f..6a12e7ec4f3 100644
--- a/gcc/m2/mc-boot/GSArgs.h
+++ b/gcc/m2/mc-boot/GSArgs.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_SArgs_H)
# define _SArgs_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GSFIO.cc b/gcc/m2/mc-boot/GSFIO.cc
index b568cce23eb..232d3f5883e 100644
--- a/gcc/m2/mc-boot/GSFIO.cc
+++ b/gcc/m2/mc-boot/GSFIO.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GSFIO.h b/gcc/m2/mc-boot/GSFIO.h
index 108d8ea79f0..bba25eb8436 100644
--- a/gcc/m2/mc-boot/GSFIO.h
+++ b/gcc/m2/mc-boot/GSFIO.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_SFIO_H)
# define _SFIO_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GSYSTEM.h b/gcc/m2/mc-boot/GSYSTEM.h
index a18a1765dc5..ff4b7b24ac3 100644
--- a/gcc/m2/mc-boot/GSYSTEM.h
+++ b/gcc/m2/mc-boot/GSYSTEM.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_SYSTEM_H)
# define _SYSTEM_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GSelective.h b/gcc/m2/mc-boot/GSelective.h
index 67b7f0643f0..17e926d1a44 100644
--- a/gcc/m2/mc-boot/GSelective.h
+++ b/gcc/m2/mc-boot/GSelective.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_Selective_H)
# define _Selective_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GStdIO.cc b/gcc/m2/mc-boot/GStdIO.cc
index c9d3774ec06..ddcb8ec040a 100644
--- a/gcc/m2/mc-boot/GStdIO.cc
+++ b/gcc/m2/mc-boot/GStdIO.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GStdIO.h b/gcc/m2/mc-boot/GStdIO.h
index 0a45ebc7e34..3c84cede87b 100644
--- a/gcc/m2/mc-boot/GStdIO.h
+++ b/gcc/m2/mc-boot/GStdIO.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_StdIO_H)
# define _StdIO_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GStorage.cc b/gcc/m2/mc-boot/GStorage.cc
index 67e7a8b7274..24ced14ce6a 100644
--- a/gcc/m2/mc-boot/GStorage.cc
+++ b/gcc/m2/mc-boot/GStorage.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GStorage.h b/gcc/m2/mc-boot/GStorage.h
index 8c26b465b2c..a119a8f6e58 100644
--- a/gcc/m2/mc-boot/GStorage.h
+++ b/gcc/m2/mc-boot/GStorage.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_Storage_H)
# define _Storage_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GStrCase.cc b/gcc/m2/mc-boot/GStrCase.cc
index 9492774596b..03993e5fbd6 100644
--- a/gcc/m2/mc-boot/GStrCase.cc
+++ b/gcc/m2/mc-boot/GStrCase.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GStrCase.h b/gcc/m2/mc-boot/GStrCase.h
index c3f064728d8..9fd23285525 100644
--- a/gcc/m2/mc-boot/GStrCase.h
+++ b/gcc/m2/mc-boot/GStrCase.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_StrCase_H)
# define _StrCase_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GStrIO.cc b/gcc/m2/mc-boot/GStrIO.cc
index d0c6e2085cd..7e94ef521ea 100644
--- a/gcc/m2/mc-boot/GStrIO.cc
+++ b/gcc/m2/mc-boot/GStrIO.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GStrIO.h b/gcc/m2/mc-boot/GStrIO.h
index 2ed2ac33f11..653e020d399 100644
--- a/gcc/m2/mc-boot/GStrIO.h
+++ b/gcc/m2/mc-boot/GStrIO.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_StrIO_H)
# define _StrIO_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GStrLib.cc b/gcc/m2/mc-boot/GStrLib.cc
index dc6d0ff2aa0..19ac230e9a4 100644
--- a/gcc/m2/mc-boot/GStrLib.cc
+++ b/gcc/m2/mc-boot/GStrLib.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GStrLib.h b/gcc/m2/mc-boot/GStrLib.h
index b292d8990a1..ddd7457a6ff 100644
--- a/gcc/m2/mc-boot/GStrLib.h
+++ b/gcc/m2/mc-boot/GStrLib.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_StrLib_H)
# define _StrLib_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GStringConvert.cc b/gcc/m2/mc-boot/GStringConvert.cc
index 80efd0c9fc4..822813cd141 100644
--- a/gcc/m2/mc-boot/GStringConvert.cc
+++ b/gcc/m2/mc-boot/GStringConvert.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GStringConvert.h b/gcc/m2/mc-boot/GStringConvert.h
index 284eef236cc..3983d6cc375 100644
--- a/gcc/m2/mc-boot/GStringConvert.h
+++ b/gcc/m2/mc-boot/GStringConvert.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_StringConvert_H)
# define _StringConvert_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GSysExceptions.h b/gcc/m2/mc-boot/GSysExceptions.h
index 00dd52117d1..eee2631c8be 100644
--- a/gcc/m2/mc-boot/GSysExceptions.h
+++ b/gcc/m2/mc-boot/GSysExceptions.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_SysExceptions_H)
# define _SysExceptions_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GSysStorage.cc b/gcc/m2/mc-boot/GSysStorage.cc
index 1ef723074d4..fe06a5d8775 100644
--- a/gcc/m2/mc-boot/GSysStorage.cc
+++ b/gcc/m2/mc-boot/GSysStorage.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GSysStorage.h b/gcc/m2/mc-boot/GSysStorage.h
index 639f6811e19..2aa6f85aaff 100644
--- a/gcc/m2/mc-boot/GSysStorage.h
+++ b/gcc/m2/mc-boot/GSysStorage.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_SysStorage_H)
# define _SysStorage_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GTimeString.cc b/gcc/m2/mc-boot/GTimeString.cc
index af7b7e40814..37405659be0 100644
--- a/gcc/m2/mc-boot/GTimeString.cc
+++ b/gcc/m2/mc-boot/GTimeString.cc
@@ -25,6 +25,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GTimeString.h b/gcc/m2/mc-boot/GTimeString.h
index 7ba51f8081e..27d128769f5 100644
--- a/gcc/m2/mc-boot/GTimeString.h
+++ b/gcc/m2/mc-boot/GTimeString.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_TimeString_H)
# define _TimeString_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GUnixArgs.h b/gcc/m2/mc-boot/GUnixArgs.h
index cf9756ea177..6c04a944825 100644
--- a/gcc/m2/mc-boot/GUnixArgs.h
+++ b/gcc/m2/mc-boot/GUnixArgs.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_UnixArgs_H)
# define _UnixArgs_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Galists.cc b/gcc/m2/mc-boot/Galists.cc
index ca582f3ce43..a2ad92238b7 100644
--- a/gcc/m2/mc-boot/Galists.cc
+++ b/gcc/m2/mc-boot/Galists.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/Galists.h b/gcc/m2/mc-boot/Galists.h
index 3ed524152f4..3bb6599422c 100644
--- a/gcc/m2/mc-boot/Galists.h
+++ b/gcc/m2/mc-boot/Galists.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_alists_H)
# define _alists_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gdecl.cc b/gcc/m2/mc-boot/Gdecl.cc
index 9af2842ca18..0878f7de29b 100644
--- a/gcc/m2/mc-boot/Gdecl.cc
+++ b/gcc/m2/mc-boot/Gdecl.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/Gdecl.h b/gcc/m2/mc-boot/Gdecl.h
index 99d78087ae2..8b7aa91b38a 100644
--- a/gcc/m2/mc-boot/Gdecl.h
+++ b/gcc/m2/mc-boot/Gdecl.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_decl_H)
# define _decl_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gdtoa.h b/gcc/m2/mc-boot/Gdtoa.h
index c1b3619ce47..d06a03480f9 100644
--- a/gcc/m2/mc-boot/Gdtoa.h
+++ b/gcc/m2/mc-boot/Gdtoa.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_dtoa_H)
# define _dtoa_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gerrno.h b/gcc/m2/mc-boot/Gerrno.h
index 7f065ccb24d..9d315c3d2ce 100644
--- a/gcc/m2/mc-boot/Gerrno.h
+++ b/gcc/m2/mc-boot/Gerrno.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_errno_H)
# define _errno_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gkeyc.cc b/gcc/m2/mc-boot/Gkeyc.cc
index 3a5dd5ccc1d..a56abc56ee3 100644
--- a/gcc/m2/mc-boot/Gkeyc.cc
+++ b/gcc/m2/mc-boot/Gkeyc.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
@@ -575,6 +576,7 @@ static void checkGccConfigSystem (mcPretty_pretty p)
if (! initializedGCC)
{
initializedGCC = true;
+ mcPretty_print (p, (const char *) "#define INCLUDE_MEMORY\\n", 24);
mcPretty_print (p, (const char *) "#include \"config.h\"\\n", 21);
mcPretty_print (p, (const char *) "#include \"system.h\"\\n", 21);
checkGccTypes (p);
diff --git a/gcc/m2/mc-boot/Gkeyc.h b/gcc/m2/mc-boot/Gkeyc.h
index afa945d03c0..f0911ee8488 100644
--- a/gcc/m2/mc-boot/Gkeyc.h
+++ b/gcc/m2/mc-boot/Gkeyc.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_keyc_H)
# define _keyc_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gldtoa.h b/gcc/m2/mc-boot/Gldtoa.h
index c4b4d904fb0..a8f72ea4bd1 100644
--- a/gcc/m2/mc-boot/Gldtoa.h
+++ b/gcc/m2/mc-boot/Gldtoa.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_ldtoa_H)
# define _ldtoa_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Glibc.h b/gcc/m2/mc-boot/Glibc.h
index def419fb3c9..50384ecf897 100644
--- a/gcc/m2/mc-boot/Glibc.h
+++ b/gcc/m2/mc-boot/Glibc.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_libc_H)
# define _libc_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Glibm.h b/gcc/m2/mc-boot/Glibm.h
index d3c9415070c..19ee9e599ce 100644
--- a/gcc/m2/mc-boot/Glibm.h
+++ b/gcc/m2/mc-boot/Glibm.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_libm_H)
# define _libm_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Glists.cc b/gcc/m2/mc-boot/Glists.cc
index e33c91d8500..d354e867e77 100644
--- a/gcc/m2/mc-boot/Glists.cc
+++ b/gcc/m2/mc-boot/Glists.cc
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/Glists.h b/gcc/m2/mc-boot/Glists.h
index 5cb8058415c..e8414b080fe 100644
--- a/gcc/m2/mc-boot/Glists.h
+++ b/gcc/m2/mc-boot/Glists.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_lists_H)
# define _lists_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcComment.cc b/gcc/m2/mc-boot/GmcComment.cc
index 4c7650283ec..6b27d93e6fa 100644
--- a/gcc/m2/mc-boot/GmcComment.cc
+++ b/gcc/m2/mc-boot/GmcComment.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcComment.h b/gcc/m2/mc-boot/GmcComment.h
index 39ba8c21595..57952a1cec2 100644
--- a/gcc/m2/mc-boot/GmcComment.h
+++ b/gcc/m2/mc-boot/GmcComment.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcComment_H)
# define _mcComment_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcComp.cc b/gcc/m2/mc-boot/GmcComp.cc
index c941c618030..ca192aa7456 100644
--- a/gcc/m2/mc-boot/GmcComp.cc
+++ b/gcc/m2/mc-boot/GmcComp.cc
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcComp.h b/gcc/m2/mc-boot/GmcComp.h
index 9ab78a54723..088b6636f96 100644
--- a/gcc/m2/mc-boot/GmcComp.h
+++ b/gcc/m2/mc-boot/GmcComp.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcComp_H)
# define _mcComp_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcDebug.cc b/gcc/m2/mc-boot/GmcDebug.cc
index 0085384f2c9..7ded4aee139 100644
--- a/gcc/m2/mc-boot/GmcDebug.cc
+++ b/gcc/m2/mc-boot/GmcDebug.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcDebug.h b/gcc/m2/mc-boot/GmcDebug.h
index e8ec34b2be4..8de6dc46e7e 100644
--- a/gcc/m2/mc-boot/GmcDebug.h
+++ b/gcc/m2/mc-boot/GmcDebug.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcDebug_H)
# define _mcDebug_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcError.cc b/gcc/m2/mc-boot/GmcError.cc
index 5893201913f..cb5e30fa8cc 100644
--- a/gcc/m2/mc-boot/GmcError.cc
+++ b/gcc/m2/mc-boot/GmcError.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcError.h b/gcc/m2/mc-boot/GmcError.h
index 6a62fcd540f..0c369b2d006 100644
--- a/gcc/m2/mc-boot/GmcError.h
+++ b/gcc/m2/mc-boot/GmcError.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcError_H)
# define _mcError_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcFileName.cc b/gcc/m2/mc-boot/GmcFileName.cc
index 3b516594c59..f0f69129e06 100644
--- a/gcc/m2/mc-boot/GmcFileName.cc
+++ b/gcc/m2/mc-boot/GmcFileName.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcFileName.h b/gcc/m2/mc-boot/GmcFileName.h
index a5a9afa8376..42c05b97090 100644
--- a/gcc/m2/mc-boot/GmcFileName.h
+++ b/gcc/m2/mc-boot/GmcFileName.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcFileName_H)
# define _mcFileName_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcLexBuf.cc b/gcc/m2/mc-boot/GmcLexBuf.cc
index 4cbd54429d1..39860c25ff7 100644
--- a/gcc/m2/mc-boot/GmcLexBuf.cc
+++ b/gcc/m2/mc-boot/GmcLexBuf.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcLexBuf.h b/gcc/m2/mc-boot/GmcLexBuf.h
index ca71dd83adb..714d0491b00 100644
--- a/gcc/m2/mc-boot/GmcLexBuf.h
+++ b/gcc/m2/mc-boot/GmcLexBuf.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcLexBuf_H)
# define _mcLexBuf_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcMetaError.cc b/gcc/m2/mc-boot/GmcMetaError.cc
index af64604534e..9298d0e4192 100644
--- a/gcc/m2/mc-boot/GmcMetaError.cc
+++ b/gcc/m2/mc-boot/GmcMetaError.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcMetaError.h b/gcc/m2/mc-boot/GmcMetaError.h
index a3c19c4c3a3..78dc1287905 100644
--- a/gcc/m2/mc-boot/GmcMetaError.h
+++ b/gcc/m2/mc-boot/GmcMetaError.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcMetaError_H)
# define _mcMetaError_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcOptions.cc b/gcc/m2/mc-boot/GmcOptions.cc
index 5a060604709..f6e4417b659 100644
--- a/gcc/m2/mc-boot/GmcOptions.cc
+++ b/gcc/m2/mc-boot/GmcOptions.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcOptions.h b/gcc/m2/mc-boot/GmcOptions.h
index 4bb82ecfbe2..b2ead1e4b41 100644
--- a/gcc/m2/mc-boot/GmcOptions.h
+++ b/gcc/m2/mc-boot/GmcOptions.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcOptions_H)
# define _mcOptions_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcPreprocess.cc b/gcc/m2/mc-boot/GmcPreprocess.cc
index 741109ad7fb..54d89bf33e7 100644
--- a/gcc/m2/mc-boot/GmcPreprocess.cc
+++ b/gcc/m2/mc-boot/GmcPreprocess.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcPreprocess.h b/gcc/m2/mc-boot/GmcPreprocess.h
index f12c781d173..fcbd0c3dfd5 100644
--- a/gcc/m2/mc-boot/GmcPreprocess.h
+++ b/gcc/m2/mc-boot/GmcPreprocess.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcPreprocess_H)
# define _mcPreprocess_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcPretty.cc b/gcc/m2/mc-boot/GmcPretty.cc
index 0bffa1ff6fe..c0be8c1e499 100644
--- a/gcc/m2/mc-boot/GmcPretty.cc
+++ b/gcc/m2/mc-boot/GmcPretty.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcPretty.h b/gcc/m2/mc-boot/GmcPretty.h
index 1a61c893261..c1d59ced8cb 100644
--- a/gcc/m2/mc-boot/GmcPretty.h
+++ b/gcc/m2/mc-boot/GmcPretty.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcPretty_H)
# define _mcPretty_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcPrintf.cc b/gcc/m2/mc-boot/GmcPrintf.cc
index e91e55acc14..dafa728437f 100644
--- a/gcc/m2/mc-boot/GmcPrintf.cc
+++ b/gcc/m2/mc-boot/GmcPrintf.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcPrintf.h b/gcc/m2/mc-boot/GmcPrintf.h
index 46aeaacf888..1f242a88554 100644
--- a/gcc/m2/mc-boot/GmcPrintf.h
+++ b/gcc/m2/mc-boot/GmcPrintf.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcPrintf_H)
# define _mcPrintf_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcQuiet.cc b/gcc/m2/mc-boot/GmcQuiet.cc
index d0f2f009b2a..3309f13d736 100644
--- a/gcc/m2/mc-boot/GmcQuiet.cc
+++ b/gcc/m2/mc-boot/GmcQuiet.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcQuiet.h b/gcc/m2/mc-boot/GmcQuiet.h
index 9065ff9c578..be6f4eaa001 100644
--- a/gcc/m2/mc-boot/GmcQuiet.h
+++ b/gcc/m2/mc-boot/GmcQuiet.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcQuiet_H)
# define _mcQuiet_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcReserved.cc b/gcc/m2/mc-boot/GmcReserved.cc
index a42f1b1b0ac..02132e48b4b 100644
--- a/gcc/m2/mc-boot/GmcReserved.cc
+++ b/gcc/m2/mc-boot/GmcReserved.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcReserved.h b/gcc/m2/mc-boot/GmcReserved.h
index ab844ee5c93..b7817027249 100644
--- a/gcc/m2/mc-boot/GmcReserved.h
+++ b/gcc/m2/mc-boot/GmcReserved.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcReserved_H)
# define _mcReserved_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcSearch.cc b/gcc/m2/mc-boot/GmcSearch.cc
index e1a2aa63e29..14d3e3fe0ab 100644
--- a/gcc/m2/mc-boot/GmcSearch.cc
+++ b/gcc/m2/mc-boot/GmcSearch.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcSearch.h b/gcc/m2/mc-boot/GmcSearch.h
index f4324a02436..36ed6093637 100644
--- a/gcc/m2/mc-boot/GmcSearch.h
+++ b/gcc/m2/mc-boot/GmcSearch.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcSearch_H)
# define _mcSearch_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcStack.cc b/gcc/m2/mc-boot/GmcStack.cc
index 70f937b4299..8edae475e6d 100644
--- a/gcc/m2/mc-boot/GmcStack.cc
+++ b/gcc/m2/mc-boot/GmcStack.cc
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcStack.h b/gcc/m2/mc-boot/GmcStack.h
index 70b22be94f1..476ff65fe69 100644
--- a/gcc/m2/mc-boot/GmcStack.h
+++ b/gcc/m2/mc-boot/GmcStack.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcStack_H)
# define _mcStack_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GmcStream.cc b/gcc/m2/mc-boot/GmcStream.cc
index da44d8f66a8..18430606d0f 100644
--- a/gcc/m2/mc-boot/GmcStream.cc
+++ b/gcc/m2/mc-boot/GmcStream.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GmcStream.h b/gcc/m2/mc-boot/GmcStream.h
index a156d880d54..473b05df7ac 100644
--- a/gcc/m2/mc-boot/GmcStream.h
+++ b/gcc/m2/mc-boot/GmcStream.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcStream_H)
# define _mcStream_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gmcflex.h b/gcc/m2/mc-boot/Gmcflex.h
index 9e6d4c48edf..ff14f9fdfef 100644
--- a/gcc/m2/mc-boot/Gmcflex.h
+++ b/gcc/m2/mc-boot/Gmcflex.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcflex_H)
# define _mcflex_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gmcp1.cc b/gcc/m2/mc-boot/Gmcp1.cc
index b4ccf806cb0..8971c323b67 100644
--- a/gcc/m2/mc-boot/Gmcp1.cc
+++ b/gcc/m2/mc-boot/Gmcp1.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING. If not,
see . */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/Gmcp1.h b/gcc/m2/mc-boot/Gmcp1.h
index 878d1642c62..758d8c0ae3e 100644
--- a/gcc/m2/mc-boot/Gmcp1.h
+++ b/gcc/m2/mc-boot/Gmcp1.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcp1_H)
# define _mcp1_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gmcp2.cc b/gcc/m2/mc-boot/Gmcp2.cc
index f61e42220d4..2a3a38c63ea 100644
--- a/gcc/m2/mc-boot/Gmcp2.cc
+++ b/gcc/m2/mc-boot/Gmcp2.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING. If not,
see . */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/Gmcp2.h b/gcc/m2/mc-boot/Gmcp2.h
index b483b2dc248..ec894e1ba26 100644
--- a/gcc/m2/mc-boot/Gmcp2.h
+++ b/gcc/m2/mc-boot/Gmcp2.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcp2_H)
# define _mcp2_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gmcp3.cc b/gcc/m2/mc-boot/Gmcp3.cc
index 5cb83f464e7..b5ade482801 100644
--- a/gcc/m2/mc-boot/Gmcp3.cc
+++ b/gcc/m2/mc-boot/Gmcp3.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING. If not,
see . */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/Gmcp3.h b/gcc/m2/mc-boot/Gmcp3.h
index 0e00ddcdd9b..87856ed51e1 100644
--- a/gcc/m2/mc-boot/Gmcp3.h
+++ b/gcc/m2/mc-boot/Gmcp3.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcp3_H)
# define _mcp3_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gmcp4.cc b/gcc/m2/mc-boot/Gmcp4.cc
index ce8cb78f443..869763713d6 100644
--- a/gcc/m2/mc-boot/Gmcp4.cc
+++ b/gcc/m2/mc-boot/Gmcp4.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING. If not,
see . */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/Gmcp4.h b/gcc/m2/mc-boot/Gmcp4.h
index 643b939a634..c229beb3c20 100644
--- a/gcc/m2/mc-boot/Gmcp4.h
+++ b/gcc/m2/mc-boot/Gmcp4.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcp4_H)
# define _mcp4_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gmcp5.cc b/gcc/m2/mc-boot/Gmcp5.cc
index 909c62215c8..ec241691a95 100644
--- a/gcc/m2/mc-boot/Gmcp5.cc
+++ b/gcc/m2/mc-boot/Gmcp5.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING. If not,
see . */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/Gmcp5.h b/gcc/m2/mc-boot/Gmcp5.h
index 7989101e86a..de3edb17922 100644
--- a/gcc/m2/mc-boot/Gmcp5.h
+++ b/gcc/m2/mc-boot/Gmcp5.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_mcp5_H)
# define _mcp5_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GnameKey.cc b/gcc/m2/mc-boot/GnameKey.cc
index 3e868886e29..8f4a330d0d9 100644
--- a/gcc/m2/mc-boot/GnameKey.cc
+++ b/gcc/m2/mc-boot/GnameKey.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GnameKey.h b/gcc/m2/mc-boot/GnameKey.h
index a2ea330b063..d4cce1b6bd3 100644
--- a/gcc/m2/mc-boot/GnameKey.h
+++ b/gcc/m2/mc-boot/GnameKey.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_nameKey_H)
# define _nameKey_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/GsymbolKey.cc b/gcc/m2/mc-boot/GsymbolKey.cc
index 17072597304..50b8c8f56c3 100644
--- a/gcc/m2/mc-boot/GsymbolKey.cc
+++ b/gcc/m2/mc-boot/GsymbolKey.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/GsymbolKey.h b/gcc/m2/mc-boot/GsymbolKey.h
index 69670985516..5d05977e50a 100644
--- a/gcc/m2/mc-boot/GsymbolKey.h
+++ b/gcc/m2/mc-boot/GsymbolKey.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_symbolKey_H)
# define _symbolKey_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gtermios.h b/gcc/m2/mc-boot/Gtermios.h
index acb7fcf0c76..70c0c49948e 100644
--- a/gcc/m2/mc-boot/Gtermios.h
+++ b/gcc/m2/mc-boot/Gtermios.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_termios_H)
# define _termios_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gtop.cc b/gcc/m2/mc-boot/Gtop.cc
index dfefe42c1da..1a8597a0426 100644
--- a/gcc/m2/mc-boot/Gtop.cc
+++ b/gcc/m2/mc-boot/Gtop.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/Gvarargs.cc b/gcc/m2/mc-boot/Gvarargs.cc
index 69f5f2c5756..32f984d24fc 100644
--- a/gcc/m2/mc-boot/Gvarargs.cc
+++ b/gcc/m2/mc-boot/Gvarargs.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/Gvarargs.h b/gcc/m2/mc-boot/Gvarargs.h
index 82b5b753ba1..8e3e91a1c42 100644
--- a/gcc/m2/mc-boot/Gvarargs.h
+++ b/gcc/m2/mc-boot/Gvarargs.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_varargs_H)
# define _varargs_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gwlists.cc b/gcc/m2/mc-boot/Gwlists.cc
index 87daa42c3ef..9262329e77a 100644
--- a/gcc/m2/mc-boot/Gwlists.cc
+++ b/gcc/m2/mc-boot/Gwlists.cc
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3. If not see
. */
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
#include
diff --git a/gcc/m2/mc-boot/Gwlists.h b/gcc/m2/mc-boot/Gwlists.h
index 05d65945b58..53bad73339a 100644
--- a/gcc/m2/mc-boot/Gwlists.h
+++ b/gcc/m2/mc-boot/Gwlists.h
@@ -24,6 +24,7 @@ along with GNU Modula-2; see the file COPYING3. If not see
#if !defined (_wlists_H)
# define _wlists_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc-boot/Gwrapc.h b/gcc/m2/mc-boot/Gwrapc.h
index e4db1e2a99f..fdbeabcdade 100644
--- a/gcc/m2/mc-boot/Gwrapc.h
+++ b/gcc/m2/mc-boot/Gwrapc.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_wrapc_H)
# define _wrapc_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
diff --git a/gcc/m2/mc/keyc.mod b/gcc/m2/mc/keyc.mod
index f3f09309ad5..a182e120692 100644
--- a/gcc/m2/mc/keyc.mod
+++ b/gcc/m2/mc/keyc.mod
@@ -95,6 +95,7 @@ BEGIN
IF NOT initializedGCC
THEN
initializedGCC := TRUE ;
+ print (p, '#define INCLUDE_MEMORY\n');
print (p, '#include "config.h"\n');
print (p, '#include "system.h"\n');
checkGccTypes (p)
diff --git a/gcc/m2/pge-boot/GASCII.cc b/gcc/m2/pge-boot/GASCII.cc
index 19e98ede436..21b621105a9 100644
--- a/gcc/m2/pge-boot/GASCII.cc
+++ b/gcc/m2/pge-boot/GASCII.cc
@@ -32,9 +32,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
typedef struct { PROC_t proc; } PROC;
# endif
-#define _ASCII_H
#define _ASCII_C
+#include "GASCII.h"
# define ASCII_nul (char) 000
# define ASCII_soh (char) 001
diff --git a/gcc/m2/pge-boot/GASCII.h b/gcc/m2/pge-boot/GASCII.h
index c157a8b7686..6346caa1189 100644
--- a/gcc/m2/pge-boot/GASCII.h
+++ b/gcc/m2/pge-boot/GASCII.h
@@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_ASCII_H)
# define _ASCII_H
-#include "config.h"
-#include "system.h"
# ifdef __cplusplus
extern "C" {
# endif
diff --git a/gcc/m2/pge-boot/GArgs.cc b/gcc/m2/pge-boot/GArgs.cc
index 284567d750a..c295985178d 100644
--- a/gcc/m2/pge-boot/GArgs.cc
+++ b/gcc/m2/pge-boot/GArgs.cc
@@ -32,9 +32,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
typedef struct { PROC_t proc; } PROC;
# endif
-#define _Args_H
#define _Args_C
+#include "GArgs.h"
# include "GUnixArgs.h"
# include "GASCII.h"
@@ -84,13 +84,13 @@ extern "C" bool Args_GetArg (char *a, unsigned int _a_high, unsigned int n)
Source = static_cast (UnixArgs_GetArgV ());
while ((j < High) && ((*(*Source).array[i]).array[j] != ASCII_nul))
{
- a[j] = (*(*Source).array[i]).array[j];
+ const_cast(a)[j] = (*(*Source).array[i]).array[j];
j += 1;
}
}
if (j <= High)
{
- a[j] = ASCII_nul;
+ const_cast(a)[j] = ASCII_nul;
}
return i < (UnixArgs_GetArgC ());
/* static analysis guarentees a RETURN statement will be used before here. */
diff --git a/gcc/m2/pge-boot/GArgs.h b/gcc/m2/pge-boot/GArgs.h
index 1171cef8d72..b912da63c7c 100644
--- a/gcc/m2/pge-boot/GArgs.h
+++ b/gcc/m2/pge-boot/GArgs.h
@@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_Args_H)
# define _Args_H
-#include "config.h"
-#include "system.h"
# ifdef __cplusplus
extern "C" {
# endif
diff --git a/gcc/m2/pge-boot/GAssertion.cc b/gcc/m2/pge-boot/GAssertion.cc
index 3dae36d748a..8aad1cd5557 100644
--- a/gcc/m2/pge-boot/GAssertion.cc
+++ b/gcc/m2/pge-boot/GAssertion.cc
@@ -32,9 +32,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
typedef struct { PROC_t proc; } PROC;
# endif
-#define _Assertion_H
#define _Assertion_C
+#include "GAssertion.h"
# include "GStrIO.h"
# include "GM2RTS.h"
diff --git a/gcc/m2/pge-boot/GAssertion.h b/gcc/m2/pge-boot/GAssertion.h
index d909fdee7a3..9e0777fc60b 100644
--- a/gcc/m2/pge-boot/GAssertion.h
+++ b/gcc/m2/pge-boot/GAssertion.h
@@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_Assertion_H)
# define _Assertion_H
-#include "config.h"
-#include "system.h"
# ifdef __cplusplus
extern "C" {
# endif
diff --git a/gcc/m2/pge-boot/GBreak.h b/gcc/m2/pge-boot/GBreak.h
index bd2f1ccf6f1..635d82cfbe3 100644
--- a/gcc/m2/pge-boot/GBreak.h
+++ b/gcc/m2/pge-boot/GBreak.h
@@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_Break_H)
# define _Break_H
-#include "config.h"
-#include "system.h"
# ifdef __cplusplus
extern "C" {
# endif
diff --git a/gcc/m2/pge-boot/GCmdArgs.h b/gcc/m2/pge-boot/GCmdArgs.h
index 7f39815bc09..c7b3dd22d46 100644
--- a/gcc/m2/pge-boot/GCmdArgs.h
+++ b/gcc/m2/pge-boot/GCmdArgs.h
@@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_CmdArgs_H)
# define _CmdArgs_H
-#include "config.h"
-#include "system.h"
# ifdef __cplusplus
extern "C" {
# endif
diff --git a/gcc/m2/pge-boot/GDebug.cc b/gcc/m2/pge-boot/GDebug.cc
index deb7f9e7aeb..91dd96046a4 100644
--- a/gcc/m2/pge-boot/GDebug.cc
+++ b/gcc/m2/pge-boot/GDebug.cc
@@ -34,9 +34,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include
#include
-#define _Debug_H
#define _Debug_C
+#include "GDebug.h"
# include "GASCII.h"
# include "GNumberIO.h"
# include "GStdIO.h"
diff --git a/gcc/m2/pge-boot/GDebug.h b/gcc/m2/pge-boot/GDebug.h
index 8787752b9a3..c853211e16e 100644
--- a/gcc/m2/pge-boot/GDebug.h
+++ b/gcc/m2/pge-boot/GDebug.h
@@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_Debug_H)
# define _Debug_H
-#include "config.h"
-#include "system.h"
# ifdef __cplusplus
extern "C" {
# endif
diff --git a/gcc/m2/pge-boot/GDynamicStrings.cc b/gcc/m2/pge-boot/GDynamicStrings.cc
index 32969692985..d6f5f83ad5b 100644
--- a/gcc/m2/pge-boot/GDynamicStrings.cc
+++ b/gcc/m2/pge-boot/GDynamicStrings.cc
@@ -25,8 +25,6 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
-#include "config.h"
-#include "system.h"
#include
# if !defined (PROC_D)
# define PROC_D
@@ -42,7 +40,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# define FALSE (1==0)
# endif
+#include
+#include
+#include
+#include
# include "GStorage.h"
+#include
#if defined(__cplusplus)
# undef NULL
# define NULL 0
@@ -2064,7 +2067,7 @@ extern "C" DynamicStrings_String DynamicStrings_Slice (DynamicStrings_String s,
DynamicStrings_String__opaque d;
DynamicStrings_String__opaque t;
int start;
- int end;
+ int stop;
int o;
if (PoisonOn)
@@ -2107,7 +2110,7 @@ extern "C" DynamicStrings_String DynamicStrings_Slice (DynamicStrings_String s,
{
start = low-o;
}
- end = Max (Min (MaxBuf, static_cast (high-o)), 0);
+ stop = Max (Min (MaxBuf, static_cast (high-o)), 0);
while (t->contents.len == MaxBuf)
{
if (t->contents.next == NULL)
@@ -2123,7 +2126,7 @@ extern "C" DynamicStrings_String DynamicStrings_Slice (DynamicStrings_String s,
}
t = t->contents.next;
}
- ConcatContentsAddress (&t->contents, &static_cast (s)->contents.buf.array[start], static_cast (end-start));
+ ConcatContentsAddress (&t->contents, &static_cast (s)->contents.buf.array[start], static_cast (stop-start));
o += static_cast (s)->contents.len;
s = static_cast (static_cast (s)->contents.next);
}
diff --git a/gcc/m2/pge-boot/GDynamicStrings.h b/gcc/m2/pge-boot/GDynamicStrings.h
index e0652a7d3bd..4d77cecc591 100644
--- a/gcc/m2/pge-boot/GDynamicStrings.h
+++ b/gcc/m2/pge-boot/GDynamicStrings.h
@@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_DynamicStrings_H)
# define _DynamicStrings_H
-#include "config.h"
-#include "system.h"
# ifdef __cplusplus
extern "C" {
# endif
diff --git a/gcc/m2/pge-boot/GEnvironment.h b/gcc/m2/pge-boot/GEnvironment.h
index 4f94d583334..4645a495415 100644
--- a/gcc/m2/pge-boot/GEnvironment.h
+++ b/gcc/m2/pge-boot/GEnvironment.h
@@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_Environment_H)
# define _Environment_H
-#include "config.h"
-#include "system.h"
# ifdef __cplusplus
extern "C" {
# endif
diff --git a/gcc/m2/pge-boot/GFIO.cc b/gcc/m2/pge-boot/GFIO.cc
index 3e56792f20f..b30d969e11f 100644
--- a/gcc/m2/pge-boot/GFIO.cc
+++ b/gcc/m2/pge-boot/GFIO.cc
@@ -52,9 +52,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# undef NULL
# define NULL 0
#endif
-#define _FIO_H
#define _FIO_C
+#include "GFIO.h"
# include "GSYSTEM.h"
# include "GASCII.h"
# include "GStrLib.h"
@@ -67,9 +67,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
typedef unsigned int FIO_File;
-FIO_File FIO_StdErr;
-FIO_File FIO_StdOut;
-FIO_File FIO_StdIn;
# define MaxBufferLength (1024*16)
# define MaxErrorString (1024*8)
# define CreatePermissions 0666
@@ -643,7 +640,7 @@ static FIO_File InitializeFile (FIO_File f, void * fname, unsigned int flength,
{
fd->buffer->left = 0;
}
- fd->buffer->contents = reinterpret_cast (fd->buffer->address); /* provides easy access for reading characters */
+ fd->buffer->contents = static_cast (fd->buffer->address); /* provides easy access for reading characters */
fd->state = fstate; /* provides easy access for reading characters */
}
}
@@ -917,7 +914,7 @@ static void HandleEscape (char *dest, unsigned int _dest_high, const char *src_,
if (src[(*i)+1] == 'n')
{
/* requires a newline */
- dest[(*j)] = ASCII_nl;
+ const_cast(dest)[(*j)] = ASCII_nl;
(*j) += 1;
(*i) += 2;
}
@@ -925,7 +922,7 @@ static void HandleEscape (char *dest, unsigned int _dest_high, const char *src_,
{
/* avoid dangling else. */
/* requires a tab (yuck) tempted to fake this but I better not.. */
- dest[(*j)] = ASCII_tab;
+ const_cast(dest)[(*j)] = ASCII_tab;
(*j) += 1;
(*i) += 2;
}
@@ -934,7 +931,7 @@ static void HandleEscape (char *dest, unsigned int _dest_high, const char *src_,
/* avoid dangling else. */
/* copy escaped character */
(*i) += 1;
- dest[(*j)] = src[(*i)];
+ const_cast(dest)[(*j)] = src[(*i)];
(*j) += 1;
(*i) += 1;
}
@@ -958,7 +955,7 @@ static void Cast (unsigned char *a, unsigned int _a_high, const unsigned char *b
{
for (i=0; i<=_a_high; i++)
{
- a[i] = b[i];
+ const_cast(a)[i] = b[i];
}
}
else
@@ -1008,7 +1005,7 @@ static void StringFormat1 (char *dest, unsigned int _dest_high, const char *src_
}
else
{
- dest[j] = src[i];
+ const_cast(dest)[j] = src[i];
i += 1;
j += 1;
}
@@ -1021,13 +1018,13 @@ static void StringFormat1 (char *dest, unsigned int _dest_high, const char *src_
Cast ((unsigned char *) &p, (sizeof (p)-1), (const unsigned char *) w, _w_high);
while ((j < HighDest) && ((*p) != ASCII_nul))
{
- dest[j] = (*p);
+ const_cast(dest)[j] = (*p);
j += 1;
p += 1;
}
if (j < HighDest)
{
- dest[j] = ASCII_nul;
+ const_cast(dest)[j] = ASCII_nul;
}
j = StrLib_StrLen ((const char *) dest, _dest_high);
i += 2;
@@ -1035,7 +1032,7 @@ static void StringFormat1 (char *dest, unsigned int _dest_high, const char *src_
else if (src[i+1] == 'd')
{
/* avoid dangling else. */
- dest[j] = ASCII_nul;
+ const_cast(dest)[j] = ASCII_nul;
Cast ((unsigned char *) &c, (sizeof (c)-1), (const unsigned char *) w, _w_high);
NumberIO_CardToStr (c, 0, (char *) &str.array[0], MaxErrorString);
StrLib_StrConCat ((const char *) dest, _dest_high, (const char *) &str.array[0], MaxErrorString, (char *) dest, _dest_high);
@@ -1045,7 +1042,7 @@ static void StringFormat1 (char *dest, unsigned int _dest_high, const char *src_
else
{
/* avoid dangling else. */
- dest[j] = src[i];
+ const_cast(dest)[j] = src[i];
i += 1;
j += 1;
}
@@ -1059,14 +1056,14 @@ static void StringFormat1 (char *dest, unsigned int _dest_high, const char *src_
}
else
{
- dest[j] = src[i];
+ const_cast(dest)[j] = src[i];
i += 1;
j += 1;
}
}
if (j < HighDest)
{
- dest[j] = ASCII_nul;
+ const_cast(dest)[j] = ASCII_nul;
}
}
@@ -1316,7 +1313,7 @@ static void PreInitialize (FIO_File f, const char *fname_, unsigned int _fname_h
/* make a local copy of each unbounded array. */
memcpy (fname, fname_, _fname_high+1);
- if ((InitializeFile (f, &fname, StrLib_StrLen ((const char *) fname, _fname_high), state, use, towrite, bufsize)) == f)
+ if ((InitializeFile (f, const_cast (static_cast(fname)), StrLib_StrLen ((const char *) fname, _fname_high), state, use, towrite, bufsize)) == f)
{
fd = static_cast (Indexing_GetIndice (FileInfo, f));
if (f == Error)
@@ -1418,7 +1415,7 @@ extern "C" bool FIO_Exists (const char *fname_, unsigned int _fname_high)
/*
The following functions are wrappers for the above.
*/
- return FIO_exists (&fname, StrLib_StrLen ((const char *) fname, _fname_high));
+ return FIO_exists (const_cast (static_cast(fname)), StrLib_StrLen ((const char *) fname, _fname_high));
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -1430,7 +1427,7 @@ extern "C" FIO_File FIO_OpenToRead (const char *fname_, unsigned int _fname_high
/* make a local copy of each unbounded array. */
memcpy (fname, fname_, _fname_high+1);
- return FIO_openToRead (&fname, StrLib_StrLen ((const char *) fname, _fname_high));
+ return FIO_openToRead (const_cast (static_cast(fname)), StrLib_StrLen ((const char *) fname, _fname_high));
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -1442,7 +1439,7 @@ extern "C" FIO_File FIO_OpenToWrite (const char *fname_, unsigned int _fname_hig
/* make a local copy of each unbounded array. */
memcpy (fname, fname_, _fname_high+1);
- return FIO_openToWrite (&fname, StrLib_StrLen ((const char *) fname, _fname_high));
+ return FIO_openToWrite (const_cast (static_cast(fname)), StrLib_StrLen ((const char *) fname, _fname_high));
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -1454,7 +1451,7 @@ extern "C" FIO_File FIO_OpenForRandom (const char *fname_, unsigned int _fname_h
/* make a local copy of each unbounded array. */
memcpy (fname, fname_, _fname_high+1);
- return FIO_openForRandom (&fname, StrLib_StrLen ((const char *) fname, _fname_high), towrite, newfile);
+ return FIO_openForRandom (const_cast (static_cast(fname)), StrLib_StrLen ((const char *) fname, _fname_high), towrite, newfile);
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -1970,7 +1967,7 @@ extern "C" void FIO_WriteString (FIO_File f, const char *a_, unsigned int _a_hig
memcpy (a, a_, _a_high+1);
l = StrLib_StrLen ((const char *) a, _a_high);
- if ((FIO_WriteNBytes (f, l, &a)) != l)
+ if ((FIO_WriteNBytes (f, l, const_cast (static_cast(a)))) != l)
{} /* empty. */
}
@@ -1997,12 +1994,12 @@ extern "C" void FIO_ReadString (FIO_File f, char *a, unsigned int _a_high)
/* avoid gcc warning by using compound statement even if not strictly necessary. */
if (((ch == ASCII_nl) || (! (FIO_IsNoError (f)))) || (FIO_EOF (f)))
{
- a[i] = ASCII_nul;
+ const_cast(a)[i] = ASCII_nul;
i += 1;
}
else
{
- a[i] = ch;
+ const_cast(a)[i] = ch;
i += 1;
}
}
@@ -2226,7 +2223,7 @@ extern "C" void FIO_GetFileName (FIO_File f, char *a, unsigned int _a_high)
i = 0;
while (((*p) != ASCII_nul) && (i <= _a_high))
{
- a[i] = (*p);
+ const_cast(a)[i] = (*p);
p += 1;
i += 1;
}
diff --git a/gcc/m2/pge-boot/GFIO.h b/gcc/m2/pge-boot/GFIO.h
index d82396449ff..160fadee5dd 100644
--- a/gcc/m2/pge-boot/GFIO.h
+++ b/gcc/m2/pge-boot/GFIO.h
@@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_FIO_H)
# define _FIO_H
-#include "config.h"
-#include "system.h"
# ifdef __cplusplus
extern "C" {
# endif
diff --git a/gcc/m2/pge-boot/GFormatStrings.h b/gcc/m2/pge-boot/GFormatStrings.h
index 1d8ce34ce62..61f738bb323 100644
--- a/gcc/m2/pge-boot/GFormatStrings.h
+++ b/gcc/m2/pge-boot/GFormatStrings.h
@@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_FormatStrings_H)
# define _FormatStrings_H
-#include "config.h"
-#include "system.h"
# ifdef __cplusplus
extern "C" {
# endif
diff --git a/gcc/m2/pge-boot/GFpuIO.h b/gcc/m2/pge-boot/GFpuIO.h
index 5d830606130..70cc45dfcb5 100644
--- a/gcc/m2/pge-boot/GFpuIO.h
+++ b/gcc/m2/pge-boot/GFpuIO.h
@@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_FpuIO_H)
# define _FpuIO_H
-#include "config.h"
-#include "system.h"
# ifdef __cplusplus
extern "C" {
# endif
diff --git a/gcc/m2/pge-boot/GIO.cc b/gcc/m2/pge-boot/GIO.cc
index 7d391bb72ff..9f781b5a0d6 100644
--- a/gcc/m2/pge-boot/GIO.cc
+++ b/gcc/m2/pge-boot/GIO.cc
@@ -42,9 +42,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include
#include
-#define _IO_H
#define _IO_C
+#include "GIO.h"
# include "GStrLib.h"
# include "GSYSTEM.h"
# include "Glibc.h"
diff --git a/gcc/m2/pge-boot/GIO.h b/gcc/m2/pge-boot/GIO.h
index 4f4af9a59a0..ae16019fb70 100644
--- a/gcc/m2/pge-boot/GIO.h
+++ b/gcc/m2/pge-boot/GIO.h
@@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_IO_H)
# define _IO_H
-#include "config.h"
-#include "system.h"
# ifdef __cplusplus
extern "C" {
# endif
diff --git a/gcc/m2/pge-boot/GIndexing.cc b/gcc/m2/pge-boot/GIndexing.cc
index 21e3a43a8c8..fa7837c1dd2 100644
--- a/gcc/m2/pge-boot/GIndexing.cc
+++ b/gcc/m2/pge-boot/GIndexing.cc
@@ -48,9 +48,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# undef NULL
# define NULL 0
#endif
-#define _Indexing_H
#define _Indexing_C
+#include "GIndexing.h"
# include "Glibc.h"
# include "GStorage.h"
# include "GSYSTEM.h"
@@ -66,10 +66,7 @@ typedef void * *Indexing_PtrToAddress;
typedef unsigned char *Indexing_PtrToByte;
-typedef Indexing__T2 *Indexing_Index;
-
-typedef void (*Indexing_IndexProcedure_t) (void *);
-struct Indexing_IndexProcedure_p { Indexing_IndexProcedure_t proc; };
+typedef Indexing__T2 *Indexing_Index__opaque;
struct Indexing__T2_r {
void *ArrayStart;
@@ -178,6 +175,13 @@ extern "C" void Indexing_ForeachIndiceInIndexDo (Indexing_Index i, Indexing_Inde
extern "C" bool Indexing_IsEmpty (Indexing_Index i);
+/*
+ FindIndice - returns the indice containing a.
+ It returns zero if a is not found in array i.
+*/
+
+extern "C" unsigned int Indexing_FindIndice (Indexing_Index i, void * a);
+
/*
InitIndexTuned - creates a dynamic array with low indice.
@@ -188,7 +192,7 @@ extern "C" bool Indexing_IsEmpty (Indexing_Index i);
extern "C" Indexing_Index Indexing_InitIndexTuned (unsigned int low, unsigned int minsize, unsigned int growfactor)
{
- Indexing_Index i;
+ Indexing_Index__opaque i;
Storage_ALLOCATE ((void **) &i, sizeof (Indexing__T2));
i->Low = low;
@@ -200,7 +204,7 @@ extern "C" Indexing_Index Indexing_InitIndexTuned (unsigned int low, unsigned in
i->Used = 0;
i->Map = (unsigned int) 0;
i->GrowFactor = growfactor;
- return i;
+ return static_cast (i);
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -224,9 +228,9 @@ extern "C" Indexing_Index Indexing_InitIndex (unsigned int low)
extern "C" Indexing_Index Indexing_KillIndex (Indexing_Index i)
{
- Storage_DEALLOCATE (&i->ArrayStart, i->ArraySize);
+ Storage_DEALLOCATE (&static_cast (i)->ArrayStart, static_cast (i)->ArraySize);
Storage_DEALLOCATE ((void **) &i, sizeof (Indexing__T2));
- return NULL;
+ return static_cast (NULL);
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
@@ -238,7 +242,7 @@ extern "C" Indexing_Index Indexing_KillIndex (Indexing_Index i)
extern "C" Indexing_Index Indexing_DebugIndex (Indexing_Index i)
{
- i->Debug = true;
+ static_cast (i)->Debug = true;
return i;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
@@ -259,7 +263,7 @@ extern "C" bool Indexing_InBounds (Indexing_Index i, unsigned int n)
}
else
{
- return (n >= i->Low) && (n <= i->High);
+ return (n >= static_cast (i)->Low) && (n <= static_cast (i)->High);
}
ReturnException ("../../gcc/m2/gm2-libs/Indexing.def", 25, 1);
__builtin_unreachable ();
@@ -279,7 +283,7 @@ extern "C" unsigned int Indexing_HighIndice (Indexing_Index i)
}
else
{
- return i->High;
+ return static_cast (i)->High;
}
ReturnException ("../../gcc/m2/gm2-libs/Indexing.def", 25, 1);
__builtin_unreachable ();
@@ -299,7 +303,7 @@ extern "C" unsigned int Indexing_LowIndice (Indexing_Index i)
}
else
{
- return i->Low;
+ return static_cast (i)->Low;
}
ReturnException ("../../gcc/m2/gm2-libs/Indexing.def", 25, 1);
__builtin_unreachable ();
@@ -321,19 +325,19 @@ extern "C" void Indexing_PutIndice (Indexing_Index i, unsigned int n, void * a)
if (! (Indexing_InBounds (i, n)))
{
/* avoid gcc warning by using compound statement even if not strictly necessary. */
- if (n < i->Low)
+ if (n < static_cast (i)->Low)
{
M2RTS_HALT (-1);
__builtin_unreachable ();
}
else
{
- oldSize = i->ArraySize;
- while (((n-i->Low)*sizeof (void *)) >= i->ArraySize)
+ oldSize = static_cast (i)->ArraySize;
+ while (((n-static_cast (i)->Low)*sizeof (void *)) >= static_cast (i)->ArraySize)
{
- i->ArraySize = i->ArraySize*i->GrowFactor;
+ static_cast (i)->ArraySize = static_cast (i)->ArraySize*static_cast (i)->GrowFactor;
}
- if (oldSize != i->ArraySize)
+ if (oldSize != static_cast (i)->ArraySize)
{
/*
IF Debug
@@ -343,25 +347,25 @@ extern "C" void Indexing_PutIndice (Indexing_Index i, unsigned int n, void * a)
oldSize, ArraySize)
END ;
*/
- Storage_REALLOCATE (&i->ArrayStart, i->ArraySize);
+ Storage_REALLOCATE (&static_cast (i)->ArrayStart, static_cast (i)->ArraySize);
/* and initialize the remainder of the array to NIL */
- b = i->ArrayStart;
+ b = static_cast (i)->ArrayStart;
b = reinterpret_cast (reinterpret_cast (b)+oldSize);
- b = libc_memset (b, 0, static_cast (i->ArraySize-oldSize));
+ b = libc_memset (b, 0, static_cast (static_cast (i)->ArraySize-oldSize));
}
- i->High = n;
+ static_cast (i)->High = n;
}
}
- b = i->ArrayStart;
- b = reinterpret_cast (reinterpret_cast (b)+(n-i->Low)*sizeof (void *));
+ b = static_cast (i)->ArrayStart;
+ b = reinterpret_cast (reinterpret_cast (b)+(n-static_cast (i)->Low)*sizeof (void *));
p = static_cast (b);
- (*p) = reinterpret_cast (a);
- i->Used += 1;
- if (i->Debug)
+ (*p) = static_cast (a);
+ static_cast (i)->Used += 1;
+ if (static_cast (i)->Debug)
{
if (n < 32)
{
- i->Map |= (1 << (n ));
+ static_cast (i)->Map |= (1 << (n ));
}
}
}
@@ -381,12 +385,12 @@ extern "C" void * Indexing_GetIndice (Indexing_Index i, unsigned int n)
M2RTS_HALT (-1);
__builtin_unreachable ();
}
- b = static_cast (i->ArrayStart);
- b += (n-i->Low)*sizeof (void *);
+ b = static_cast (static_cast (i)->ArrayStart);
+ b += (n-static_cast (i)->Low)*sizeof (void *);
p = (Indexing_PtrToAddress) (b);
- if (i->Debug)
+ if (static_cast (i)->Debug)
{
- if (((n < 32) && (! ((((1 << (n)) & (i->Map)) != 0)))) && ((*p) != NULL))
+ if (((n < 32) && (! ((((1 << (n)) & (static_cast (i)->Map)) != 0)))) && ((*p) != NULL))
{
M2RTS_HALT (-1);
__builtin_unreachable ();
@@ -408,9 +412,9 @@ extern "C" bool Indexing_IsIndiceInIndex (Indexing_Index i, void * a)
Indexing_PtrToByte b;
Indexing_PtrToAddress p;
- j = i->Low;
- b = static_cast (i->ArrayStart);
- while (j <= i->High)
+ j = static_cast (i)->Low;
+ b = static_cast (static_cast (i)->ArrayStart);
+ while (j <= static_cast (i)->High)
{
p = (Indexing_PtrToAddress) (b);
if ((*p) == a)
@@ -437,9 +441,9 @@ extern "C" void Indexing_RemoveIndiceFromIndex (Indexing_Index i, void * a)
Indexing_PtrToAddress p;
Indexing_PtrToByte b;
- j = i->Low;
- b = static_cast (i->ArrayStart);
- while (j <= i->High)
+ j = static_cast (i)->Low;
+ b = static_cast (static_cast (i)->ArrayStart);
+ while (j <= static_cast (i)->High)
{
p = (Indexing_PtrToAddress) (b);
b += sizeof (void *);
@@ -463,13 +467,13 @@ extern "C" void Indexing_DeleteIndice (Indexing_Index i, unsigned int j)
if (Indexing_InBounds (i, j))
{
- b = static_cast (i->ArrayStart);
- b += sizeof (void *)*(j-i->Low);
+ b = static_cast (static_cast (i)->ArrayStart);
+ b += sizeof (void *)*(j-static_cast (i)->Low);
p = (Indexing_PtrToAddress) (b);
b += sizeof (void *);
- p = static_cast (libc_memmove (reinterpret_cast (p), reinterpret_cast (b), static_cast ((i->High-j)*sizeof (void *))));
- i->High -= 1;
- i->Used -= 1;
+ p = static_cast (libc_memmove (reinterpret_cast (p), reinterpret_cast (b), static_cast ((static_cast (i)->High-j)*sizeof (void *))));
+ static_cast (i)->High -= 1;
+ static_cast (i)->Used -= 1;
}
else
{
@@ -489,7 +493,7 @@ extern "C" void Indexing_IncludeIndiceIntoIndex (Indexing_Index i, void * a)
if (! (Indexing_IsIndiceInIndex (i, a)))
{
/* avoid gcc warning by using compound statement even if not strictly necessary. */
- if (i->Used == 0)
+ if (static_cast (i)->Used == 0)
{
Indexing_PutIndice (i, Indexing_LowIndice (i), a);
}
@@ -524,7 +528,36 @@ extern "C" void Indexing_ForeachIndiceInIndexDo (Indexing_Index i, Indexing_Inde
extern "C" bool Indexing_IsEmpty (Indexing_Index i)
{
- return i->Used == 0;
+ return static_cast (i)->Used == 0;
+ /* static analysis guarentees a RETURN statement will be used before here. */
+ __builtin_unreachable ();
+}
+
+
+/*
+ FindIndice - returns the indice containing a.
+ It returns zero if a is not found in array i.
+*/
+
+extern "C" unsigned int Indexing_FindIndice (Indexing_Index i, void * a)
+{
+ unsigned int j;
+ Indexing_PtrToAddress p;
+ Indexing_PtrToByte b;
+
+ j = static_cast (i)->Low;
+ b = static_cast (static_cast (i)->ArrayStart);
+ while (j <= static_cast (i)->High)
+ {
+ p = (Indexing_PtrToAddress) (b);
+ b += sizeof (void *);
+ if ((*p) == a)
+ {
+ return j;
+ }
+ j += 1;
+ }
+ return 0;
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
}
diff --git a/gcc/m2/pge-boot/GIndexing.h b/gcc/m2/pge-boot/GIndexing.h
index d65e8bd91dd..264e60ef4cf 100644
--- a/gcc/m2/pge-boot/GIndexing.h
+++ b/gcc/m2/pge-boot/GIndexing.h
@@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if !defined (_Indexing_H)
# define _Indexing_H
+#define INCLUDE_MEMORY
#include "config.h"
#include "system.h"
# ifdef __cplusplus
@@ -154,6 +155,13 @@ EXTERN void Indexing_ForeachIndiceInIndexDo (Indexing_Index i, Indexing_IndexPro
*/
EXTERN bool Indexing_IsEmpty (Indexing_Index i);
+
+/*
+ FindIndice - returns the indice containing a.
+ It returns zero if a is not found in array i.
+*/
+
+EXTERN unsigned int Indexing_FindIndice (Indexing_Index i, void * a);
# ifdef __cplusplus
}
# endif
diff --git a/gcc/m2/pge-boot/GLists.cc b/gcc/m2/pge-boot/GLists.cc
index 4b15e2068f8..b49dda72382 100644
--- a/gcc/m2/pge-boot/GLists.cc
+++ b/gcc/m2/pge-boot/GLists.cc
@@ -41,9 +41,9 @@ along with GNU Modula-2; see the file COPYING3. If not see
# undef NULL
# define NULL 0
#endif
-#define _Lists_H
#define _Lists_C
+#include "GLists.h"
# include "GStorage.h"
typedef struct SymbolKey_PerformOperation_p SymbolKey_PerformOperation;
@@ -53,16 +53,13 @@ typedef struct Lists_list_r Lists_list;
typedef struct Lists__T1_a Lists__T1;
-typedef Lists_list *Lists_List;
-
-typedef void (*SymbolKey_PerformOperation_t) (unsigned int);
-struct SymbolKey_PerformOperation_p { SymbolKey_PerformOperation_t proc; };
+typedef Lists_list *Lists_List__opaque;
struct Lists__T1_a { unsigned int array[MaxNoOfElements-1+1]; };
struct Lists_list_r {
unsigned int NoOfElements;
Lists__T1 Elements;
- Lists_List Next;
+ Lists_List__opaque Next;
};
@@ -136,14 +133,14 @@ extern "C" Lists_List Lists_DuplicateList (Lists_List l);
RemoveItem - remove an element at index, i, from the list data type.
*/
-static void RemoveItem (Lists_List p, Lists_List l, unsigned int i);
+static void RemoveItem (Lists_List__opaque p, Lists_List__opaque l, unsigned int i);
/*
RemoveItem - remove an element at index, i, from the list data type.
*/
-static void RemoveItem (Lists_List p, Lists_List l, unsigned int i)
+static void RemoveItem (Lists_List__opaque p, Lists_List__opaque l, unsigned int i)
{
l->NoOfElements -= 1;
while (i <= l->NoOfElements)
@@ -166,8 +163,8 @@ static void RemoveItem (Lists_List p, Lists_List l, unsigned int i)
extern "C" void Lists_InitList (Lists_List *l)
{
Storage_ALLOCATE ((void **) &(*l), sizeof (Lists_list));
- (*l)->NoOfElements = 0;
- (*l)->Next = NULL;
+ static_cast ((*l))->NoOfElements = 0;
+ static_cast ((*l))->Next = static_cast (NULL);
}
@@ -179,9 +176,9 @@ extern "C" void Lists_KillList (Lists_List *l)
{
if ((*l) != NULL)
{
- if ((*l)->Next != NULL)
+ if (static_cast ((*l))->Next != NULL)
{
- Lists_KillList (&(*l)->Next);
+ Lists_KillList (reinterpret_cast (&static_cast ((*l))->Next));
}
Storage_DEALLOCATE ((void **) &(*l), sizeof (Lists_list));
}
@@ -194,21 +191,21 @@ extern "C" void Lists_KillList (Lists_List *l)
extern "C" void Lists_PutItemIntoList (Lists_List l, unsigned int c)
{
- if (l->NoOfElements < MaxNoOfElements)
+ if (static_cast (l)->NoOfElements < MaxNoOfElements)
{
- l->NoOfElements += 1;
- l->Elements.array[l->NoOfElements-1] = c;
+ static_cast (l)->NoOfElements += 1;
+ static_cast (l)->Elements.array[static_cast (l)->NoOfElements-1] = c;
}
- else if (l->Next != NULL)
+ else if (static_cast (l)->Next != NULL)
{
/* avoid dangling else. */
- Lists_PutItemIntoList (l->Next, c);
+ Lists_PutItemIntoList (static_cast (static_cast (l)->Next), c);
}
else
{
/* avoid dangling else. */
- Lists_InitList (&l->Next);
- Lists_PutItemIntoList (l->Next, c);
+ Lists_InitList (reinterpret_cast (&static_cast (l)->Next));
+ Lists_PutItemIntoList (static_cast (static_cast (l)->Next), c);
}
}
@@ -217,15 +214,15 @@ extern "C" unsigned int Lists_GetItemFromList (Lists_List l, unsigned int n)
/* iterative solution */
while (l != NULL)
{
- if (n <= l->NoOfElements)
+ if (n <= static_cast (l)->NoOfElements)
{
- return l->Elements.array[n-1];
+ return static_cast (l)->Elements.array[n-1];
}
else
{
- n -= l->NoOfElements;
+ n -= static_cast (l)->NoOfElements;
}
- l = l->Next;
+ l = static_cast (static_cast (l)->Next);
}
return static_cast (0);
/* static analysis guarentees a RETURN statement will be used before here. */
@@ -250,9 +247,9 @@ extern "C" unsigned int Lists_GetIndexOfList (Lists_List l, unsigned int c)
else
{
i = 1;
- while (i <= l->NoOfElements)
+ while (i <= static_cast (l)->NoOfElements)
{
- if (l->Elements.array[i-1] == c)
+ if (static_cast (l)->Elements.array[i-1] == c)
{
return i;
}
@@ -261,7 +258,7 @@ extern "C" unsigned int Lists_GetIndexOfList (Lists_List l, unsigned int c)
i += 1;
}
}
- return l->NoOfElements+(Lists_GetIndexOfList (l->Next, c));
+ return static_cast (l)->NoOfElements+(Lists_GetIndexOfList (static_cast (static_cast (l)->Next), c));
}
/* static analysis guarentees a RETURN statement will be used before here. */
__builtin_unreachable ();
@@ -285,8 +282,8 @@ extern "C" unsigned int Lists_NoOfItemsInList (Lists_List l)
{
t = 0;
do {
- t += l->NoOfElements;
- l = l->Next;
+ t += static_cast