diff options
author | David Malcolm <dmalcolm@redhat.com> | 2024-10-24 11:48:01 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2024-10-24 11:48:01 -0400 |
commit | bf43fe6aa966eaf397ea3b8ebd6408d3d124e285 (patch) | |
tree | 0912e67a8ceb611947719ba5b0b0bb076f83597f /gcc | |
parent | fc1a001921c9c37b4d4dcaf180998aefb4037b8e (diff) | |
download | gcc-bf43fe6aa966eaf397ea3b8ebd6408d3d124e285.zip gcc-bf43fe6aa966eaf397ea3b8ebd6408d3d124e285.tar.gz gcc-bf43fe6aa966eaf397ea3b8ebd6408d3d124e285.tar.bz2 |
Use unique_ptr in more places in pretty_printer/diagnostics [PR116613]
My forthcoming patches for PR other/116613 make much more use of
cloning of pretty_printers than before, so it makes sense as a
preliminary patch for the result of pretty_printer::clone to be a
std::unique_ptr, rather than add more manual uses of "delete".
On doing so, I noticed various other places where naked new/delete is
used for run-time configuration of diagnostics:
* the output format (text vs SARIF)
* client data hooks
* the option manager
* the URLifier
Hence this patch also makes use of std::unique_ptr and ::make_unique for
managing such client policy classes, and also for diagnostic_buffer's
per-format implementations.
Unfortunately we can't directly include <memory> in our internal headers
but instead any of our TUs that make use of std::unique_ptr must #define
INCLUDE_MEMORY before including system.h.
Hence the bulk of this patch is taken up with adding a define of
INCLUDE_MEMORY to hundreds of source files: everything that includes
diagnostic.h or pretty-print.h (and thus anything transitively such as
includers of lto-wrapper.h, c-tree.h, cp-tree.h and rtl-ssa.h).
Thanks to Gaius Mulley for the parts of the patch that regenerated the
m2 files.
gcc/ada/ChangeLog:
PR other/116613
* gcc-interface/misc.cc: Add #define INCLUDE_MEMORY
* gcc-interface/trans.cc: Likewise.
* gcc-interface/utils.cc: Likewise.
gcc/analyzer/ChangeLog:
PR other/116613
* analyzer-logging.cc: Add #define INCLUDE_MEMORY
(logger::logger): Update for m_pp becoming a unique_ptr.
(logger::~logger): Likewise.
(logger::log_va_partial): Likewise.
(logger::end_log_line): Likewise.
* analyzer-logging.h (logger::get_printer): Likewise.
(logger::m_pp): Convert to a unique_ptr.
* analyzer.cc (make_label_text): Use
diagnostic_context::clone_printer and use unique_ptr.
(make_label_text_n): Likewise.
* bar-chart.cc: Add #define INCLUDE_MEMORY
* pending-diagnostic.cc (evdesc::event_desc::formatted_print):
Use diagnostic_context::clone_printer and use unique_ptr.
* sm-malloc.cc (sufficiently_similar_p): Likewise.
* supergraph.cc (supergraph::dump_dot_to_file): Likewise.
gcc/c-family/ChangeLog:
PR other/116613
* c-ada-spec.cc: Add #define INCLUDE_MEMORY.
* c-attribs.cc: Likewise.
* c-common.cc: Likewise.
* c-format.cc: Likewise.
* c-gimplify.cc: Likewise.
* c-indentation.cc: Likewise.
* c-opts.cc: Likewise.
* c-pch.cc: Likewise.
* c-pragma.cc: Likewise.
* c-pretty-print.cc: Likewise. Add #include "make-unique.h".
(c_pretty_printer::clone): Use std::unique_ptr and ::make_unique.
* c-pretty-print.h (c_pretty_printer::clone): Use std::unique_ptr.
* c-type-mismatch.cc: Add #define INCLUDE_MEMORY.
* c-warn.cc: Likewise.
gcc/c/ChangeLog:
PR other/116613
* c-aux-info.cc: Add #define INCLUDE_MEMORY.
* c-convert.cc: Likewise.
* c-errors.cc: Likewise.
* c-fold.cc: Likewise.
* c-lang.cc: Likewise.
* c-objc-common.cc: Likewise.
(pp_markup::element_quoted_type::print_type): Use unique_ptr.
* c-typeck.cc: Add #define INCLUDE_MEMORY.
* gimple-parser.cc: Likewise.
gcc/cp/ChangeLog:
PR other/116613
* call.cc: Add #define INCLUDE_MEMORY.
* class.cc: Likewise.
* constexpr.cc: Likewise.
* constraint.cc: Likewise.
* contracts.cc: Likewise.
* coroutines.cc: Likewise.
* cp-gimplify.cc: Likewise.
* cp-lang.cc: Likewise.
* cp-objcp-common.cc: Likewise.
* cp-ubsan.cc: Likewise.
* cvt.cc: Likewise.
* cxx-pretty-print.cc: Likewise. Add #include "cp-tree.h".
(cxx_pretty_printer::clone): Use std::unique_ptr and
::make_unique.
* cxx-pretty-print.h (cxx_pretty_printer::clone): Use
std::unique_ptr.
* decl2.cc: Add #define INCLUDE_MEMORY.
* dump.cc: Likewise.
* except.cc: Likewise.
* expr.cc: Likewise.
* friend.cc: Likewise.
* init.cc: Likewise.
* lambda.cc: Likewise.
* logic.cc: Likewise.
* mangle.cc: Likewise.
* method.cc: Likewise.
* optimize.cc: Likewise.
* pt.cc: Likewise.
* ptree.cc: Likewise.
* rtti.cc: Likewise.
* search.cc: Likewise.
* semantics.cc: Likewise.
* tree.cc: Likewise.
* typeck.cc: Likewise.
* typeck2.cc: Likewise.
* vtable-class-hierarchy.cc: Likewise.
gcc/d/ChangeLog:
PR other/116613
* d-attribs.cc: Add #define INCLUDE_MEMORY.
* d-builtins.cc: Likewise.
* d-codegen.cc: Likewise.
* d-convert.cc: Likewise.
* d-diagnostic.cc: Likewise.
* d-frontend.cc: Likewise.
* d-lang.cc: Likewise.
* d-longdouble.cc: Likewise.
* d-target.cc: Likewise.
* decl.cc: Likewise.
* expr.cc: Likewise.
* intrinsics.cc: Likewise.
* modules.cc: Likewise.
* toir.cc: Likewise.
* typeinfo.cc: Likewise.
* types.cc: Likewise.
gcc/fortran/ChangeLog:
PR other/116613
* arith.cc: Add #define INCLUDE_MEMORY.
* array.cc: Likewise.
* bbt.cc: Likewise.
* check.cc: Likewise.
* class.cc: Likewise.
* constructor.cc: Likewise.
* convert.cc: Likewise.
* cpp.cc: Likewise.
* data.cc: Likewise.
* decl.cc: Likewise.
* dependency.cc: Likewise.
* dump-parse-tree.cc: Likewise.
* error.cc: Likewise.
* expr.cc: Likewise.
* f95-lang.cc: Likewise.
* frontend-passes.cc: Likewise.
* interface.cc: Likewise.
* intrinsic.cc: Likewise.
* io.cc: Likewise.
* iresolve.cc: Likewise.
* match.cc: Likewise.
* matchexp.cc: Likewise.
* misc.cc: Likewise.
* module.cc: Likewise.
* openmp.cc: Likewise.
* options.cc: Likewise.
* parse.cc: Likewise.
* primary.cc: Likewise.
* resolve.cc: Likewise.
* scanner.cc: Likewise.
* simplify.cc: Likewise.
* st.cc: Likewise.
* symbol.cc: Likewise.
* target-memory.cc: Likewise.
* trans-array.cc: Likewise.
* trans-common.cc: Likewise.
* trans-const.cc: Likewise.
* trans-decl.cc: Likewise.
* trans-expr.cc: Likewise.
* trans-intrinsic.cc: Likewise.
* trans-io.cc: Likewise.
* trans-openmp.cc: Likewise.
* trans-stmt.cc: Likewise.
* trans-types.cc: Likewise.
* trans.cc: Likewise.
gcc/go/ChangeLog:
PR other/116613
* go-backend.cc: Add #define INCLUDE_MEMORY.
* go-lang.cc: Likewise.
gcc/jit/ChangeLog:
PR other/116613
* dummy-frontend.cc: Add #define INCLUDE_MEMORY.
* jit-playback.cc: Likewise.
* jit-recording.cc: Likewise.
gcc/lto/ChangeLog:
PR other/116613
* lto-common.cc: Add #define INCLUDE_MEMORY.
* lto-dump.cc: Likewise.
* lto-partition.cc: Likewise.
* lto-symtab.cc: Likewise.
* lto.cc: Likewise.
gcc/m2/ChangeLog:
PR other/116613
* gm2-gcc/gcc-consolidation.h: Add #define INCLUDE_MEMORY.
* gm2-gcc/m2configure.cc: Likewise.
* mc-boot/GASCII.cc: Regenerate.
* mc-boot/GASCII.h: Ditto.
* mc-boot/GArgs.cc: Ditto.
* mc-boot/GArgs.h: Ditto.
* mc-boot/GAssertion.cc: Ditto.
* mc-boot/GAssertion.h: Ditto.
* mc-boot/GBreak.cc: Ditto.
* mc-boot/GBreak.h: Ditto.
* mc-boot/GCOROUTINES.h: Ditto.
* mc-boot/GCmdArgs.cc: Ditto.
* mc-boot/GCmdArgs.h: Ditto.
* mc-boot/GDebug.cc: Ditto.
* mc-boot/GDebug.h: Ditto.
* mc-boot/GDynamicStrings.cc: Ditto.
* mc-boot/GDynamicStrings.h: Ditto.
* mc-boot/GEnvironment.cc: Ditto.
* mc-boot/GEnvironment.h: Ditto.
* mc-boot/GFIO.cc: Ditto.
* mc-boot/GFIO.h: Ditto.
* mc-boot/GFormatStrings.cc: Ditto.
* mc-boot/GFormatStrings.h: Ditto.
* mc-boot/GFpuIO.cc: Ditto.
* mc-boot/GFpuIO.h: Ditto.
* mc-boot/GIO.cc: Ditto.
* mc-boot/GIO.h: Ditto.
* mc-boot/GIndexing.cc: Ditto.
* mc-boot/GIndexing.h: Ditto.
* mc-boot/GM2Dependent.cc: Ditto.
* mc-boot/GM2Dependent.h: Ditto.
* mc-boot/GM2EXCEPTION.cc: Ditto.
* mc-boot/GM2EXCEPTION.h: Ditto.
* mc-boot/GM2RTS.cc: Ditto.
* mc-boot/GM2RTS.h: Ditto.
* mc-boot/GMemUtils.cc: Ditto.
* mc-boot/GMemUtils.h: Ditto.
* mc-boot/GNumberIO.cc: Ditto.
* mc-boot/GNumberIO.h: Ditto.
* mc-boot/GPushBackInput.cc: Ditto.
* mc-boot/GPushBackInput.h: Ditto.
* mc-boot/GRTExceptions.cc: Ditto.
* mc-boot/GRTExceptions.h: Ditto.
* mc-boot/GRTco.h: Ditto.
* mc-boot/GRTentity.h: Ditto.
* mc-boot/GRTint.cc: Ditto.
* mc-boot/GRTint.h: Ditto.
* mc-boot/GSArgs.cc: Ditto.
* mc-boot/GSArgs.h: Ditto.
* mc-boot/GSFIO.cc: Ditto.
* mc-boot/GSFIO.h: Ditto.
* mc-boot/GSYSTEM.h: Ditto.
* mc-boot/GSelective.h: Ditto.
* mc-boot/GStdIO.cc: Ditto.
* mc-boot/GStdIO.h: Ditto.
* mc-boot/GStorage.cc: Ditto.
* mc-boot/GStorage.h: Ditto.
* mc-boot/GStrCase.cc: Ditto.
* mc-boot/GStrCase.h: Ditto.
* mc-boot/GStrIO.cc: Ditto.
* mc-boot/GStrIO.h: Ditto.
* mc-boot/GStrLib.cc: Ditto.
* mc-boot/GStrLib.h: Ditto.
* mc-boot/GStringConvert.cc: Ditto.
* mc-boot/GStringConvert.h: Ditto.
* mc-boot/GSysExceptions.h: Ditto.
* mc-boot/GSysStorage.cc: Ditto.
* mc-boot/GSysStorage.h: Ditto.
* mc-boot/GTimeString.cc: Ditto.
* mc-boot/GTimeString.h: Ditto.
* mc-boot/GUnixArgs.h: Ditto.
* mc-boot/Galists.cc: Ditto.
* mc-boot/Galists.h: Ditto.
* mc-boot/Gdecl.cc: Ditto.
* mc-boot/Gdecl.h: Ditto.
* mc-boot/Gdtoa.h: Ditto.
* mc-boot/Gerrno.h: Ditto.
* mc-boot/Gkeyc.cc: Ditto.
* mc-boot/Gkeyc.h: Ditto.
* mc-boot/Gldtoa.h: Ditto.
* mc-boot/Glibc.h: Ditto.
* mc-boot/Glibm.h: Ditto.
* mc-boot/Glists.cc: Ditto.
* mc-boot/Glists.h: Ditto.
* mc-boot/GmcComment.cc: Ditto.
* mc-boot/GmcComment.h: Ditto.
* mc-boot/GmcComp.cc: Ditto.
* mc-boot/GmcComp.h: Ditto.
* mc-boot/GmcDebug.cc: Ditto.
* mc-boot/GmcDebug.h: Ditto.
* mc-boot/GmcError.cc: Ditto.
* mc-boot/GmcError.h: Ditto.
* mc-boot/GmcFileName.cc: Ditto.
* mc-boot/GmcFileName.h: Ditto.
* mc-boot/GmcLexBuf.cc: Ditto.
* mc-boot/GmcLexBuf.h: Ditto.
* mc-boot/GmcMetaError.cc: Ditto.
* mc-boot/GmcMetaError.h: Ditto.
* mc-boot/GmcOptions.cc: Ditto.
* mc-boot/GmcOptions.h: Ditto.
* mc-boot/GmcPreprocess.cc: Ditto.
* mc-boot/GmcPreprocess.h: Ditto.
* mc-boot/GmcPretty.cc: Ditto.
* mc-boot/GmcPretty.h: Ditto.
* mc-boot/GmcPrintf.cc: Ditto.
* mc-boot/GmcPrintf.h: Ditto.
* mc-boot/GmcQuiet.cc: Ditto.
* mc-boot/GmcQuiet.h: Ditto.
* mc-boot/GmcReserved.cc: Ditto.
* mc-boot/GmcReserved.h: Ditto.
* mc-boot/GmcSearch.cc: Ditto.
* mc-boot/GmcSearch.h: Ditto.
* mc-boot/GmcStack.cc: Ditto.
* mc-boot/GmcStack.h: Ditto.
* mc-boot/GmcStream.cc: Ditto.
* mc-boot/GmcStream.h: Ditto.
* mc-boot/Gmcflex.h: Ditto.
* mc-boot/Gmcp1.cc: Ditto.
* mc-boot/Gmcp1.h: Ditto.
* mc-boot/Gmcp2.cc: Ditto.
* mc-boot/Gmcp2.h: Ditto.
* mc-boot/Gmcp3.cc: Ditto.
* mc-boot/Gmcp3.h: Ditto.
* mc-boot/Gmcp4.cc: Ditto.
* mc-boot/Gmcp4.h: Ditto.
* mc-boot/Gmcp5.cc: Ditto.
* mc-boot/Gmcp5.h: Ditto.
* mc-boot/GnameKey.cc: Ditto.
* mc-boot/GnameKey.h: Ditto.
* mc-boot/GsymbolKey.cc: Ditto.
* mc-boot/GsymbolKey.h: Ditto.
* mc-boot/Gtermios.h: Ditto.
* mc-boot/Gtop.cc: Ditto.
* mc-boot/Gvarargs.cc: Ditto.
* mc-boot/Gvarargs.h: Ditto.
* mc-boot/Gwlists.cc: Ditto.
* mc-boot/Gwlists.h: Ditto.
* mc-boot/Gwrapc.h: Ditto.
* mc/keyc.mod (checkGccConfigSystem): Add
#define INCLUDE_MEMORY.
* pge-boot/GASCII.cc: Regenerate.
* pge-boot/GASCII.h: Ditto.
* pge-boot/GArgs.cc: Ditto.
* pge-boot/GArgs.h: Ditto.
* pge-boot/GAssertion.cc: Ditto.
* pge-boot/GAssertion.h: Ditto.
* pge-boot/GBreak.h: Ditto.
* pge-boot/GCmdArgs.h: Ditto.
* pge-boot/GDebug.cc: Ditto.
* pge-boot/GDebug.h: Ditto.
* pge-boot/GDynamicStrings.cc: Ditto.
* pge-boot/GDynamicStrings.h: Ditto.
* pge-boot/GEnvironment.h: Ditto.
* pge-boot/GFIO.cc: Ditto.
* pge-boot/GFIO.h: Ditto.
* pge-boot/GFormatStrings.h: Ditto.
* pge-boot/GFpuIO.h: Ditto.
* pge-boot/GIO.cc: Ditto.
* pge-boot/GIO.h: Ditto.
* pge-boot/GIndexing.cc: Ditto.
* pge-boot/GIndexing.h: Ditto.
* pge-boot/GLists.cc: Ditto.
* pge-boot/GLists.h: Ditto.
* pge-boot/GM2Dependent.cc: Ditto.
* pge-boot/GM2Dependent.h: Ditto.
* pge-boot/GM2EXCEPTION.cc: Ditto.
* pge-boot/GM2EXCEPTION.h: Ditto.
* pge-boot/GM2RTS.cc: Ditto.
* pge-boot/GM2RTS.h: Ditto.
* pge-boot/GNameKey.cc: Ditto.
* pge-boot/GNameKey.h: Ditto.
* pge-boot/GNumberIO.cc: Ditto.
* pge-boot/GNumberIO.h: Ditto.
* pge-boot/GOutput.cc: Ditto.
* pge-boot/GOutput.h: Ditto.
* pge-boot/GPushBackInput.cc: Ditto.
* pge-boot/GPushBackInput.h: Ditto.
* pge-boot/GRTExceptions.cc: Ditto.
* pge-boot/GRTExceptions.h: Ditto.
* pge-boot/GSArgs.h: Ditto.
* pge-boot/GSEnvironment.h: Ditto.
* pge-boot/GSFIO.cc: Ditto.
* pge-boot/GSFIO.h: Ditto.
* pge-boot/GSYSTEM.h: Ditto.
* pge-boot/GScan.h: Ditto.
* pge-boot/GStdIO.cc: Ditto.
* pge-boot/GStdIO.h: Ditto.
* pge-boot/GStorage.cc: Ditto.
* pge-boot/GStorage.h: Ditto.
* pge-boot/GStrCase.cc: Ditto.
* pge-boot/GStrCase.h: Ditto.
* pge-boot/GStrIO.cc: Ditto.
* pge-boot/GStrIO.h: Ditto.
* pge-boot/GStrLib.cc: Ditto.
* pge-boot/GStrLib.h: Ditto.
* pge-boot/GStringConvert.h: Ditto.
* pge-boot/GSymbolKey.cc: Ditto.
* pge-boot/GSymbolKey.h: Ditto.
* pge-boot/GSysExceptions.h: Ditto.
* pge-boot/GSysStorage.cc: Ditto.
* pge-boot/GSysStorage.h: Ditto.
* pge-boot/GTimeString.h: Ditto.
* pge-boot/GUnixArgs.h: Ditto.
* pge-boot/Gbnflex.cc: Ditto.
* pge-boot/Gbnflex.h: Ditto.
* pge-boot/Gdtoa.h: Ditto.
* pge-boot/Gerrno.h: Ditto.
* pge-boot/Gldtoa.h: Ditto.
* pge-boot/Glibc.h: Ditto.
* pge-boot/Glibm.h: Ditto.
* pge-boot/Gpge.cc: Ditto.
* pge-boot/Gtermios.h: Ditto.
* pge-boot/Gwrapc.h: Ditto.
gcc/objc/ChangeLog:
PR other/116613
* objc-act.cc: Add #define INCLUDE_MEMORY.
* objc-encoding.cc: Likewise.
* objc-gnu-runtime-abi-01.cc: Likewise.
* objc-lang.cc: Likewise.
* objc-next-runtime-abi-01.cc: Likewise.
* objc-next-runtime-abi-02.cc: Likewise.
* objc-runtime-shared-support.cc: Likewise.
gcc/objcp/ChangeLog:: Add #define INCLUDE_MEMORY.
PR other/116613
* objcp-decl.cc
* objcp-lang.cc: Likewise.
gcc/rust/ChangeLog:
PR other/116613
* resolve/rust-ast-resolve-expr.cc: Add #define INCLUDE_MEMORY.
* rust-attribs.cc: Likewise.
* rust-system.h: Likewise.
gcc/ChangeLog:
PR other/116613
* asan.cc: Add #define INCLUDE_MEMORY.
* attribs.cc: Likewise.
(attr_access::array_as_string): Use
diagnostic_context::clone_printer and use unique_ptr.
* auto-profile.cc: Add #define INCLUDE_MEMORY.
* calls.cc: Likewise.
* cfganal.cc: Likewise.
* cfgexpand.cc: Likewise.
* cfghooks.cc: Likewise.
* cfgloop.cc: Likewise.
* cgraph.cc: Likewise.
* cgraphclones.cc: Likewise.
* cgraphunit.cc: Likewise.
* collect-utils.cc: Likewise.
* collect2.cc: Likewise.
* common/config/aarch64/aarch64-common.cc: Likewise.
* common/config/arm/arm-common.cc: Likewise.
* common/config/avr/avr-common.cc: Likewise.
* config/aarch64/aarch64-cc-fusion.cc: Likewise.
* config/aarch64/aarch64-early-ra.cc: Likewise.
* config/aarch64/aarch64-sve-builtins.cc: Likewise.
* config/arc/arc.cc: Likewise.
* config/arm/aarch-common.cc: Likewise.
* config/arm/arm-mve-builtins.cc: Likewise.
* config/avr/avr-devices.cc: Likewise.
* config/avr/driver-avr.cc: Likewise.
* config/bpf/bpf.cc: Likewise.
* config/bpf/btfext-out.cc: Likewise.
* config/bpf/core-builtins.cc: Likewise.
* config/darwin.cc: Likewise.
* config/i386/driver-i386.cc: Likewise.
* config/i386/i386-builtins.cc: Likewise.
* config/i386/i386-expand.cc: Likewise.
* config/i386/i386-features.cc: Likewise.
* config/i386/i386-options.cc: Likewise.
* config/loongarch/loongarch-builtins.cc: Likewise.
* config/mingw/winnt-cxx.cc: Likewise.
* config/mingw/winnt.cc: Likewise.
* config/mips/mips.cc: Likewise.
* config/msp430/driver-msp430.cc: Likewise.
* config/nvptx/mkoffload.cc: Likewise.
* config/nvptx/nvptx.cc: Likewise.
* config/riscv/riscv-avlprop.cc: Likewise.
* config/riscv/riscv-vector-builtins.cc: Likewise.
* config/riscv/riscv-vsetvl.cc: Likewise.
* config/rs6000/driver-rs6000.cc: Likewise.
* config/rs6000/host-darwin.cc: Likewise.
* config/rs6000/rs6000-c.cc: Likewise.
* config/s390/s390-c.cc: Likewise.
* config/s390/s390.cc: Likewise.
* config/sol2-cxx.cc: Likewise.
* config/vms/vms-c.cc: Likewise.
* config/xtensa/xtensa-dynconfig.cc: Likewise.
* coroutine-passes.cc: Likewise.
* coverage.cc: Likewise.
* data-streamer-in.cc: Likewise.
* data-streamer-out.cc: Likewise.
* data-streamer.cc: Likewise.
* diagnostic-buffer.h (diagnostic_buffer::~diagnostic_buffer):
Delete.
(diagnostic_buffer::m_per_format_buffer): Use std::unique_ptr.
* diagnostic-client-data-hooks.h (make_compiler_data_hooks): Use
std::unique_ptr for return type.
* diagnostic-format-json.cc
(json_output_format::make_per_format_buffer): Likewise.
(diagnostic_output_format_init_json): Update for usage of
std::unique_ptr in set_output_format.
* diagnostic-format-sarif.cc
(sarif_output_format::make_per_format_buffer): Use std::unique_ptr
for return type.
(diagnostic_output_format_init_sarif): Update for usage of
std::unique_ptr.
(test_message_with_embedded_link): Likewise for set_urlifier.
* diagnostic-format-text.cc: Add #define INCLUDE_MEMORY. Include
"make-unique.h".
(diagnostic_text_output_format::set_buffer): Use std::unique_ptr.
* diagnostic-format-text.h
(diagnostic_text_output_format::set_buffer): Likewise.
* diagnostic-format.h
(diagnostic_output_format::make_per_format_buffer): Likewise.
* diagnostic-global-context.cc:
* diagnostic-macro-unwinding.cc: Likewise.
* diagnostic-show-locus.cc: Likewise.
* diagnostic-spec.cc: Likewise.
* diagnostic.cc (diagnostic_context::set_output_format): Use
std::unique_ptr for input.
(diagnostic_context::set_client_data_hooks): Likewise.
(diagnostic_context::set_option_manager): Likewise.
(diagnostic_context::set_urlifier): Likewise.
(diagnostic_context::set_diagnostic_buffer): Update for use of
std::unique_ptr.
(diagnostic_buffer::diagnostic_buffer): Likewise.
(diagnostic_buffer::~diagnostic_buffer): Delete.
* diagnostic.h: Complain if INCLUDE_MEMORY was not defined.
(diagnostic_context::set_output_format): Use std::unique_ptr for
input.
(diagnostic_context::set_client_data_hooks): Likewise.
(diagnostic_context::set_option_manager): Likewise.
(diagnostic_context::set_urlifier): Likewise.
(diagnostic_context::clone_printer): New.
(diagnostic_context::m_printer): Update comment.
(diagnostic_context::m_option_mgr): Likewise.
(diagnostic_context::m_urlifier): Likewise.
(diagnostic_context::m_edit_context_ptr): Likewise.
(diagnostic_context::m_output_format): Likewise.
(diagnostic_context::m_client_data_hooks): Likewise.
(diagnostic_context::m_theme): Likewise.
* digraph.cc: Add #define INCLUDE_MEMORY.
* dwarf2out.cc: Likewise.
* edit-context.cc: Likewise.
* except.cc: Likewise.
* expr.cc: Likewise.
* file-prefix-map.cc: Likewise.
* final.cc: Likewise.
* fwprop.cc: Likewise.
* gcc-plugin.h: Likewise.
* gcc-rich-location.cc: Likewise.
* gcc-urlifier.cc: Likewise. Add #include "make-unique.h".
(make_gcc_urlifier): Use std::unique_ptr and ::make_unique.
* gcc-urlifier.h (make_gcc_urlifier): Use std::unique_ptr.
* gcc.cc: Add #define INCLUDE_MEMORY. Include
"pretty-print-urlifier.h".
* gcov-dump.cc: Add #define INCLUDE_MEMORY.
* gcov-tool.cc: Likewise.
* gengtype.cc (open_base_files): Likewise to output.
* genmatch.cc: Likewise.
* gimple-fold.cc: Likewise.
* gimple-harden-conditionals.cc: Likewise.
* gimple-harden-control-flow.cc: Likewise.
* gimple-if-to-switch.cc: Likewise.
* gimple-lower-bitint.cc: Likewise.
* gimple-predicate-analysis.cc: Likewise.
* gimple-pretty-print.cc: Likewise.
* gimple-range-cache.cc: Likewise.
* gimple-range-edge.cc: Likewise.
* gimple-range-fold.cc: Likewise.
* gimple-range-gori.cc: Likewise.
* gimple-range-infer.cc: Likewise.
* gimple-range-op.cc: Likewise.
* gimple-range-path.cc: Likewise.
* gimple-range-phi.cc: Likewise.
* gimple-range-trace.cc: Likewise.
* gimple-range.cc: Likewise.
* gimple-ssa-backprop.cc: Likewise.
* gimple-ssa-sprintf.cc: Likewise.
* gimple-ssa-store-merging.cc: Likewise.
* gimple-ssa-strength-reduction.cc: Likewise.
* gimple-ssa-warn-access.cc: Likewise.
* gimple-ssa-warn-alloca.cc: Likewise.
* gimple-ssa-warn-restrict.cc: Likewise.
* gimple-streamer-in.cc: Likewise.
* gimple-streamer-out.cc: Likewise.
* gimple.cc: Likewise.
* gimplify.cc: Likewise.
* graph.cc: Likewise.
* graphviz.cc: Likewise.
* input.cc: Likewise.
* ipa-cp.cc: Likewise.
* ipa-devirt.cc: Likewise.
* ipa-fnsummary.cc: Likewise.
* ipa-free-lang-data.cc: Likewise.
* ipa-icf-gimple.cc: Likewise.
* ipa-icf.cc: Likewise.
* ipa-inline-analysis.cc: Likewise.
* ipa-inline.cc: Likewise.
* ipa-modref-tree.cc: Likewise.
* ipa-modref.cc: Likewise.
* ipa-param-manipulation.cc: Likewise.
* ipa-polymorphic-call.cc: Likewise.
* ipa-predicate.cc: Likewise.
* ipa-profile.cc: Likewise.
* ipa-prop.cc: Likewise.
* ipa-pure-const.cc: Likewise.
* ipa-reference.cc: Likewise.
* ipa-split.cc: Likewise.
* ipa-sra.cc: Likewise.
* ipa-strub.cc: Likewise.
* ipa-utils.cc: Likewise.
* langhooks.cc: Likewise.
* late-combine.cc: Likewise.
* lto-cgraph.cc: Likewise.
* lto-compress.cc: Likewise.
* lto-opts.cc: Likewise.
* lto-section-in.cc: Likewise.
* lto-section-out.cc: Likewise.
* lto-streamer-in.cc: Likewise.
* lto-streamer-out.cc: Likewise.
* lto-streamer.cc: Likewise.
* lto-wrapper.cc: Likewise. Include "make-unique.h".
(main): Use ::make_unique when creating option manager.
* multiple_target.cc: Likewise.
* omp-expand.cc: Likewise.
* omp-general.cc: Likewise.
* omp-low.cc: Likewise.
* omp-oacc-neuter-broadcast.cc: Likewise.
* omp-offload.cc: Likewise.
* omp-simd-clone.cc: Likewise.
* optc-gen.awk: Likewise in output.
* optc-save-gen.awk: Likewise in output.
* options-urls-cc-gen.awk: Likewise in output.
* opts-common.cc: Likewise.
* opts-global.cc: Likewise.
* opts.cc: Likewise.
* pair-fusion.cc: Likewise.
* passes.cc: Likewise.
* pointer-query.cc: Likewise.
* predict.cc: Likewise.
* pretty-print.cc (pretty_printer::clone): Use std::unique_ptr and
::make_unique.
* pretty-print.h: Complain if INCLUDE_MEMORY is not defined.
(pretty_printer::clone): Use std::unique_ptr.
* print-rtl.cc: Add #define INCLUDE_MEMORY.
* print-tree.cc: Likewise.
* profile-count.cc: Likewise.
* range-op-float.cc: Likewise.
* range-op-ptr.cc: Likewise.
* range-op.cc: Likewise.
* range.cc: Likewise.
* read-rtl-function.cc: Likewise.
* rtl-error.cc: Likewise.
* rtl-ssa/accesses.cc: Likewise.
* rtl-ssa/blocks.cc: Likewise.
* rtl-ssa/changes.cc: Likewise.
* rtl-ssa/functions.cc: Likewise.
* rtl-ssa/insns.cc: Likewise.
* rtl-ssa/movement.cc: Likewise.
* rtl-tests.cc: Likewise.
* sanopt.cc: Likewise.
* sched-rgn.cc: Likewise.
* selftest-diagnostic-path.cc: Likewise.
* selftest-diagnostic.cc: Likewise.
* splay-tree-utils.cc: Likewise.
* sreal.cc: Likewise.
* stmt.cc: Likewise.
* substring-locations.cc: Likewise.
* symtab-clones.cc: Likewise.
* symtab-thunks.cc: Likewise.
* symtab.cc: Likewise.
* text-art/box-drawing.cc: Likewise.
* text-art/canvas.cc: Likewise.
* text-art/ruler.cc: Likewise.
* text-art/selftests.cc: Likewise.
* text-art/theme.cc: Likewise.
* toplev.cc: Likewise. Include "make-unique.h".
(general_init): Use ::make_unique when setting option_manager.
* trans-mem.cc: Add #define INCLUDE_MEMORY.
* tree-affine.cc: Likewise.
* tree-call-cdce.cc: Likewise.
* tree-cfg.cc: Likewise.
* tree-chrec.cc: Likewise.
* tree-dfa.cc: Likewise.
* tree-diagnostic-client-data-hooks.cc: Include "make-unique.h".
(make_compiler_data_hooks): Use std::unique_ptr and ::make_unique.
* tree-diagnostic.cc: Add #define INCLUDE_MEMORY.
* tree-dump.cc: Likewise.
* tree-inline.cc: Likewise.
* tree-into-ssa.cc: Likewise.
* tree-logical-location.cc: Likewise.
* tree-nested.cc: Likewise.
* tree-nrv.cc: Likewise.
* tree-object-size.cc: Likewise.
* tree-outof-ssa.cc: Likewise.
* tree-pretty-print.cc: Likewise.
* tree-profile.cc: Likewise.
* tree-scalar-evolution.cc: Likewise.
* tree-sra.cc: Likewise.
* tree-ssa-address.cc: Likewise.
* tree-ssa-alias.cc: Likewise.
* tree-ssa-ccp.cc: Likewise.
* tree-ssa-coalesce.cc: Likewise.
* tree-ssa-copy.cc: Likewise.
* tree-ssa-dce.cc: Likewise.
* tree-ssa-dom.cc: Likewise.
* tree-ssa-forwprop.cc: Likewise.
* tree-ssa-ifcombine.cc: Likewise.
* tree-ssa-loop-ch.cc: Likewise.
* tree-ssa-loop-im.cc: Likewise.
* tree-ssa-loop-manip.cc: Likewise.
* tree-ssa-loop-niter.cc: Likewise.
* tree-ssa-loop-split.cc: Likewise.
* tree-ssa-math-opts.cc: Likewise.
* tree-ssa-operands.cc: Likewise.
* tree-ssa-phiprop.cc: Likewise.
* tree-ssa-pre.cc: Likewise.
* tree-ssa-propagate.cc: Likewise.
* tree-ssa-reassoc.cc: Likewise.
* tree-ssa-sccvn.cc: Likewise.
* tree-ssa-scopedtables.cc: Likewise.
* tree-ssa-sink.cc: Likewise.
* tree-ssa-strlen.cc: Likewise.
* tree-ssa-structalias.cc: Likewise.
* tree-ssa-ter.cc: Likewise.
* tree-ssa-uninit.cc: Likewise.
* tree-ssa.cc: Likewise.
* tree-ssanames.cc: Likewise.
* tree-stdarg.cc: Likewise.
* tree-streamer-in.cc: Likewise.
* tree-streamer-out.cc: Likewise.
* tree-streamer.cc: Likewise.
* tree-switch-conversion.cc: Likewise.
* tree-tailcall.cc: Likewise.
* tree-vrp.cc: Likewise.
* tree.cc: Likewise.
* ubsan.cc: Likewise.
* value-pointer-equiv.cc: Likewise.
* value-prof.cc: Likewise.
* value-query.cc: Likewise.
* value-range-pretty-print.cc: Likewise.
* value-range-storage.cc: Likewise.
* value-range.cc: Likewise.
* value-relation.cc: Likewise.
* var-tracking.cc: Likewise.
* varpool.cc: Likewise.
* vr-values.cc: Likewise.
* wide-int-print.cc: Likewise.
gcc/testsuite/ChangeLog:
PR other/116613
* gcc.dg/plugin/diagnostic_group_plugin.c: Update for use of
std::unique_ptr.
* gcc.dg/plugin/diagnostic_plugin_xhtml_format.c: Likewise.
* gcc.dg/plugin/ggcplug.c: Likewise.
libgcc/ChangeLog:
PR other/116613
* libgcov-util.c: Add #define INCLUDE_MEMORY.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Co-authored-by: Gaius Mulley <gaiusmod2@gmail.com>
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc')
632 files changed, 1034 insertions, 502 deletions
diff --git a/gcc/ada/gcc-interface/misc.cc b/gcc/ada/gcc-interface/misc.cc index 2aa1bfd..8c921db 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 a073b2d..5f5cbe5 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 a88a238..951d384 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 d3b04f2..2a4d02f 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 <http://www.gnu.org/licenses/>. */ +#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 eb2cde7..aaa3d79 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<pretty_printer> 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 4a1a361..0f998e3 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<pretty_printer> 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<pretty_printer> 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 4a4acf5..3a259f8 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 <http://www.gnu.org/licenses/>. */ +#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 ec6f5ac..a900839 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 11c0e1b..12465cb 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 55bd42a..826f8f6 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<pretty_printer> 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 bc92d9c..99c5d2e 100644 --- a/gcc/asan.cc +++ b/gcc/asan.cc @@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/attribs.cc b/gcc/attribs.cc index 0be7b83..3112428 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 <http://www.gnu.org/licenses/>. */ +#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<pretty_printer> 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 de59b94..242b71d 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 fbba443..db5c0b5 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 <http://www.gnu.org/licenses/>. */ +#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 4dd2eec..cf9523a 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 <http://www.gnu.org/licenses/>. */ +#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 7494a2d..28a2d4b 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 f4a65a5..211fb3b 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 <http://www.gnu.org/licenses/>. */ +#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 09ea1b7..7885e29 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 <http://www.gnu.org/licenses/>. */ +#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 38be7d2..7adec84 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 <http://www.gnu.org/licenses/>. */ +#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 6be65fb..5eb6940 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 <http://www.gnu.org/licenses/>. */ +#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 f104575..50479ad 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 <http://www.gnu.org/licenses/>. */ +#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 ed2a7a0..9d71534 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 <http://www.gnu.org/licenses/>. */ +#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 1380671..fadb9e3 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 <http://www.gnu.org/licenses/>. */ +#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<pretty_printer> c_pretty_printer::clone () const { - return new c_pretty_printer (*this); + return ::make_unique<c_pretty_printer> (*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 550e4cb..80854b0 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<pretty_printer> 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 8964685..abc8cb8 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 <http://www.gnu.org/licenses/>. */ +#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 05d6e37..8c94888 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 <http://www.gnu.org/licenses/>. */ +#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 f6b5980..b422da0 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 <http://www.gnu.org/licenses/>. */ +#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 7c1064c..9180c6a 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 c6b7c10..38b11a7 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 <http://www.gnu.org/licenses/>. */ +#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 9ea174f..06085f5 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 <http://www.gnu.org/licenses/>. */ +#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 870e23b..7e5604f 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 <http://www.gnu.org/licenses/>. */ +#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 eb0c4b8..dc91373 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 <http://www.gnu.org/licenses/>. */ +#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 108ea5c..2a99c0e 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 d156d83..8d1db33 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/calls.cc b/gcc/calls.cc index c5c26f6..05eaa0d 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/cfganal.cc b/gcc/cfganal.cc index 35c59f3..863f88f 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 6c10963..885f488 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/cfghooks.cc b/gcc/cfghooks.cc index 3ced91c..55fdf98 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/cfgloop.cc b/gcc/cfgloop.cc index 5202c38..df0ec77 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc index b5d096d..45f851d 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 4fff687..ede720f 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 2bd0289..0052b92 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 981a14a..5397fe2 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/collect2.cc b/gcc/collect2.cc index 902014a..2bd618d 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 64b65b7..2bfc597e 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/>. */ #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 dbcbe3f..6867457 100644 --- a/gcc/common/config/arm/arm-common.cc +++ b/gcc/common/config/arm/arm-common.cc @@ -18,6 +18,7 @@ <http://www.gnu.org/licenses/>. */ #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 bb454a2..f14a4a4 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 <http://www.gnu.org/licenses/>. */ +#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 3af8c00..3cae4c4 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 6e544dd..bbd8468 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 af6469f..ef14f8c 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 ba7bde1..db81686 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 aa405af..44012fe 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 2527445..804eb88 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 456a6b7..83b4a2e 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 4dcabc60..3eefcab 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 2051fa5..aa00d14 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 b3df7b5..ca6241a 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 86e2e9d..deb368a 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 47e41ac..ae821e3 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 <http://www.gnu.org/licenses/>. */ +#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 445f564..26f094c 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 4286eeb..a778f04 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 63f5e34..a5094b5 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 3434d00..16b1e6c 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 55e0210..5fa6e02 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 cf92770..64529da 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 f4d7a50..621366e 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 803e5f5..fb4b8a4 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 173f792..cd5c597 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 a11fd3d..5ffa8ef 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 df16ee6..ddb1c66 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 96a1134..3ac61b4 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 <sstream> #include "system.h" diff --git a/gcc/config/riscv/riscv-avlprop.cc b/gcc/config/riscv/riscv-avlprop.cc index 91d80aa..066377c 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 41730c4..458d9b0 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 030ffbe..0b53b20 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 f490072..fd457e7 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 e000177..15c40b1 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 04882c3..5ff346e 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 4521a86..0332fb4 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 25d43ae..874b112 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 aa558be..4f5fbc6 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 <http://www.gnu.org/licenses/>. */ +#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 d0620b4..0e9fa2f 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 3bd2760..6ddc02a 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 <http://www.gnu.org/licenses/>. */ +#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 0f8e24f..ce74a02 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/coverage.cc b/gcc/coverage.cc index a964ed5..a9825e5 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 309ab01..cc25b48 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 8c39bb4..eed9df7 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 4e4df94..ad68afe 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 <http://www.gnu.org/licenses/>. */ +#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 cf0e5d3..8a36b9c 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 <http://www.gnu.org/licenses/>. */ +#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 4d2849a..2a55b87 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 86a5ac8..ef64a98 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 <http://www.gnu.org/licenses/>. */ +#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 003e68f..68f651e 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 <http://www.gnu.org/licenses/>. */ +#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 e1e2ab2..3959b31 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 <http://www.gnu.org/licenses/>. */ +#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 cd37951..7a0636f 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 <http://www.gnu.org/licenses/>. */ +#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 c4ae0fe..1055714 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 <http://www.gnu.org/licenses/>. */ +#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 526937d..54e700c 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 41e6bdf..c0608ac 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 <http://www.gnu.org/licenses/>. */ +#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<pretty_printer> cxx_pretty_printer::clone () const { - return new cxx_pretty_printer (*this); + return ::make_unique<cxx_pretty_printer> (*this); } diff --git a/gcc/cp/cxx-pretty-print.h b/gcc/cp/cxx-pretty-print.h index a4fcf7c..f0865cc 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<pretty_printer> 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 a0c3190..a455eb4 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 aafb62f..8166bbf 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 <http://www.gnu.org/licenses/>. */ +#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 7b4abd1..e14a9fd 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 <http://www.gnu.org/licenses/>. */ +#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 de4991e..e5ec235 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 <http://www.gnu.org/licenses/>. */ +#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 2e70d01..5261daa 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 <http://www.gnu.org/licenses/>. */ +#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 10b83ef..d72964d 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 d51b513..1453bc5 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 <http://www.gnu.org/licenses/>. */ +#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 fab2c35..f36abb2 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 17988d69..828e326 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 d704db2..adffa9b 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 8429d85..f93e026 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 <http://www.gnu.org/licenses/>. */ +#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 b590c32..e20038a 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 15e4675..77bffa0 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 <http://www.gnu.org/licenses/>. */ +#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 cc006ea..fff8985 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 <http://www.gnu.org/licenses/>. */ +#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 54eb4f4..2f5df8a 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 dabfb1f..8c1a8b3 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 <http://www.gnu.org/licenses/>. */ +#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 c80ee06..28c4a76 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 <http://www.gnu.org/licenses/>. */ +#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 bfc0c56..90da2fa 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 79b397a..9f57020 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 afe1e96..7e4f613 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 0f7ca10..873140ee 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 4546c0e..2ca02fe 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 <http://www.gnu.org/licenses/>. */ +#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 2b3089b..eeeb48d 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 <http://www.gnu.org/licenses/>. */ +#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 5c79cdf..a07c7d8 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 <http://www.gnu.org/licenses/>. */ +#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 373075c..d584d2a 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 <http://www.gnu.org/licenses/>. */ +#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 0d7f4a3..c3e5d85 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 <http://www.gnu.org/licenses/>. */ +#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 89ffa7e..2aa2a3f 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 <http://www.gnu.org/licenses/>. */ +#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 e4c8c5e6..ba10a35 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 <http://www.gnu.org/licenses/>. */ +#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 dd46e53..17cae45 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 <http://www.gnu.org/licenses/>. */ +#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 0a87c85..0afaa71 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 <http://www.gnu.org/licenses/>. */ +#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 d055e0b..a690f2e 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 <http://www.gnu.org/licenses/>. */ +#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 c895c1a..34143b3 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 <http://www.gnu.org/licenses/>. */ +#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 b111ee9..f9b4a1e 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 <http://www.gnu.org/licenses/>. */ +#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 a6848f2..2bbba10 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 <http://www.gnu.org/licenses/>. */ +#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 cadcbe8..56aaf29 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 <http://www.gnu.org/licenses/>. */ +#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 9fa2f88..2f78c91 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 <http://www.gnu.org/licenses/>. */ +#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 07dbc5e..64dec35 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 <http://www.gnu.org/licenses/>. */ +#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 c237e30..9571543 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 <http://www.gnu.org/licenses/>. */ +#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 896413e..1caf72f 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 <http://www.gnu.org/licenses/>. */ +#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 07acd04..deb933a 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<diagnostic_per_format_buffer> 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 a67a3db..9e2bd60 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<diagnostic_client_data_hooks> make_compiler_data_hooks (); class diagnostic_client_plugin_info; diff --git a/gcc/diagnostic-format-json.cc b/gcc/diagnostic-format-json.cc index 022e3a9..7b89ee8 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<diagnostic_per_format_buffer> + make_per_format_buffer () final override { - return new diagnostic_json_format_buffer (*this); + return ::make_unique<diagnostic_json_format_buffer> (*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 4ce3561..a5c6ce2 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<diagnostic_per_format_buffer> + make_per_format_buffer () final override { - return new diagnostic_sarif_format_buffer (m_builder); + return ::make_unique<diagnostic_sarif_format_buffer> (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<test_urlifier> ()); rich_location richloc (line_table, UNKNOWN_LOCATION); dc.report (DK_ERROR, richloc, nullptr, 0, "foo %<-foption%> %<unrecognized%> bar"); diff --git a/gcc/diagnostic-format-text.cc b/gcc/diagnostic-format-text.cc index 03f5518..c23ac6c 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_per_format_buffer> diagnostic_text_output_format::make_per_format_buffer () { - return new diagnostic_text_format_buffer (*this); + return ::make_unique<diagnostic_text_format_buffer> (*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 12a65bf..b43501e 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<diagnostic_per_format_buffer> + 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 e2ae155..a38d177 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<diagnostic_per_format_buffer> + 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 9e15190..e82588e 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 a9838ff..38f827f 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 <http://www.gnu.org/licenses/>. */ +#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 415de42..79499dc 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 <http://www.gnu.org/licenses/>. */ #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 addaf08..77e4b67 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc index 7123008..f1cef0b 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<diagnostic_output_format> 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<diagnostic_client_data_hooks> 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<diagnostic_option_manager> 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> 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,14 +1796,8 @@ diagnostic_counters::clear () /* class diagnostic_buffer. */ diagnostic_buffer::diagnostic_buffer (diagnostic_context &ctxt) -: m_ctxt (ctxt), - m_per_format_buffer (nullptr) -{ -} - -diagnostic_buffer::~diagnostic_buffer () +: m_ctxt (ctxt) { - delete m_per_format_buffer; } void diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index f1f4755..3da1ae9 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 <memory> 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<diagnostic_output_format> 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<diagnostic_client_data_hooks> hooks); + void set_urlifier (std::unique_ptr<urlifier>); 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<diagnostic_option_manager> 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<pretty_printer> 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 b323764a..7b2726d 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 38aedb6..fc23e4b 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 37ac498..f51ebf0 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/except.cc b/gcc/except.cc index 5bb5edb..4bec795 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 87f9e00..51a7e5a 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 <http://www.gnu.org/licenses/>. */ +#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 6b432e2..6841559 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/final.cc b/gcc/final.cc index 5d91158..11141f2 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 a214b8b..3ecbbd3 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 6dedaed..e650d85 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 <http://www.gnu.org/licenses/>. */ +#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 f564ce1..556baee 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 e90073a..304ca1b 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 f9e0d41..4b2234a 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 942e263..8a4e11d 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 <http://www.gnu.org/licenses/>. */ +#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 674e3f4..187bda6 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 7c5f00c..9d662ac 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 <http://www.gnu.org/licenses/>. */ +#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 e720245..3aa869b 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 1515789..499a846 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 <http://www.gnu.org/licenses/>. */ +#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 15edf1a..2d3db95 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 bc8a95a..ea5d2ab 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 64e1ce5..b1eda94c 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 b3e0bf1..01fbc44 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 <http://www.gnu.org/licenses/>. */ +#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 770f31b..611c299 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 405074e..3a36b1d 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 <http://www.gnu.org/licenses/>. */ +#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 dbcbed8..69519fe 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 114f1b6..83b65d3 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 <http://www.gnu.org/licenses/>. */ +#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 ac4e5c5..5e1785e 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 <http://www.gnu.org/licenses/>. */ +#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 9fb2212..d8b216b 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 2b3ed4f..6e9da8c 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 <http://www.gnu.org/licenses/>. */ +#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 9e773cf..f7185d5 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 <http://www.gnu.org/licenses/>. */ +#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 9918295..0ef6679 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 <http://www.gnu.org/licenses/>. */ +#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 880aef2..9ab4d2b 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 7aa0d59..aaede54 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 <http://www.gnu.org/licenses/>. */ +#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 0004df9..c531b89 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 <http://www.gnu.org/licenses/>. */ +#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 d2fe22d..9d7d43a 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 <http://www.gnu.org/licenses/>. */ +#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 e57f631..f3f659c 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 <http://www.gnu.org/licenses/>. */ +#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 c96523e..565d4aa 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 <http://www.gnu.org/licenses/>. */ +#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 09d7d8c..7e3237c 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 2f6c3c3..1e2fa3e 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 <http://www.gnu.org/licenses/>. */ +#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 48e4258..2ce61450 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 e803cdd..5e83fb4 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 <http://www.gnu.org/licenses/>. */ +#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 c71c403..235ecc4 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 <http://www.gnu.org/licenses/>. */ +#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 ec7728c..a52bde9 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 49b0c3d..7c3681a 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 204f4df..9c2d683 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 a62fe3f..a2c1595 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 16feff4..663d762 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 80d75f2..20ccbb1 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 961a711..41396a3 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 <http://www.gnu.org/licenses/>. */ +#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 5f7e29c..279090f 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 <http://www.gnu.org/licenses/>. */ +#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 e1a84f2..520ab50 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 <http://www.gnu.org/licenses/>. */ +#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 e596a36..2170869 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 7182fa0..58b93e2 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/fwprop.cc b/gcc/fwprop.cc index 2ebb2f1..8cba6b7 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 8eb33d6..683fc3e 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 568744b..0fa9db8 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 <http://www.gnu.org/licenses/>. */ +#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 be6459e..0db5429 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 <http://www.gnu.org/licenses/>. */ +#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<urlifier> make_gcc_urlifier (unsigned int lang_mask) { - return new gcc_urlifier (lang_mask); + return ::make_unique<gcc_urlifier> (lang_mask); } #if CHECKING_P diff --git a/gcc/gcc-urlifier.h b/gcc/gcc-urlifier.h index 660d4f8..c4cd03c 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<urlifier> make_gcc_urlifier (unsigned int lang_mask); #endif /* GCC_GCC_URLIFIER_H */ @@ -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 731172f..a511e37 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 <http://www.gnu.org/licenses/>. */ #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 100f735..0f3c5c7 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/gengtype.cc b/gcc/gengtype.cc index c0ecbe8..4cd0974 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 6287d6a..317d02a 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 <http://www.gnu.org/licenses/>. */ +#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 d4ec747..00913bb 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 <http://www.gnu.org/licenses/>. */ +#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 4ab086e..7bfa75a 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 <http://www.gnu.org/licenses/>. */ +#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 70383e6..f5654c3 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 96ce1c3..4246e12 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 58deaf2..1d1e300 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 <http://www.gnu.org/licenses/>. */ +#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 01688b8..6b9043c 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 <http://www.gnu.org/licenses/>. */ +#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 01d7c9f..30da3af 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 <http://www.gnu.org/licenses/>. */ +#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 035076b..4210841 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 <http://www.gnu.org/licenses/>. */ +#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 0c75ad0..6e082ff 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 <http://www.gnu.org/licenses/>. */ +#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 dcd0cae..82dd363 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 <http://www.gnu.org/licenses/>. */ +#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 f2e2b50..f5103fd 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 <http://www.gnu.org/licenses/>. */ +#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 98642e2..dd74824 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 <http://www.gnu.org/licenses/>. */ +#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 68a7df8..030030c 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 <http://www.gnu.org/licenses/>. */ +#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 f64a7a5..85c3d15 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 <http://www.gnu.org/licenses/>. */ +#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 c679e4e..aeb6c40 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 <http://www.gnu.org/licenses/>. */ +#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 e1679a1..5302646 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 <http://www.gnu.org/licenses/>. */ +#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 7ba7d46..e250b26 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 <http://www.gnu.org/licenses/>. */ +#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 e3374b1..ea3ae0b 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 0900710..2e06b91 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 7dba4a7..9910307 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 39cd933..13e05b0 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 5061af3..f2fea91 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 <http://www.gnu.org/licenses/>. */ +#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 f12e55b..c85f5c7 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 <http://www.gnu.org/licenses/>. */ +#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 d71f133..4bccca5 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 <http://www.gnu.org/licenses/>. */ +#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 61f6d06..d7843c5 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 <http://www.gnu.org/licenses/>. */ +#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 e63d8b4..f30f06e 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/gimple.cc b/gcc/gimple.cc index 6e28cf2..13aa3d2 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc index 769b880..9e7a1b5 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 <http://www.gnu.org/licenses/>. */ +#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 25e5d35..69dbef6 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 <http://www.gnu.org/licenses/>. */ +#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 9316425..42a2159 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/graph.cc b/gcc/graph.cc index 07da079..677dc50 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/graphviz.cc b/gcc/graphviz.cc index e41c8bc..daa9706 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/input.cc b/gcc/input.cc index 9f5228d..04462ef 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 <http://www.gnu.org/licenses/>. */ +#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 fa7bd6a..212d9cc 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 c406e51..9f06f59 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 b382478..42e3efc 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 3ad203f..80e30f5 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 31f6cdb..73fc565 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 <http://www.gnu.org/licenses/>. */ +#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 b10a6ba..fbb2418 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 a190cb6..e521998 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 <http://www.gnu.org/licenses/>. */ +#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 f15e141..74a0c86 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 961d466..4bf7158 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 <http://www.gnu.org/licenses/>. */ +#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 1935966..c1973aa 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 ad36b83..e1f6f3d 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 <http://www.gnu.org/licenses/>. */ #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 7d3df7c..eb5f1e7 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 <http://www.gnu.org/licenses/>. */ +#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 164aba4..fbe1d6d 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 <http://www.gnu.org/licenses/>. */ +#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 27f411c..88e7523 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 78d1fb7..e96ade3 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 <http://www.gnu.org/licenses/>. */ +#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 b5a1dcdc..79fde24 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 4c8a362..2930888 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 caf6279..eb1f793 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 04920f2..585ba53 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 8fa7bdf..6dbef20 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 <http://www.gnu.org/licenses/>. */ +#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 2366fa7..38dd470 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 <http://www.gnu.org/licenses/>. */ +#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 17f37a3..1216782 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 <http://www.gnu.org/licenses/>. */ +#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 583956f..e732c22 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 <http://www.gnu.org/licenses/>. */ #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 cc7f529..83a36db 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 <http://www.gnu.org/licenses/>. */ #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 54fc94e..fe32be4 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 <http://www.gnu.org/licenses/>. */ +#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 1d81b38..1b6cd0b 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 1d4311a..e1d19f9 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 <http://www.gnu.org/licenses/>. */ +#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 bebf027..1895bb4 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 <http://www.gnu.org/licenses/>. */ +#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 a3a1d11..93ac830 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 <http://www.gnu.org/licenses/>. */ +#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 fc2ba19..22c203b 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 <http://www.gnu.org/licenses/>. */ +#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 d9c4265..c05e971 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 <http://www.gnu.org/licenses/>. */ +#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 15181c3..c541a05 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 <http://www.gnu.org/licenses/>. */ +#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 a464c2d..fab0702 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 <http://www.gnu.org/licenses/>. */ +#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 40ca6b2..884861d 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 <http://www.gnu.org/licenses/>. */ +#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 9d7fe18..a8bf847 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<lto_diagnostic_option_manager> (), 0); if (atexit (lto_wrapper_cleanup) != 0) fatal_error (input_location, "%<atexit%> failed"); diff --git a/gcc/lto/lto-common.cc b/gcc/lto/lto-common.cc index 34aa63b..7760775 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 <http://www.gnu.org/licenses/>. */ +#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 b570bcc..be869c2 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 <http://www.gnu.org/licenses/>. */ +#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 2238650..2267b4e 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 <http://www.gnu.org/licenses/>. */ #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 a40218b..b12937c 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 <http://www.gnu.org/licenses/>. */ +#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 1ee215d..e5b24f2 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 <http://www.gnu.org/licenses/>. */ +#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 637ec0b..e0a94ee 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 <http://www.gnu.org/licenses/>. */ +#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 9e0e82f..d55d6c2 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 <http://www.gnu.org/licenses/>. */ +#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 a5c59fd..76e1dd9 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GASCII.h b/gcc/m2/mc-boot/GASCII.h index c157a8b..76c961a 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 182def8..8fc16a4 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GArgs.h b/gcc/m2/mc-boot/GArgs.h index 1171cef..752345f 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 b6b4795..34989b9 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GAssertion.h b/gcc/m2/mc-boot/GAssertion.h index d909fde..c5bcdd98 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 4fea839..ffbe2f1 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GBreak.h b/gcc/m2/mc-boot/GBreak.h index bd2f1cc..df0ee16 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 a744d9c..dff08a0 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 cb8fa8a..0e33d91 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GCmdArgs.h b/gcc/m2/mc-boot/GCmdArgs.h index 7f39815..852e8dc 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 3f0ec51..edda6c9 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GDebug.h b/gcc/m2/mc-boot/GDebug.h index 8787752..08c4da1 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 2b182b9..bccbeda 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GDynamicStrings.h b/gcc/m2/mc-boot/GDynamicStrings.h index e0652a7..fefce9d 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 aad1bb4..95dab81 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GEnvironment.h b/gcc/m2/mc-boot/GEnvironment.h index 4f94d58..2da03ae 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 b05c330..45a39d6 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GFIO.h b/gcc/m2/mc-boot/GFIO.h index d823964..04cbc76 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 d3acec3..36998f6 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GFormatStrings.h b/gcc/m2/mc-boot/GFormatStrings.h index 1d8ce34..858403d 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 09fd4fb95c..3c4fb61 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GFpuIO.h b/gcc/m2/mc-boot/GFpuIO.h index 5d83060..1e0575b 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 4b76ed6..76495e7 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GIO.h b/gcc/m2/mc-boot/GIO.h index 4f4af9a..3e58ea5 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 dd31400..4dfccd2 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GIndexing.h b/gcc/m2/mc-boot/GIndexing.h index b986469..e2e728c 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 c965f4b..f4fe04c 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GM2Dependent.h b/gcc/m2/mc-boot/GM2Dependent.h index 0353236..3b32e16 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 97417cf..af1218f 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GM2EXCEPTION.h b/gcc/m2/mc-boot/GM2EXCEPTION.h index 4ee5404..fef5e2b 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 ef5f7cf..844006a 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GM2RTS.h b/gcc/m2/mc-boot/GM2RTS.h index 055cc95..88e2184 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 1d9feed..04474ec 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GMemUtils.h b/gcc/m2/mc-boot/GMemUtils.h index 1d23091..dea7aaf 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 75720dd..15b3be1 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GNumberIO.h b/gcc/m2/mc-boot/GNumberIO.h index 34aee33..decd31b 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 9bc2a83..5c50f96 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GPushBackInput.h b/gcc/m2/mc-boot/GPushBackInput.h index 076b996..27c572b 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 a0eff3e..d42c1f3 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GRTExceptions.h b/gcc/m2/mc-boot/GRTExceptions.h index 9e188bc..b335d80 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 778b75f..2e014d3 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 9acb077..3eb8822 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 11b4228..f1c2688 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GRTint.h b/gcc/m2/mc-boot/GRTint.h index 4f81546..a9fb9d1 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 93083a0..0c99f2d 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GSArgs.h b/gcc/m2/mc-boot/GSArgs.h index a7b10bf..6a12e7e 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 b568cce..232d3f5 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GSFIO.h b/gcc/m2/mc-boot/GSFIO.h index 108d8ea..bba25eb 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 a18a176..ff4b7b2 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 67b7f06..17e926d 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 c9d3774..ddcb8ec 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GStdIO.h b/gcc/m2/mc-boot/GStdIO.h index 0a45ebc..3c84ced 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 67e7a8b..24ced14 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GStorage.h b/gcc/m2/mc-boot/GStorage.h index 8c26b46..a119a8f 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 94927745..03993e5 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GStrCase.h b/gcc/m2/mc-boot/GStrCase.h index c3f0647..9fd2328 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 d0c6e20..7e94ef5 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GStrIO.h b/gcc/m2/mc-boot/GStrIO.h index 2ed2ac3..653e020 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 dc6d0ff..19ac230 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GStrLib.h b/gcc/m2/mc-boot/GStrLib.h index b292d89..ddd7457 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 80efd0c..822813c 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GStringConvert.h b/gcc/m2/mc-boot/GStringConvert.h index 284eef2..3983d6c 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 00dd521..eee2631 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 1ef7230..fe06a5d 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GSysStorage.h b/gcc/m2/mc-boot/GSysStorage.h index 639f681..2aa6f85 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 af7b7e4..3740565 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GTimeString.h b/gcc/m2/mc-boot/GTimeString.h index 7ba51f8..27d1287 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 cf9756e..6c04a94 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 ca582f3..a2ad922 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/Galists.h b/gcc/m2/mc-boot/Galists.h index 3ed5241..3bb6599 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 9af2842..0878f7d 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/Gdecl.h b/gcc/m2/mc-boot/Gdecl.h index 99d7808..8b7aa91 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 c1b3619..d06a034 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 7f065cc..9d315c3 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 3a5dd5c..a56abc5 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> @@ -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 afa945d..f0911ee 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 c4b4d90..a8f72ea 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 def419f..50384ec 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 d3c9415..19ee9e5 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 e33c91d..d354e86 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/Glists.h b/gcc/m2/mc-boot/Glists.h index 5cb8058..e8414b0 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 4c76502..6b27d93 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcComment.h b/gcc/m2/mc-boot/GmcComment.h index 39ba8c2..57952a1 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 c941c61..ca192aa 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcComp.h b/gcc/m2/mc-boot/GmcComp.h index 9ab78a5..088b663 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 0085384..7ded4ae 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcDebug.h b/gcc/m2/mc-boot/GmcDebug.h index e8ec34b..8de6dc4 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 5893201..cb5e30f 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcError.h b/gcc/m2/mc-boot/GmcError.h index 6a62fcd..0c369b2 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 3b51659..f0f6912 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcFileName.h b/gcc/m2/mc-boot/GmcFileName.h index a5a9afa..42c05b9 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 4cbd544..39860c2 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcLexBuf.h b/gcc/m2/mc-boot/GmcLexBuf.h index ca71dd8..714d049 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 af64604..9298d0e 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcMetaError.h b/gcc/m2/mc-boot/GmcMetaError.h index a3c19c4..78dc128 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 5a06060..f6e4417 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcOptions.h b/gcc/m2/mc-boot/GmcOptions.h index 4bb82ec..b2ead1e 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 741109a..54d89bf 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcPreprocess.h b/gcc/m2/mc-boot/GmcPreprocess.h index f12c781..fcbd0c3 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 0bffa1f..c0be8c1 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcPretty.h b/gcc/m2/mc-boot/GmcPretty.h index 1a61c89..c1d59ce 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 e91e55a..dafa728 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcPrintf.h b/gcc/m2/mc-boot/GmcPrintf.h index 46aeaac..1f242a8 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 d0f2f009..3309f13 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcQuiet.h b/gcc/m2/mc-boot/GmcQuiet.h index 9065ff9..be6f4ea 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 a42f1b1..02132e4 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcReserved.h b/gcc/m2/mc-boot/GmcReserved.h index ab844ee..b781702 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 e1a2aa6..14d3e3f 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcSearch.h b/gcc/m2/mc-boot/GmcSearch.h index f4324a0..36ed609 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 70f937b..8edae47 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcStack.h b/gcc/m2/mc-boot/GmcStack.h index 70b22be..476ff65f 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 da44d8f..1843060 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GmcStream.h b/gcc/m2/mc-boot/GmcStream.h index a156d88..473b05d 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 9e6d4c4..ff14f9f 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 b4ccf80..8971c32 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 <https://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/Gmcp1.h b/gcc/m2/mc-boot/Gmcp1.h index 878d164..758d8c0 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 f61e422..2a3a38c 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 <https://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/Gmcp2.h b/gcc/m2/mc-boot/Gmcp2.h index b483b2d..ec894e1 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 5cb83f4..b5ade48 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 <https://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/Gmcp3.h b/gcc/m2/mc-boot/Gmcp3.h index 0e00ddc..87856ed 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 ce8cb78..8697637 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 <https://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/Gmcp4.h b/gcc/m2/mc-boot/Gmcp4.h index 643b939..c229beb 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 909c622..ec24169 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 <https://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/Gmcp5.h b/gcc/m2/mc-boot/Gmcp5.h index 7989101..de3edb1 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 3e86888..8f4a330 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GnameKey.h b/gcc/m2/mc-boot/GnameKey.h index a2ea330..d4cce1b 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 1707259..50b8c8f 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/GsymbolKey.h b/gcc/m2/mc-boot/GsymbolKey.h index 6967098..5d05977 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 acb7fcf..70c0c49 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 dfefe42..1a8597a 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/Gvarargs.cc b/gcc/m2/mc-boot/Gvarargs.cc index 69f5f2c..32f984d 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/Gvarargs.h b/gcc/m2/mc-boot/Gvarargs.h index 82b5b75..8e3e91a 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 87daa42..9262329 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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <stdbool.h> diff --git a/gcc/m2/mc-boot/Gwlists.h b/gcc/m2/mc-boot/Gwlists.h index 05d6594..53bad73 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 e4db1e2..fdbeabc 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 f3f0930..a182e12 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 19e98ed..21b6211 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 c157a8b..6346caa 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 284567d..c295985 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<Args__T1> (UnixArgs_GetArgV ()); while ((j < High) && ((*(*Source).array[i]).array[j] != ASCII_nul)) { - a[j] = (*(*Source).array[i]).array[j]; + const_cast<char *>(a)[j] = (*(*Source).array[i]).array[j]; j += 1; } } if (j <= High) { - a[j] = ASCII_nul; + const_cast<char *>(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 1171cef..b912da6 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 3dae36d..8aad1cd 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 d909fde..9e0777f 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 bd2f1cc..635d82c 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 7f39815..c7b3dd2 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 deb7f9e..91dd960 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 <string.h> #include <limits.h> -#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 8787752..c853211 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 3296969..d6f5f83 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 <http://www.gnu.org/licenses/>. */ -#include "config.h" -#include "system.h" #include <stdbool.h> # 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 <stddef.h> +#include <string.h> +#include <limits.h> +#include <stdlib.h> # include "GStorage.h" +#include <unistd.h> #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<unsigned int> (high-o)), 0); + stop = Max (Min (MaxBuf, static_cast<unsigned int> (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<DynamicStrings_String__opaque> (s)->contents.buf.array[start], static_cast<unsigned int> (end-start)); + ConcatContentsAddress (&t->contents, &static_cast<DynamicStrings_String__opaque> (s)->contents.buf.array[start], static_cast<unsigned int> (stop-start)); o += static_cast<DynamicStrings_String__opaque> (s)->contents.len; s = static_cast<DynamicStrings_String> (static_cast<DynamicStrings_String__opaque> (s)->contents.next); } diff --git a/gcc/m2/pge-boot/GDynamicStrings.h b/gcc/m2/pge-boot/GDynamicStrings.h index e0652a7..4d77cec 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 4f94d58..4645a49 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 3e56792..b30d969 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<FIO__T7 *> (fd->buffer->address); /* provides easy access for reading characters */ + fd->buffer->contents = static_cast<FIO__T7 *> (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<char *>(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<char *>(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<char *>(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<unsigned char *>(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<char *>(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<char *>(dest)[j] = (*p); j += 1; p += 1; } if (j < HighDest) { - dest[j] = ASCII_nul; + const_cast<char *>(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<char *>(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<char *>(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<char *>(dest)[j] = src[i]; i += 1; j += 1; } } if (j < HighDest) { - dest[j] = ASCII_nul; + const_cast<char *>(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<void*> (static_cast<const void*>(fname)), StrLib_StrLen ((const char *) fname, _fname_high), state, use, towrite, bufsize)) == f) { fd = static_cast<FIO_FileDescriptor> (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<void*> (static_cast<const void*>(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<void*> (static_cast<const void*>(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<void*> (static_cast<const void*>(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<void*> (static_cast<const void*>(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<void*> (static_cast<const void*>(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<char *>(a)[i] = ASCII_nul; i += 1; } else { - a[i] = ch; + const_cast<char *>(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<char *>(a)[i] = (*p); p += 1; i += 1; } diff --git a/gcc/m2/pge-boot/GFIO.h b/gcc/m2/pge-boot/GFIO.h index d823964..160fade 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 1d8ce34..61f738b 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 5d83060..70cc45d 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 7d391bb..9f781b5 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 <stdlib.h> #include <unistd.h> -#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 4f4af9a..ae16019 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 21e3a43..fa7837c 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<Indexing_Index> (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<Indexing_Index__opaque> (i)->ArrayStart, static_cast<Indexing_Index__opaque> (i)->ArraySize); Storage_DEALLOCATE ((void **) &i, sizeof (Indexing__T2)); - return NULL; + return static_cast<Indexing_Index> (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<Indexing_Index__opaque> (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<Indexing_Index__opaque> (i)->Low) && (n <= static_cast<Indexing_Index__opaque> (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<Indexing_Index__opaque> (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<Indexing_Index__opaque> (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<Indexing_Index__opaque> (i)->Low) { M2RTS_HALT (-1); __builtin_unreachable (); } else { - oldSize = i->ArraySize; - while (((n-i->Low)*sizeof (void *)) >= i->ArraySize) + oldSize = static_cast<Indexing_Index__opaque> (i)->ArraySize; + while (((n-static_cast<Indexing_Index__opaque> (i)->Low)*sizeof (void *)) >= static_cast<Indexing_Index__opaque> (i)->ArraySize) { - i->ArraySize = i->ArraySize*i->GrowFactor; + static_cast<Indexing_Index__opaque> (i)->ArraySize = static_cast<Indexing_Index__opaque> (i)->ArraySize*static_cast<Indexing_Index__opaque> (i)->GrowFactor; } - if (oldSize != i->ArraySize) + if (oldSize != static_cast<Indexing_Index__opaque> (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<Indexing_Index__opaque> (i)->ArrayStart, static_cast<Indexing_Index__opaque> (i)->ArraySize); /* and initialize the remainder of the array to NIL */ - b = i->ArrayStart; + b = static_cast<Indexing_Index__opaque> (i)->ArrayStart; b = reinterpret_cast<void *> (reinterpret_cast<char *> (b)+oldSize); - b = libc_memset (b, 0, static_cast<size_t> (i->ArraySize-oldSize)); + b = libc_memset (b, 0, static_cast<size_t> (static_cast<Indexing_Index__opaque> (i)->ArraySize-oldSize)); } - i->High = n; + static_cast<Indexing_Index__opaque> (i)->High = n; } } - b = i->ArrayStart; - b = reinterpret_cast<void *> (reinterpret_cast<char *> (b)+(n-i->Low)*sizeof (void *)); + b = static_cast<Indexing_Index__opaque> (i)->ArrayStart; + b = reinterpret_cast<void *> (reinterpret_cast<char *> (b)+(n-static_cast<Indexing_Index__opaque> (i)->Low)*sizeof (void *)); p = static_cast<PutIndice__T1> (b); - (*p) = reinterpret_cast<unsigned int *> (a); - i->Used += 1; - if (i->Debug) + (*p) = static_cast<unsigned int *> (a); + static_cast<Indexing_Index__opaque> (i)->Used += 1; + if (static_cast<Indexing_Index__opaque> (i)->Debug) { if (n < 32) { - i->Map |= (1 << (n )); + static_cast<Indexing_Index__opaque> (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<Indexing_PtrToByte> (i->ArrayStart); - b += (n-i->Low)*sizeof (void *); + b = static_cast<Indexing_PtrToByte> (static_cast<Indexing_Index__opaque> (i)->ArrayStart); + b += (n-static_cast<Indexing_Index__opaque> (i)->Low)*sizeof (void *); p = (Indexing_PtrToAddress) (b); - if (i->Debug) + if (static_cast<Indexing_Index__opaque> (i)->Debug) { - if (((n < 32) && (! ((((1 << (n)) & (i->Map)) != 0)))) && ((*p) != NULL)) + if (((n < 32) && (! ((((1 << (n)) & (static_cast<Indexing_Index__opaque> (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<Indexing_PtrToByte> (i->ArrayStart); - while (j <= i->High) + j = static_cast<Indexing_Index__opaque> (i)->Low; + b = static_cast<Indexing_PtrToByte> (static_cast<Indexing_Index__opaque> (i)->ArrayStart); + while (j <= static_cast<Indexing_Index__opaque> (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<Indexing_PtrToByte> (i->ArrayStart); - while (j <= i->High) + j = static_cast<Indexing_Index__opaque> (i)->Low; + b = static_cast<Indexing_PtrToByte> (static_cast<Indexing_Index__opaque> (i)->ArrayStart); + while (j <= static_cast<Indexing_Index__opaque> (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<Indexing_PtrToByte> (i->ArrayStart); - b += sizeof (void *)*(j-i->Low); + b = static_cast<Indexing_PtrToByte> (static_cast<Indexing_Index__opaque> (i)->ArrayStart); + b += sizeof (void *)*(j-static_cast<Indexing_Index__opaque> (i)->Low); p = (Indexing_PtrToAddress) (b); b += sizeof (void *); - p = static_cast<Indexing_PtrToAddress> (libc_memmove (reinterpret_cast<void *> (p), reinterpret_cast<void *> (b), static_cast<size_t> ((i->High-j)*sizeof (void *)))); - i->High -= 1; - i->Used -= 1; + p = static_cast<Indexing_PtrToAddress> (libc_memmove (reinterpret_cast <void *> (p), reinterpret_cast <void *> (b), static_cast<size_t> ((static_cast<Indexing_Index__opaque> (i)->High-j)*sizeof (void *)))); + static_cast<Indexing_Index__opaque> (i)->High -= 1; + static_cast<Indexing_Index__opaque> (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<Indexing_Index__opaque> (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<Indexing_Index__opaque> (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<Indexing_Index__opaque> (i)->Low; + b = static_cast<Indexing_PtrToByte> (static_cast<Indexing_Index__opaque> (i)->ArrayStart); + while (j <= static_cast<Indexing_Index__opaque> (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 d65e8bd..264e60e 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 4b15e20..b49dda7 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<Lists_List__opaque> ((*l))->NoOfElements = 0; + static_cast<Lists_List__opaque> ((*l))->Next = static_cast<Lists_List__opaque> (NULL); } @@ -179,9 +176,9 @@ extern "C" void Lists_KillList (Lists_List *l) { if ((*l) != NULL) { - if ((*l)->Next != NULL) + if (static_cast<Lists_List__opaque> ((*l))->Next != NULL) { - Lists_KillList (&(*l)->Next); + Lists_KillList (reinterpret_cast<Lists_List *> (&static_cast<Lists_List__opaque> ((*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<Lists_List__opaque> (l)->NoOfElements < MaxNoOfElements) { - l->NoOfElements += 1; - l->Elements.array[l->NoOfElements-1] = c; + static_cast<Lists_List__opaque> (l)->NoOfElements += 1; + static_cast<Lists_List__opaque> (l)->Elements.array[static_cast<Lists_List__opaque> (l)->NoOfElements-1] = c; } - else if (l->Next != NULL) + else if (static_cast<Lists_List__opaque> (l)->Next != NULL) { /* avoid dangling else. */ - Lists_PutItemIntoList (l->Next, c); + Lists_PutItemIntoList (static_cast<Lists_List> (static_cast<Lists_List__opaque> (l)->Next), c); } else { /* avoid dangling else. */ - Lists_InitList (&l->Next); - Lists_PutItemIntoList (l->Next, c); + Lists_InitList (reinterpret_cast<Lists_List *> (&static_cast<Lists_List__opaque> (l)->Next)); + Lists_PutItemIntoList (static_cast<Lists_List> (static_cast<Lists_List__opaque> (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<Lists_List__opaque> (l)->NoOfElements) { - return l->Elements.array[n-1]; + return static_cast<Lists_List__opaque> (l)->Elements.array[n-1]; } else { - n -= l->NoOfElements; + n -= static_cast<Lists_List__opaque> (l)->NoOfElements; } - l = l->Next; + l = static_cast<Lists_List> (static_cast<Lists_List__opaque> (l)->Next); } return static_cast<unsigned int> (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<Lists_List__opaque> (l)->NoOfElements) { - if (l->Elements.array[i-1] == c) + if (static_cast<Lists_List__opaque> (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<Lists_List__opaque> (l)->NoOfElements+(Lists_GetIndexOfList (static_cast<Lists_List> (static_cast<Lists_List__opaque> (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<Lists_List__opaque> (l)->NoOfElements; + l = static_cast<Lists_List> (static_cast<Lists_List__opaque> (l)->Next); } while (! (l == NULL)); return t; } @@ -316,33 +313,33 @@ extern "C" void Lists_IncludeItemIntoList (Lists_List l, unsigned int c) extern "C" void Lists_RemoveItemFromList (Lists_List l, unsigned int c) { - Lists_List p; + Lists_List__opaque p; unsigned int i; bool Found; if (l != NULL) { Found = false; - p = NULL; + p = static_cast<Lists_List__opaque> (NULL); do { i = 1; - while ((i <= l->NoOfElements) && (l->Elements.array[i-1] != c)) + while ((i <= static_cast<Lists_List__opaque> (l)->NoOfElements) && (static_cast<Lists_List__opaque> (l)->Elements.array[i-1] != c)) { i += 1; } - if ((i <= l->NoOfElements) && (l->Elements.array[i-1] == c)) + if ((i <= static_cast<Lists_List__opaque> (l)->NoOfElements) && (static_cast<Lists_List__opaque> (l)->Elements.array[i-1] == c)) { Found = true; } else { - p = l; - l = l->Next; + p = static_cast<Lists_List__opaque> (l); + l = static_cast<Lists_List> (static_cast<Lists_List__opaque> (l)->Next); } } while (! ((l == NULL) || Found)); if (Found) { - RemoveItem (p, l, i); + RemoveItem (p, static_cast<Lists_List__opaque> (l), i); } } } @@ -358,9 +355,9 @@ extern "C" bool Lists_IsItemInList (Lists_List l, unsigned int c) do { i = 1; - while (i <= l->NoOfElements) + while (i <= static_cast<Lists_List__opaque> (l)->NoOfElements) { - if (l->Elements.array[i-1] == c) + if (static_cast<Lists_List__opaque> (l)->Elements.array[i-1] == c) { return true; } @@ -369,7 +366,7 @@ extern "C" bool Lists_IsItemInList (Lists_List l, unsigned int c) i += 1; } } - l = l->Next; + l = static_cast<Lists_List> (static_cast<Lists_List__opaque> (l)->Next); } while (! (l == NULL)); return false; /* static analysis guarentees a RETURN statement will be used before here. */ @@ -402,19 +399,19 @@ extern "C" void Lists_ForeachItemInListDo (Lists_List l, SymbolKey_PerformOperat extern "C" Lists_List Lists_DuplicateList (Lists_List l) { - Lists_List m; + Lists_List__opaque m; unsigned int n; unsigned int i; - Lists_InitList (&m); + Lists_InitList (reinterpret_cast<Lists_List *> (&m)); n = Lists_NoOfItemsInList (l); i = 1; while (i <= n) { - Lists_PutItemIntoList (m, Lists_GetItemFromList (l, i)); + Lists_PutItemIntoList (static_cast<Lists_List> (m), Lists_GetItemFromList (l, i)); i += 1; } - return m; + return static_cast<Lists_List> (m); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } diff --git a/gcc/m2/pge-boot/GLists.h b/gcc/m2/pge-boot/GLists.h index e968005..0d92571 100644 --- a/gcc/m2/pge-boot/GLists.h +++ b/gcc/m2/pge-boot/GLists.h @@ -24,8 +24,6 @@ along with GNU Modula-2; see the file COPYING3. If not see #if !defined (_Lists_H) # define _Lists_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GM2Dependent.cc b/gcc/m2/pge-boot/GM2Dependent.cc index 89c8083..c221786 100644 --- a/gcc/m2/pge-boot/GM2Dependent.cc +++ b/gcc/m2/pge-boot/GM2Dependent.cc @@ -50,9 +50,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # undef NULL # define NULL 0 #endif -#define _M2Dependent_H #define _M2Dependent_C +#include "GM2Dependent.h" # include "Glibc.h" # include "GASCII.h" # include "GSYSTEM.h" @@ -79,9 +79,6 @@ typedef struct M2Dependent__T4_a M2Dependent__T4; typedef enum {M2Dependent_unregistered, M2Dependent_unordered, M2Dependent_started, M2Dependent_ordered, M2Dependent_user} M2Dependent_DependencyState; -typedef void (*M2Dependent_ArgCVEnvP_t) (int, void *, void *); -struct M2Dependent_ArgCVEnvP_p { M2Dependent_ArgCVEnvP_t proc; }; - struct M2Dependent_DependencyList_r { PROC proc; bool forced; @@ -641,11 +638,11 @@ static void toCString (char *str, unsigned int _str_high) { if (str[i+1] == 'n') { - str[i] = ASCII_nl; + const_cast<char *>(str)[i] = ASCII_nl; j = i+1; while (j < high) { - str[j] = str[j+1]; + const_cast<char *>(str)[j] = str[j+1]; j += 1; } } @@ -965,7 +962,7 @@ static void DisplayModuleInfo (M2Dependent_DependencyState state, const char *de if (Modules.array[state-M2Dependent_unregistered] != NULL) { - libc_printf ((const char *) "%s modules\\n", 12, &desc); + libc_printf ((const char *) "%s modules\\n", 12, const_cast<void*> (static_cast<const void*>(desc))); mptr = Modules.array[state-M2Dependent_unregistered]; count = 0; do { @@ -1214,7 +1211,7 @@ static bool equal (void * cstr, const char *str_, unsigned int _str_high) /* make a local copy of each unbounded array. */ memcpy (str, str_, _str_high+1); - return (strncmp (reinterpret_cast<M2Dependent_PtrToChar> (cstr), reinterpret_cast<M2Dependent_PtrToChar> (&str), StrLib_StrLen ((const char *) str, _str_high))) == 0; + return (strncmp (reinterpret_cast <M2Dependent_PtrToChar> (cstr), reinterpret_cast <M2Dependent_PtrToChar> (const_cast<void*> (static_cast<const void*>(str))), StrLib_StrLen ((const char *) str, _str_high))) == 0; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -1252,7 +1249,7 @@ static void SetupDebugFlags (void) ForceTrace = false; HexTrace = false; WarningTrace = false; - pc = static_cast<SetupDebugFlags__T1> (libc_getenv (const_cast<void*> (reinterpret_cast<const void*>("GCC_M2LINK_RTFLAG")))); + pc = static_cast<SetupDebugFlags__T1> (libc_getenv (const_cast<void*> (static_cast<const void*>("GCC_M2LINK_RTFLAG")))); while ((pc != NULL) && ((*pc) != ASCII_nul)) { if (equal (reinterpret_cast<void *> (pc), (const char *) "all", 3)) diff --git a/gcc/m2/pge-boot/GM2Dependent.h b/gcc/m2/pge-boot/GM2Dependent.h index 0353236..29c61f6 100644 --- a/gcc/m2/pge-boot/GM2Dependent.h +++ b/gcc/m2/pge-boot/GM2Dependent.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_M2Dependent_H) # define _M2Dependent_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GM2EXCEPTION.cc b/gcc/m2/pge-boot/GM2EXCEPTION.cc index 274f29a..e9fc91b 100644 --- a/gcc/m2/pge-boot/GM2EXCEPTION.cc +++ b/gcc/m2/pge-boot/GM2EXCEPTION.cc @@ -34,14 +34,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <limits.h> # include "Gmcrts.h" -#define _M2EXCEPTION_H #define _M2EXCEPTION_C +#include "GM2EXCEPTION.h" # include "GSYSTEM.h" # include "GRTExceptions.h" -typedef enum {M2EXCEPTION_indexException, M2EXCEPTION_rangeException, M2EXCEPTION_caseSelectException, M2EXCEPTION_invalidLocation, M2EXCEPTION_functionException, M2EXCEPTION_wholeValueException, M2EXCEPTION_wholeDivException, M2EXCEPTION_realValueException, M2EXCEPTION_realDivException, M2EXCEPTION_complexValueException, M2EXCEPTION_complexDivException, M2EXCEPTION_protException, M2EXCEPTION_sysException, M2EXCEPTION_coException, M2EXCEPTION_exException} M2EXCEPTION_M2Exceptions; - extern "C" M2EXCEPTION_M2Exceptions M2EXCEPTION_M2Exception (void); extern "C" bool M2EXCEPTION_IsM2Exception (void); @@ -57,7 +55,7 @@ extern "C" M2EXCEPTION_M2Exceptions M2EXCEPTION_M2Exception (void) n = RTExceptions_GetNumber (e); if (n == (UINT_MAX)) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast<void*> (reinterpret_cast<const void*>("M2Exception")), const_cast<void*> (reinterpret_cast<const void*>("current coroutine is not in the exceptional execution state"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/M2EXCEPTION.mod")), 47, 6, const_cast<void*> (static_cast<const void*>("M2Exception")), const_cast<void*> (static_cast<const void*>("current coroutine is not in the exceptional execution state"))); } else { diff --git a/gcc/m2/pge-boot/GM2EXCEPTION.h b/gcc/m2/pge-boot/GM2EXCEPTION.h index 4ee5404..5fd59cf 100644 --- a/gcc/m2/pge-boot/GM2EXCEPTION.h +++ b/gcc/m2/pge-boot/GM2EXCEPTION.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_M2EXCEPTION_H) # define _M2EXCEPTION_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GM2RTS.cc b/gcc/m2/pge-boot/GM2RTS.cc index ef5f7cf..761bb82 100644 --- a/gcc/m2/pge-boot/GM2RTS.cc +++ b/gcc/m2/pge-boot/GM2RTS.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 <http://www.gnu.org/licenses/>. */ -#include "config.h" -#include "system.h" #include <stdbool.h> # if !defined (PROC_D) # define PROC_D @@ -42,6 +40,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # define FALSE (1==0) # endif +#include <string.h> +#include <limits.h> +#include <stdlib.h> +#include <unistd.h> #define _M2RTS_C #include "GM2RTS.h" @@ -133,7 +135,7 @@ extern "C" void M2RTS_ExecuteTerminationProcedures (void); not call ExecuteTerminationProcedures. */ -extern "C" void M2RTS_Terminate (void) __attribute__ ((noreturn)); +extern "C" void M2RTS_Terminate (void); /* HALT - terminate the current program. The procedure @@ -146,7 +148,7 @@ extern "C" void M2RTS_Terminate (void) __attribute__ ((noreturn)); then calling HALT with no parameter. */ -extern "C" void M2RTS_HALT (int exitcode) __attribute__ ((noreturn)); +extern "C" void M2RTS_HALT (int exitcode); /* Halt - provides a more user friendly version of HALT, which takes @@ -154,7 +156,7 @@ extern "C" void M2RTS_HALT (int exitcode) __attribute__ ((noreturn)); to stderr and calls exit (1). */ -extern "C" void M2RTS_Halt (const char *description_, unsigned int _description_high, const char *filename_, unsigned int _filename_high, const char *function_, unsigned int _function_high, unsigned int line) __attribute__ ((noreturn)); +extern "C" void M2RTS_Halt (const char *description_, unsigned int _description_high, const char *filename_, unsigned int _filename_high, const char *function_, unsigned int _function_high, unsigned int line); /* HaltC - provides a more user friendly version of HALT, which takes @@ -162,7 +164,7 @@ extern "C" void M2RTS_Halt (const char *description_, unsigned int _description_ to stderr and calls exit (1). */ -extern "C" void M2RTS_HaltC (void * description, void * filename, void * function, unsigned int line) __attribute__ ((noreturn)); +extern "C" void M2RTS_HaltC (void * description, void * filename, void * function, unsigned int line); /* ExitOnHalt - if HALT is executed then call exit with the exit code, e. @@ -174,7 +176,7 @@ extern "C" void M2RTS_ExitOnHalt (int e); ErrorMessage - emits an error message to stderr and then calls exit (1). */ -extern "C" void M2RTS_ErrorMessage (const char *message_, unsigned int _message_high, const char *filename_, unsigned int _filename_high, unsigned int line, const char *function_, unsigned int _function_high) __attribute__ ((noreturn)); +extern "C" void M2RTS_ErrorMessage (const char *message_, unsigned int _message_high, const char *filename_, unsigned int _filename_high, unsigned int line, const char *function_, unsigned int _function_high); /* Length - returns the length of a string, a. This is called whenever @@ -183,30 +185,30 @@ extern "C" void M2RTS_ErrorMessage (const char *message_, unsigned int _message_ */ extern "C" unsigned int M2RTS_Length (const char *a_, unsigned int _a_high); -extern "C" void M2RTS_AssignmentException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ReturnException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_IncException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_DecException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_InclException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ExclException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ShiftException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_RotateException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_StaticArraySubscriptException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_DynamicArraySubscriptException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ForLoopBeginException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ForLoopToException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ForLoopEndException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_PointerNilException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_NoReturnException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_CaseException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_WholeNonPosDivException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_WholeNonPosModException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_WholeZeroDivException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_WholeZeroRemException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_WholeValueException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_RealValueException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_ParameterException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); -extern "C" void M2RTS_NoException (void * filename, unsigned int line, unsigned int column, void * scope, void * message) __attribute__ ((noreturn)); +extern "C" void M2RTS_AssignmentException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ReturnException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_IncException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_DecException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_InclException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ExclException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ShiftException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_RotateException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_StaticArraySubscriptException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_DynamicArraySubscriptException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ForLoopBeginException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ForLoopToException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ForLoopEndException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_PointerNilException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_NoReturnException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_CaseException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_WholeNonPosDivException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_WholeNonPosModException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_WholeZeroDivException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_WholeZeroRemException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_WholeValueException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_RealValueException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_ParameterException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); +extern "C" void M2RTS_NoException (void * filename, unsigned int line, unsigned int column, void * scope, void * message); /* ErrorString - writes a string to stderr. @@ -224,7 +226,7 @@ static void ErrorStringC (void * str); ErrorMessageC - emits an error message to stderr and then calls exit (1). */ -static void ErrorMessageC (void * message, void * filename, unsigned int line, void * function) __attribute__ ((noreturn)); +static void ErrorMessageC (void * message, void * filename, unsigned int line, void * function); /* Init - initialize the initial, terminate procedure lists and booleans. diff --git a/gcc/m2/pge-boot/GM2RTS.h b/gcc/m2/pge-boot/GM2RTS.h index 055cc95..df03678 100644 --- a/gcc/m2/pge-boot/GM2RTS.h +++ b/gcc/m2/pge-boot/GM2RTS.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_M2RTS_H) # define _M2RTS_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GNameKey.cc b/gcc/m2/pge-boot/GNameKey.cc index 52b90a0..98bb148 100644 --- a/gcc/m2/pge-boot/GNameKey.cc +++ b/gcc/m2/pge-boot/GNameKey.cc @@ -44,9 +44,9 @@ along with GNU Modula-2; see the file COPYING3. If not see # undef NULL # define NULL 0 #endif -#define _NameKey_H #define _NameKey_C +#include "GNameKey.h" # include "GSYSTEM.h" # include "GStorage.h" # include "GIndexing.h" @@ -401,13 +401,13 @@ extern "C" void NameKey_GetKey (NameKey_Name key, char *a, unsigned int _a_high) higha = _a_high; while (((p != NULL) && (i <= higha)) && ((*p) != ASCII_nul)) { - a[i] = (*p); + const_cast<char *>(a)[i] = (*p); p += 1; i += 1; } if (i <= higha) { - a[i] = ASCII_nul; + const_cast<char *>(a)[i] = ASCII_nul; } } diff --git a/gcc/m2/pge-boot/GNameKey.h b/gcc/m2/pge-boot/GNameKey.h index bb003f7..fc80892 100644 --- a/gcc/m2/pge-boot/GNameKey.h +++ b/gcc/m2/pge-boot/GNameKey.h @@ -24,8 +24,6 @@ along with GNU Modula-2; see the file COPYING3. If not see #if !defined (_NameKey_H) # define _NameKey_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GNumberIO.cc b/gcc/m2/pge-boot/GNumberIO.cc index 04e9d3c..f6a8b6f 100644 --- a/gcc/m2/pge-boot/GNumberIO.cc +++ b/gcc/m2/pge-boot/GNumberIO.cc @@ -43,9 +43,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <string.h> #include <limits.h> #include <stdlib.h> -#define _NumberIO_H #define _NumberIO_C +#include "GNumberIO.h" # include "GASCII.h" # include "GStrIO.h" # include "GStrLib.h" @@ -173,19 +173,19 @@ extern "C" void NumberIO_CardToStr (unsigned int x, unsigned int n, char *a, uns Higha = _a_high; while ((n > i) && (j <= Higha)) { - a[j] = ' '; + const_cast<char *>(a)[j] = ' '; j += 1; n -= 1; } while ((i > 0) && (j <= Higha)) { - a[j] = ((char) (buf.array[i-1]+ ((unsigned int) ('0')))); + const_cast<char *>(a)[j] = ((char) (buf.array[i-1]+ ((unsigned int) ('0')))); j += 1; i -= 1; } if (j <= Higha) { - a[j] = ASCII_nul; + const_cast<char *>(a)[j] = ASCII_nul; } } @@ -271,7 +271,7 @@ extern "C" void NumberIO_HexToStr (unsigned int x, unsigned int n, char *a, unsi Higha = _a_high; while ((n > i) && (j <= Higha)) { - a[j] = '0'; + const_cast<char *>(a)[j] = '0'; j += 1; n -= 1; } @@ -279,18 +279,18 @@ extern "C" void NumberIO_HexToStr (unsigned int x, unsigned int n, char *a, unsi { if (buf.array[i-1] < 10) { - a[j] = ((char) (buf.array[i-1]+ ((unsigned int) ('0')))); + const_cast<char *>(a)[j] = ((char) (buf.array[i-1]+ ((unsigned int) ('0')))); } else { - a[j] = ((char) ((buf.array[i-1]+ ((unsigned int) ('A')))-10)); + const_cast<char *>(a)[j] = ((char) ((buf.array[i-1]+ ((unsigned int) ('A')))-10)); } j += 1; i -= 1; } if (j <= Higha) { - a[j] = ASCII_nul; + const_cast<char *>(a)[j] = ASCII_nul; } } @@ -350,24 +350,24 @@ extern "C" void NumberIO_IntToStr (int x, unsigned int n, char *a, unsigned int Higha = _a_high; while ((n > i) && (j <= Higha)) { - a[j] = ' '; + const_cast<char *>(a)[j] = ' '; j += 1; n -= 1; } if (Negative) { - a[j] = '-'; + const_cast<char *>(a)[j] = '-'; j += 1; } while ((i != 0) && (j <= Higha)) { - a[j] = ((char) (buf.array[i-1]+ ((unsigned int) ('0')))); + const_cast<char *>(a)[j] = ((char) (buf.array[i-1]+ ((unsigned int) ('0')))); j += 1; i -= 1; } if (j <= Higha) { - a[j] = ASCII_nul; + const_cast<char *>(a)[j] = ASCII_nul; } } @@ -491,19 +491,19 @@ extern "C" void NumberIO_OctToStr (unsigned int x, unsigned int n, char *a, unsi Higha = _a_high; while ((n > i) && (j <= Higha)) { - a[j] = ' '; + const_cast<char *>(a)[j] = ' '; j += 1; n -= 1; } while ((i > 0) && (j <= Higha)) { - a[j] = ((char) (buf.array[i-1]+ ((unsigned int) ('0')))); + const_cast<char *>(a)[j] = ((char) (buf.array[i-1]+ ((unsigned int) ('0')))); j += 1; i -= 1; } if (j <= Higha) { - a[j] = ASCII_nul; + const_cast<char *>(a)[j] = ASCII_nul; } } @@ -568,19 +568,19 @@ extern "C" void NumberIO_BinToStr (unsigned int x, unsigned int n, char *a, unsi Higha = _a_high; while ((n > i) && (j <= Higha)) { - a[j] = ' '; + const_cast<char *>(a)[j] = ' '; j += 1; n -= 1; } while ((i > 0) && (j <= Higha)) { - a[j] = ((char) (buf.array[i-1]+ ((unsigned int) ('0')))); + const_cast<char *>(a)[j] = ((char) (buf.array[i-1]+ ((unsigned int) ('0')))); j += 1; i -= 1; } if (j <= Higha) { - a[j] = ASCII_nul; + const_cast<char *>(a)[j] = ASCII_nul; } } diff --git a/gcc/m2/pge-boot/GNumberIO.h b/gcc/m2/pge-boot/GNumberIO.h index 34aee33..3da6f1a 100644 --- a/gcc/m2/pge-boot/GNumberIO.h +++ b/gcc/m2/pge-boot/GNumberIO.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_NumberIO_H) # define _NumberIO_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GOutput.cc b/gcc/m2/pge-boot/GOutput.cc index f6d8500..c4f4705 100644 --- a/gcc/m2/pge-boot/GOutput.cc +++ b/gcc/m2/pge-boot/GOutput.cc @@ -42,9 +42,9 @@ along with GNU Modula-2; see the file COPYING3. If not see # undef NULL # define NULL 0 #endif -#define _Output_H #define _Output_C +#include "GOutput.h" # include "GFIO.h" # include "GSFIO.h" # include "GStrLib.h" diff --git a/gcc/m2/pge-boot/GOutput.h b/gcc/m2/pge-boot/GOutput.h index 79feda8..c95c77d 100644 --- a/gcc/m2/pge-boot/GOutput.h +++ b/gcc/m2/pge-boot/GOutput.h @@ -24,8 +24,6 @@ along with GNU Modula-2; see the file COPYING3. If not see #if !defined (_Output_H) # define _Output_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GPushBackInput.cc b/gcc/m2/pge-boot/GPushBackInput.cc index 6fb0fbe..eed28e2 100644 --- a/gcc/m2/pge-boot/GPushBackInput.cc +++ b/gcc/m2/pge-boot/GPushBackInput.cc @@ -43,9 +43,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # undef NULL # define NULL 0 #endif -#define _PushBackInput_H #define _PushBackInput_C +#include "GPushBackInput.h" # include "GFIO.h" # include "GDynamicStrings.h" # include "GASCII.h" diff --git a/gcc/m2/pge-boot/GPushBackInput.h b/gcc/m2/pge-boot/GPushBackInput.h index 076b996..7b44179 100644 --- a/gcc/m2/pge-boot/GPushBackInput.h +++ b/gcc/m2/pge-boot/GPushBackInput.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_PushBackInput_H) # define _PushBackInput_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GRTExceptions.cc b/gcc/m2/pge-boot/GRTExceptions.cc index 2b6557e..b4ebe6d 100644 --- a/gcc/m2/pge-boot/GRTExceptions.cc +++ b/gcc/m2/pge-boot/GRTExceptions.cc @@ -50,9 +50,9 @@ extern void throw (unsigned int); # undef NULL # define NULL 0 #endif -#define _RTExceptions_H #define _RTExceptions_C +#include "GRTExceptions.h" # include "GASCII.h" # include "GStrLib.h" # include "GStorage.h" @@ -75,17 +75,14 @@ typedef struct RTExceptions__T3_r RTExceptions__T3; typedef RTExceptions__T3 *RTExceptions_Handler; -typedef RTExceptions__T1 *RTExceptions_EHBlock; - -typedef void (*RTExceptions_ProcedureHandler_t) (void); -struct RTExceptions_ProcedureHandler_p { RTExceptions_ProcedureHandler_t proc; }; +typedef RTExceptions__T1 *RTExceptions_EHBlock__opaque; struct RTExceptions__T2_a { char array[MaxBuffer+1]; }; struct RTExceptions__T1_r { RTExceptions__T2 buffer; unsigned int number; RTExceptions_Handler handlers; - RTExceptions_EHBlock right; + RTExceptions_EHBlock__opaque right; }; struct RTExceptions__T3_r { @@ -98,8 +95,8 @@ struct RTExceptions__T3_r { static bool inException; static RTExceptions_Handler freeHandler; -static RTExceptions_EHBlock freeEHB; -static RTExceptions_EHBlock currentEHB; +static RTExceptions_EHBlock__opaque freeEHB; +static RTExceptions_EHBlock__opaque currentEHB; static void * currentSource; /* @@ -236,7 +233,7 @@ static void ErrorString (const char *a_, unsigned int _a_high); findHandler - */ -static RTExceptions_Handler findHandler (RTExceptions_EHBlock e, unsigned int number); +static RTExceptions_Handler findHandler (RTExceptions_EHBlock__opaque e, unsigned int number); /* InvokeHandler - invokes the associated handler for the current @@ -289,7 +286,7 @@ static void addNum (unsigned int n, unsigned int *i); New - returns a new EHBlock. */ -static RTExceptions_EHBlock New (void); +static RTExceptions_EHBlock__opaque New (void); /* NewHandler - returns a new handler. @@ -325,7 +322,7 @@ static void SubHandler (RTExceptions_Handler h); AddHandler - add, e, to the end of the list of handlers. */ -static void AddHandler (RTExceptions_EHBlock e, RTExceptions_Handler h); +static void AddHandler (RTExceptions_EHBlock__opaque e, RTExceptions_Handler h); /* indexf - raise an index out of bounds exception. @@ -442,7 +439,7 @@ static void ErrorString (const char *a_, unsigned int _a_high) /* make a local copy of each unbounded array. */ memcpy (a, a_, _a_high+1); - n = static_cast<int> (libc_write (2, &a, static_cast<size_t> (StrLib_StrLen ((const char *) a, _a_high)))); + n = static_cast<int> (libc_write (2, const_cast<void*> (static_cast<const void*>(a)), static_cast<size_t> (StrLib_StrLen ((const char *) a, _a_high)))); } @@ -450,7 +447,7 @@ static void ErrorString (const char *a_, unsigned int _a_high) findHandler - */ -static RTExceptions_Handler findHandler (RTExceptions_EHBlock e, unsigned int number) +static RTExceptions_Handler findHandler (RTExceptions_EHBlock__opaque e, unsigned int number) { RTExceptions_Handler h; @@ -543,7 +540,7 @@ static void * stripPath (void * s) p += 1; } } - return reinterpret_cast<void *> (f); + return static_cast<void *> (f); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -608,9 +605,9 @@ static void addNum (unsigned int n, unsigned int *i) New - returns a new EHBlock. */ -static RTExceptions_EHBlock New (void) +static RTExceptions_EHBlock__opaque New (void) { - RTExceptions_EHBlock e; + RTExceptions_EHBlock__opaque e; if (freeEHB == NULL) { @@ -710,7 +707,7 @@ static void SubHandler (RTExceptions_Handler h) AddHandler - add, e, to the end of the list of handlers. */ -static void AddHandler (RTExceptions_EHBlock e, RTExceptions_Handler h) +static void AddHandler (RTExceptions_EHBlock__opaque e, RTExceptions_Handler h) { h->right = e->handlers; h->left = e->handlers->left; @@ -725,7 +722,7 @@ static void AddHandler (RTExceptions_EHBlock e, RTExceptions_Handler h) static void indexf (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 614, 9, const_cast<void*> (reinterpret_cast<const void*>("indexf")), const_cast<void*> (reinterpret_cast<const void*>("array index out of bounds"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_indexException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 614, 9, const_cast<void*> (static_cast<const void*>("indexf")), const_cast<void*> (static_cast<const void*>("array index out of bounds"))); } @@ -735,7 +732,7 @@ static void indexf (void * a) static void range (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 626, 9, const_cast<void*> (reinterpret_cast<const void*>("range")), const_cast<void*> (reinterpret_cast<const void*>("assignment out of range"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_rangeException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 626, 9, const_cast<void*> (static_cast<const void*>("range")), const_cast<void*> (static_cast<const void*>("assignment out of range"))); } @@ -745,7 +742,7 @@ static void range (void * a) static void casef (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 638, 9, const_cast<void*> (reinterpret_cast<const void*>("casef")), const_cast<void*> (reinterpret_cast<const void*>("case selector out of range"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_caseSelectException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 638, 9, const_cast<void*> (static_cast<const void*>("casef")), const_cast<void*> (static_cast<const void*>("case selector out of range"))); } @@ -755,7 +752,7 @@ static void casef (void * a) static void invalidloc (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 650, 9, const_cast<void*> (reinterpret_cast<const void*>("invalidloc")), const_cast<void*> (reinterpret_cast<const void*>("invalid address referenced"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_invalidLocation)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 650, 9, const_cast<void*> (static_cast<const void*>("invalidloc")), const_cast<void*> (static_cast<const void*>("invalid address referenced"))); } @@ -765,7 +762,7 @@ static void invalidloc (void * a) static void function (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 662, 9, const_cast<void*> (reinterpret_cast<const void*>("function")), const_cast<void*> (reinterpret_cast<const void*>("... function ... "))); /* --fixme-- what has happened ? */ + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_functionException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 662, 9, const_cast<void*> (static_cast<const void*>("function")), const_cast<void*> (static_cast<const void*>("... function ... "))); /* --fixme-- what has happened ? */ } @@ -775,7 +772,7 @@ static void function (void * a) static void wholevalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 674, 9, const_cast<void*> (reinterpret_cast<const void*>("wholevalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeValueException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 674, 9, const_cast<void*> (static_cast<const void*>("wholevalue")), const_cast<void*> (static_cast<const void*>("illegal whole value exception"))); } @@ -785,7 +782,7 @@ static void wholevalue (void * a) static void wholediv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 686, 9, const_cast<void*> (reinterpret_cast<const void*>("wholediv")), const_cast<void*> (reinterpret_cast<const void*>("illegal whole value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_wholeDivException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 686, 9, const_cast<void*> (static_cast<const void*>("wholediv")), const_cast<void*> (static_cast<const void*>("illegal whole value exception"))); } @@ -795,7 +792,7 @@ static void wholediv (void * a) static void realvalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 698, 9, const_cast<void*> (reinterpret_cast<const void*>("realvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal real value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realValueException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 698, 9, const_cast<void*> (static_cast<const void*>("realvalue")), const_cast<void*> (static_cast<const void*>("illegal real value exception"))); } @@ -805,7 +802,7 @@ static void realvalue (void * a) static void realdiv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 710, 9, const_cast<void*> (reinterpret_cast<const void*>("realdiv")), const_cast<void*> (reinterpret_cast<const void*>("real number division by zero exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_realDivException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 710, 9, const_cast<void*> (static_cast<const void*>("realdiv")), const_cast<void*> (static_cast<const void*>("real number division by zero exception"))); } @@ -815,7 +812,7 @@ static void realdiv (void * a) static void complexvalue (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 722, 9, const_cast<void*> (reinterpret_cast<const void*>("complexvalue")), const_cast<void*> (reinterpret_cast<const void*>("illegal complex value exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexValueException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 722, 9, const_cast<void*> (static_cast<const void*>("complexvalue")), const_cast<void*> (static_cast<const void*>("illegal complex value exception"))); } @@ -825,7 +822,7 @@ static void complexvalue (void * a) static void complexdiv (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 734, 9, const_cast<void*> (reinterpret_cast<const void*>("complexdiv")), const_cast<void*> (reinterpret_cast<const void*>("complex number division by zero exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_complexDivException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 734, 9, const_cast<void*> (static_cast<const void*>("complexdiv")), const_cast<void*> (static_cast<const void*>("complex number division by zero exception"))); } @@ -835,7 +832,7 @@ static void complexdiv (void * a) static void protection (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 746, 9, const_cast<void*> (reinterpret_cast<const void*>("protection")), const_cast<void*> (reinterpret_cast<const void*>("protection exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_protException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 746, 9, const_cast<void*> (static_cast<const void*>("protection")), const_cast<void*> (static_cast<const void*>("protection exception"))); } @@ -845,7 +842,7 @@ static void protection (void * a) static void systemf (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 758, 9, const_cast<void*> (reinterpret_cast<const void*>("systemf")), const_cast<void*> (reinterpret_cast<const void*>("system exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_sysException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 758, 9, const_cast<void*> (static_cast<const void*>("systemf")), const_cast<void*> (static_cast<const void*>("system exception"))); } @@ -855,7 +852,7 @@ static void systemf (void * a) static void coroutine (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 770, 9, const_cast<void*> (reinterpret_cast<const void*>("coroutine")), const_cast<void*> (reinterpret_cast<const void*>("coroutine exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_coException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 770, 9, const_cast<void*> (static_cast<const void*>("coroutine")), const_cast<void*> (static_cast<const void*>("coroutine exception"))); } @@ -865,7 +862,7 @@ static void coroutine (void * a) static void exception (void * a) { - RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (reinterpret_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 782, 9, const_cast<void*> (reinterpret_cast<const void*>("exception")), const_cast<void*> (reinterpret_cast<const void*>("exception exception"))); + RTExceptions_Raise ( ((unsigned int) (M2EXCEPTION_exException)), const_cast<void*> (static_cast<const void*>("../../gcc/m2/gm2-libs/RTExceptions.mod")), 782, 9, const_cast<void*> (static_cast<const void*>("exception")), const_cast<void*> (static_cast<const void*>("exception exception"))); } @@ -877,8 +874,8 @@ static void Init (void) { inException = false; freeHandler = NULL; - freeEHB = NULL; - currentEHB = RTExceptions_InitExceptionBlock (); + freeEHB = static_cast<RTExceptions_EHBlock__opaque> (NULL); + currentEHB = static_cast<RTExceptions_EHBlock__opaque> (RTExceptions_InitExceptionBlock ()); currentSource = NULL; RTExceptions_BaseExceptionsThrow (); SysExceptions_InitExceptionHandlers ((SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) indexf}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) range}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) casef}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) invalidloc}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) function}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) wholevalue}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) wholediv}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) realvalue}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) realdiv}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) complexvalue}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) complexdiv}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) protection}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) systemf}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) coroutine}, (SysExceptions_PROCEXCEPTION) {(SysExceptions_PROCEXCEPTION_t) exception}); @@ -892,11 +889,11 @@ static void Init (void) static void TidyUp (void) { RTExceptions_Handler f; - RTExceptions_EHBlock e; + RTExceptions_EHBlock__opaque e; if (currentEHB != NULL) { - currentEHB = RTExceptions_KillExceptionBlock (currentEHB); + currentEHB = static_cast<RTExceptions_EHBlock__opaque> (RTExceptions_KillExceptionBlock (static_cast<RTExceptions_EHBlock> (currentEHB))); } while (freeHandler != NULL) { @@ -956,7 +953,7 @@ extern "C" void RTExceptions_Raise (unsigned int number, void * file, unsigned i extern "C" void RTExceptions_SetExceptionBlock (RTExceptions_EHBlock source) { - currentEHB = source; + currentEHB = static_cast<RTExceptions_EHBlock__opaque> (source); } @@ -966,7 +963,7 @@ extern "C" void RTExceptions_SetExceptionBlock (RTExceptions_EHBlock source) extern "C" RTExceptions_EHBlock RTExceptions_GetExceptionBlock (void) { - return currentEHB; + return static_cast<RTExceptions_EHBlock> (currentEHB); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -978,7 +975,7 @@ extern "C" RTExceptions_EHBlock RTExceptions_GetExceptionBlock (void) extern "C" void * RTExceptions_GetTextBuffer (RTExceptions_EHBlock e) { - return &e->buffer; + return &static_cast<RTExceptions_EHBlock__opaque> (e)->buffer; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -990,7 +987,7 @@ extern "C" void * RTExceptions_GetTextBuffer (RTExceptions_EHBlock e) extern "C" unsigned int RTExceptions_GetTextBufferSize (RTExceptions_EHBlock e) { - return sizeof (e->buffer); + return sizeof (static_cast<RTExceptions_EHBlock__opaque> (e)->buffer); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -1003,7 +1000,7 @@ extern "C" unsigned int RTExceptions_GetTextBufferSize (RTExceptions_EHBlock e) extern "C" unsigned int RTExceptions_GetNumber (RTExceptions_EHBlock source) { - return source->number; + return static_cast<RTExceptions_EHBlock__opaque> (source)->number; /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -1015,7 +1012,7 @@ extern "C" unsigned int RTExceptions_GetNumber (RTExceptions_EHBlock source) extern "C" RTExceptions_EHBlock RTExceptions_InitExceptionBlock (void) { - RTExceptions_EHBlock e; + RTExceptions_EHBlock__opaque e; e = New (); e->number = UINT_MAX; @@ -1023,7 +1020,7 @@ extern "C" RTExceptions_EHBlock RTExceptions_InitExceptionBlock (void) e->handlers->right = e->handlers; /* add the dummy onto the head */ e->handlers->left = e->handlers; e->right = e; - return e; + return static_cast<RTExceptions_EHBlock> (e); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -1035,10 +1032,10 @@ extern "C" RTExceptions_EHBlock RTExceptions_InitExceptionBlock (void) extern "C" RTExceptions_EHBlock RTExceptions_KillExceptionBlock (RTExceptions_EHBlock e) { - e->handlers = KillHandlers (e->handlers); - e->right = freeEHB; - freeEHB = e; - return NULL; + static_cast<RTExceptions_EHBlock__opaque> (e)->handlers = KillHandlers (static_cast<RTExceptions_EHBlock__opaque> (e)->handlers); + static_cast<RTExceptions_EHBlock__opaque> (e)->right = freeEHB; + freeEHB = static_cast<RTExceptions_EHBlock__opaque> (e); + return static_cast<RTExceptions_EHBlock> (NULL); /* static analysis guarentees a RETURN statement will be used before here. */ __builtin_unreachable (); } @@ -1053,7 +1050,7 @@ extern "C" void RTExceptions_PushHandler (RTExceptions_EHBlock e, unsigned int n RTExceptions_Handler h; RTExceptions_Handler i; - h = findHandler (e, number); + h = findHandler (static_cast<RTExceptions_EHBlock__opaque> (e), number); if (h == NULL) { i = InitHandler (NewHandler (), NULL, NULL, NULL, number, p); @@ -1066,7 +1063,7 @@ extern "C" void RTExceptions_PushHandler (RTExceptions_EHBlock e, unsigned int n i = InitHandler (NewHandler (), NULL, NULL, h, number, p); } /* add new handler */ - AddHandler (e, i); + AddHandler (static_cast<RTExceptions_EHBlock__opaque> (e), i); } @@ -1079,14 +1076,14 @@ extern "C" void RTExceptions_PopHandler (RTExceptions_EHBlock e, unsigned int nu { RTExceptions_Handler h; - h = findHandler (e, number); + h = findHandler (static_cast<RTExceptions_EHBlock__opaque> (e), number); if (h != NULL) { /* remove, h, */ SubHandler (h); if (h->stack != NULL) { - AddHandler (e, h->stack); + AddHandler (static_cast<RTExceptions_EHBlock__opaque> (e), h->stack); } h = KillHandler (h); } @@ -1101,11 +1098,11 @@ extern "C" void RTExceptions_PopHandler (RTExceptions_EHBlock e, unsigned int nu extern "C" void RTExceptions_DefaultErrorCatch (void) { - RTExceptions_EHBlock e; + RTExceptions_EHBlock__opaque e; int n; - e = RTExceptions_GetExceptionBlock (); - n = static_cast<int> (libc_write (2, RTExceptions_GetTextBuffer (e), libc_strlen (RTExceptions_GetTextBuffer (e)))); + e = static_cast<RTExceptions_EHBlock__opaque> (RTExceptions_GetExceptionBlock ()); + n = static_cast<int> (libc_write (2, RTExceptions_GetTextBuffer (static_cast<RTExceptions_EHBlock> (e)), libc_strlen (RTExceptions_GetTextBuffer (static_cast<RTExceptions_EHBlock> (e))))); M2RTS_HALT (-1); __builtin_unreachable (); } @@ -1187,7 +1184,7 @@ extern "C" RTExceptions_EHBlock RTExceptions_GetBaseExceptionBlock (void) } else { - return currentEHB; + return static_cast<RTExceptions_EHBlock> (currentEHB); } ReturnException ("../../gcc/m2/gm2-libs/RTExceptions.def", 25, 1); __builtin_unreachable (); diff --git a/gcc/m2/pge-boot/GRTExceptions.h b/gcc/m2/pge-boot/GRTExceptions.h index 9e188bc..631a4ac 100644 --- a/gcc/m2/pge-boot/GRTExceptions.h +++ b/gcc/m2/pge-boot/GRTExceptions.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_RTExceptions_H) # define _RTExceptions_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GSArgs.h b/gcc/m2/pge-boot/GSArgs.h index a7b10bf..4fe04d7 100644 --- a/gcc/m2/pge-boot/GSArgs.h +++ b/gcc/m2/pge-boot/GSArgs.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_SArgs_H) # define _SArgs_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GSEnvironment.h b/gcc/m2/pge-boot/GSEnvironment.h index ba60723..ccd96b7 100644 --- a/gcc/m2/pge-boot/GSEnvironment.h +++ b/gcc/m2/pge-boot/GSEnvironment.h @@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_SEnvironment_H) # define _SEnvironment_H +#define INCLUDE_MEMORY #include "config.h" #include "system.h" # ifdef __cplusplus diff --git a/gcc/m2/pge-boot/GSFIO.cc b/gcc/m2/pge-boot/GSFIO.cc index 3c0dad0..9d7c603 100644 --- a/gcc/m2/pge-boot/GSFIO.cc +++ b/gcc/m2/pge-boot/GSFIO.cc @@ -37,9 +37,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # undef NULL # define NULL 0 #endif -#define _SFIO_H #define _SFIO_C +#include "GSFIO.h" # include "GASCII.h" # include "GDynamicStrings.h" # include "GFIO.h" diff --git a/gcc/m2/pge-boot/GSFIO.h b/gcc/m2/pge-boot/GSFIO.h index 108d8ea..2926596 100644 --- a/gcc/m2/pge-boot/GSFIO.h +++ b/gcc/m2/pge-boot/GSFIO.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_SFIO_H) # define _SFIO_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GSYSTEM.h b/gcc/m2/pge-boot/GSYSTEM.h index a18a176..79f08c1 100644 --- a/gcc/m2/pge-boot/GSYSTEM.h +++ b/gcc/m2/pge-boot/GSYSTEM.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_SYSTEM_H) # define _SYSTEM_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GScan.h b/gcc/m2/pge-boot/GScan.h index e059cdc..ed3e780 100644 --- a/gcc/m2/pge-boot/GScan.h +++ b/gcc/m2/pge-boot/GScan.h @@ -29,6 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_Scan_H) # define _Scan_H +#define INCLUDE_MEMORY #include "config.h" #include "system.h" # ifdef __cplusplus diff --git a/gcc/m2/pge-boot/GStdIO.cc b/gcc/m2/pge-boot/GStdIO.cc index cf02566..689ed3b 100644 --- a/gcc/m2/pge-boot/GStdIO.cc +++ b/gcc/m2/pge-boot/GStdIO.cc @@ -33,9 +33,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # endif # include "Gmcrts.h" -#define _StdIO_H #define _StdIO_C +#include "GStdIO.h" # include "GIO.h" # include "GM2RTS.h" @@ -48,12 +48,6 @@ typedef struct StdIO__T1_a StdIO__T1; typedef struct StdIO__T2_a StdIO__T2; -typedef void (*StdIO_ProcWrite_t) (char); -struct StdIO_ProcWrite_p { StdIO_ProcWrite_t proc; }; - -typedef void (*StdIO_ProcRead_t) (char *); -struct StdIO_ProcRead_p { StdIO_ProcRead_t proc; }; - struct StdIO__T1_a { StdIO_ProcWrite array[MaxStack+1]; }; struct StdIO__T2_a { StdIO_ProcRead array[MaxStack+1]; }; static StdIO__T1 StackW; diff --git a/gcc/m2/pge-boot/GStdIO.h b/gcc/m2/pge-boot/GStdIO.h index 0a45ebc..c54d009 100644 --- a/gcc/m2/pge-boot/GStdIO.h +++ b/gcc/m2/pge-boot/GStdIO.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_StdIO_H) # define _StdIO_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GStorage.cc b/gcc/m2/pge-boot/GStorage.cc index 08e878c..f22e7f2 100644 --- a/gcc/m2/pge-boot/GStorage.cc +++ b/gcc/m2/pge-boot/GStorage.cc @@ -32,9 +32,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see typedef struct { PROC_t proc; } PROC; # endif -#define _Storage_H #define _Storage_C +#include "GStorage.h" # include "GSysStorage.h" extern "C" void Storage_ALLOCATE (void * *a, unsigned int Size); diff --git a/gcc/m2/pge-boot/GStorage.h b/gcc/m2/pge-boot/GStorage.h index 8c26b46..e07fee0 100644 --- a/gcc/m2/pge-boot/GStorage.h +++ b/gcc/m2/pge-boot/GStorage.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_Storage_H) # define _Storage_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GStrCase.cc b/gcc/m2/pge-boot/GStrCase.cc index 8ea7d3c..d94ebc7 100644 --- a/gcc/m2/pge-boot/GStrCase.cc +++ b/gcc/m2/pge-boot/GStrCase.cc @@ -34,9 +34,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <string.h> #include <limits.h> -#define _StrCase_H #define _StrCase_C +#include "GStrCase.h" # include "GASCII.h" # include "GStrLib.h" @@ -92,12 +92,12 @@ extern "C" void StrCase_StrToUpperCase (const char *a_, unsigned int _a_high, ch i = 0; while (((i < higha) && (a[i] != ASCII_nul)) && (i < highb)) { - b[i] = StrCase_Cap (a[i]); + const_cast<char *>(b)[i] = StrCase_Cap (a[i]); i += 1; } if (i < highb) { - b[i] = ASCII_nul; + const_cast<char *>(b)[i] = ASCII_nul; } } @@ -122,12 +122,12 @@ extern "C" void StrCase_StrToLowerCase (const char *a_, unsigned int _a_high, ch i = 0; while (((i < higha) && (a[i] != ASCII_nul)) && (i < highb)) { - b[i] = StrCase_Lower (a[i]); + const_cast<char *>(b)[i] = StrCase_Lower (a[i]); i += 1; } if (i < highb) { - b[i] = ASCII_nul; + const_cast<char *>(b)[i] = ASCII_nul; } } diff --git a/gcc/m2/pge-boot/GStrCase.h b/gcc/m2/pge-boot/GStrCase.h index c3f0647..a2b1a71 100644 --- a/gcc/m2/pge-boot/GStrCase.h +++ b/gcc/m2/pge-boot/GStrCase.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_StrCase_H) # define _StrCase_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GStrIO.cc b/gcc/m2/pge-boot/GStrIO.cc index 1dd3922..f5c710c 100644 --- a/gcc/m2/pge-boot/GStrIO.cc +++ b/gcc/m2/pge-boot/GStrIO.cc @@ -38,9 +38,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <string.h> #include <limits.h> -#define _StrIO_H #define _StrIO_C +#include "GStrIO.h" # include "GASCII.h" # include "GStdIO.h" # include "Glibc.h" @@ -204,16 +204,16 @@ extern "C" void StrIO_ReadString (char *a, unsigned int _a_high) /* avoid dangling else. */ if ((ch == ASCII_cr) || (ch == ASCII_lf)) { - a[n] = ASCII_nul; + const_cast<char *>(a)[n] = ASCII_nul; n += 1; } else if (ch == ASCII_ff) { /* avoid dangling else. */ - a[0] = ch; + const_cast<char *>(a)[0] = ch; if (high > 0) { - a[1] = ASCII_nul; + const_cast<char *>(a)[1] = ASCII_nul; } ch = ASCII_cr; } @@ -221,18 +221,18 @@ extern "C" void StrIO_ReadString (char *a, unsigned int _a_high) { /* avoid dangling else. */ Echo (ch); - a[n] = ch; + const_cast<char *>(a)[n] = ch; n += 1; } else if (ch == ASCII_eof) { /* avoid dangling else. */ - a[n] = ch; + const_cast<char *>(a)[n] = ch; n += 1; ch = ASCII_cr; if (n <= high) { - a[n] = ASCII_nul; + const_cast<char *>(a)[n] = ASCII_nul; } } } diff --git a/gcc/m2/pge-boot/GStrIO.h b/gcc/m2/pge-boot/GStrIO.h index 2ed2ac3..2d003c5 100644 --- a/gcc/m2/pge-boot/GStrIO.h +++ b/gcc/m2/pge-boot/GStrIO.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_StrIO_H) # define _StrIO_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GStrLib.cc b/gcc/m2/pge-boot/GStrLib.cc index 4a92d1c..f8e3c46 100644 --- a/gcc/m2/pge-boot/GStrLib.cc +++ b/gcc/m2/pge-boot/GStrLib.cc @@ -42,9 +42,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include <string.h> #include <limits.h> -#define _StrLib_H #define _StrLib_C +#include "GStrLib.h" # include "GASCII.h" @@ -127,13 +127,13 @@ extern "C" void StrLib_StrConCat (const char *a_, unsigned int _a_high, const ch j = 0; while ((j < Highb) && (i <= Highc)) { - c[i] = b[j]; + const_cast<char *>(c)[i] = b[j]; i += 1; j += 1; } if (i <= Highc) { - c[i] = ASCII_nul; + const_cast<char *>(c)[i] = ASCII_nul; } } @@ -247,12 +247,12 @@ extern "C" void StrLib_StrCopy (const char *src_, unsigned int _src_high, char * HighDest = _dest_high; while ((n < HighSrc) && (n <= HighDest)) { - dest[n] = src[n]; + const_cast<char *>(dest)[n] = src[n]; n += 1; } if (n <= HighDest) { - dest[n] = ASCII_nul; + const_cast<char *>(dest)[n] = ASCII_nul; } } @@ -328,13 +328,13 @@ extern "C" void StrLib_StrRemoveWhitePrefix (const char *a_, unsigned int _a_hig } while ((i < higha) && (j <= highb)) { - b[j] = a[i]; + const_cast<char *>(b)[j] = a[i]; i += 1; j += 1; } if (j <= highb) { - b[j] = ASCII_nul; + const_cast<char *>(b)[j] = ASCII_nul; } } diff --git a/gcc/m2/pge-boot/GStrLib.h b/gcc/m2/pge-boot/GStrLib.h index b292d89..9e81f00 100644 --- a/gcc/m2/pge-boot/GStrLib.h +++ b/gcc/m2/pge-boot/GStrLib.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_StrLib_H) # define _StrLib_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GStringConvert.h b/gcc/m2/pge-boot/GStringConvert.h index 284eef2..209ec45 100644 --- a/gcc/m2/pge-boot/GStringConvert.h +++ b/gcc/m2/pge-boot/GStringConvert.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_StringConvert_H) # define _StringConvert_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GSymbolKey.cc b/gcc/m2/pge-boot/GSymbolKey.cc index ec27e2c..e581532 100644 --- a/gcc/m2/pge-boot/GSymbolKey.cc +++ b/gcc/m2/pge-boot/GSymbolKey.cc @@ -20,8 +20,6 @@ You should have received a copy of the GNU General Public License along with GNU Modula-2; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ -#include "config.h" -#include "system.h" #include <stdbool.h> # if !defined (PROC_D) # define PROC_D @@ -33,6 +31,7 @@ along with GNU Modula-2; see the file COPYING3. If not see # define FALSE (1==0) # endif +#include <stddef.h> # include "GStorage.h" #if defined(__cplusplus) # undef NULL diff --git a/gcc/m2/pge-boot/GSymbolKey.h b/gcc/m2/pge-boot/GSymbolKey.h index 48be595..2fb363f 100644 --- a/gcc/m2/pge-boot/GSymbolKey.h +++ b/gcc/m2/pge-boot/GSymbolKey.h @@ -24,8 +24,6 @@ along with GNU Modula-2; see the file COPYING3. If not see #if !defined (_SymbolKey_H) # define _SymbolKey_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GSysExceptions.h b/gcc/m2/pge-boot/GSysExceptions.h index 00dd521..2cfc026 100644 --- a/gcc/m2/pge-boot/GSysExceptions.h +++ b/gcc/m2/pge-boot/GSysExceptions.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_SysExceptions_H) # define _SysExceptions_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GSysStorage.cc b/gcc/m2/pge-boot/GSysStorage.cc index 9449a3e..19e11ac 100644 --- a/gcc/m2/pge-boot/GSysStorage.cc +++ b/gcc/m2/pge-boot/GSysStorage.cc @@ -46,9 +46,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # undef NULL # define NULL 0 #endif -#define _SysStorage_H #define _SysStorage_C +#include "GSysStorage.h" # include "Glibc.h" # include "GDebug.h" # include "GSYSTEM.h" @@ -229,7 +229,7 @@ extern "C" void _M2_SysStorage_init (__attribute__((unused)) int argc,__attribut callno = 0; if (enableTrace) { - trace = (libc_getenv (const_cast<void*> (reinterpret_cast<const void*>("M2DEBUG_SYSSTORAGE_trace")))) != NULL; + trace = (libc_getenv (const_cast<void*> (static_cast<const void*>("M2DEBUG_SYSSTORAGE_trace")))) != NULL; } else { @@ -237,7 +237,7 @@ extern "C" void _M2_SysStorage_init (__attribute__((unused)) int argc,__attribut } if (enableZero) { - zero = (libc_getenv (const_cast<void*> (reinterpret_cast<const void*>("M2DEBUG_SYSSTORAGE_zero")))) != NULL; + zero = (libc_getenv (const_cast<void*> (static_cast<const void*>("M2DEBUG_SYSSTORAGE_zero")))) != NULL; } else { diff --git a/gcc/m2/pge-boot/GSysStorage.h b/gcc/m2/pge-boot/GSysStorage.h index 639f681..89d3492 100644 --- a/gcc/m2/pge-boot/GSysStorage.h +++ b/gcc/m2/pge-boot/GSysStorage.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_SysStorage_H) # define _SysStorage_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GTimeString.h b/gcc/m2/pge-boot/GTimeString.h index 7ba51f8..e544d62 100644 --- a/gcc/m2/pge-boot/GTimeString.h +++ b/gcc/m2/pge-boot/GTimeString.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_TimeString_H) # define _TimeString_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/GUnixArgs.h b/gcc/m2/pge-boot/GUnixArgs.h index cf9756e..0907b94 100644 --- a/gcc/m2/pge-boot/GUnixArgs.h +++ b/gcc/m2/pge-boot/GUnixArgs.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_UnixArgs_H) # define _UnixArgs_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/Gbnflex.cc b/gcc/m2/pge-boot/Gbnflex.cc index 3661508..636e4e3 100644 --- a/gcc/m2/pge-boot/Gbnflex.cc +++ b/gcc/m2/pge-boot/Gbnflex.cc @@ -37,9 +37,9 @@ along with GNU Modula-2; see the file COPYING3. If not see #include <string.h> #include <limits.h> -#define _bnflex_H #define _bnflex_C +#include "Gbnflex.h" # include "GPushBackInput.h" # include "GSymbolKey.h" # include "GASCII.h" @@ -51,8 +51,6 @@ along with GNU Modula-2; see the file COPYING3. If not see # include "GStdIO.h" # define MaxNameLength 8192 -typedef enum {bnflex_identtok, bnflex_literaltok, bnflex_codetok, bnflex_lbecomestok, bnflex_rbecomestok, bnflex_bartok, bnflex_lsparatok, bnflex_rsparatok, bnflex_lcparatok, bnflex_rcparatok, bnflex_lparatok, bnflex_rparatok, bnflex_errortok, bnflex_tfunctok, bnflex_symfunctok, bnflex_squotetok, bnflex_dquotetok, bnflex_moduletok, bnflex_begintok, bnflex_rulestok, bnflex_endtok, bnflex_lesstok, bnflex_gretok, bnflex_tokentok, bnflex_specialtok, bnflex_firsttok, bnflex_followtok, bnflex_BNFtok, bnflex_FNBtok, bnflex_declarationtok, bnflex_epsilontok, bnflex_eoftok} bnflex_TokenType; - static FIO_File f; static SymbolKey_SymbolTree ReservedWords; static NameKey_Name CurrentToken; diff --git a/gcc/m2/pge-boot/Gbnflex.h b/gcc/m2/pge-boot/Gbnflex.h index a3da44e..451a73d 100644 --- a/gcc/m2/pge-boot/Gbnflex.h +++ b/gcc/m2/pge-boot/Gbnflex.h @@ -24,8 +24,6 @@ along with GNU Modula-2; see the file COPYING3. If not see #if !defined (_bnflex_H) # define _bnflex_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/Gdtoa.h b/gcc/m2/pge-boot/Gdtoa.h index 946e339..64ab087 100644 --- a/gcc/m2/pge-boot/Gdtoa.h +++ b/gcc/m2/pge-boot/Gdtoa.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_dtoa_H) # define _dtoa_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif @@ -68,7 +66,7 @@ EXTERN double dtoa_strtod (void * s, bool *error); sign does the string have a sign? */ -EXTERN void * dtoa_dtoa (double d, dtoa_Mode mode, int ndigits, int *decpt, bool *sign); +EXTERN void * dtoa_dtoa (double d, int mode, int ndigits, int *decpt, bool *sign); # ifdef __cplusplus } # endif diff --git a/gcc/m2/pge-boot/Gerrno.h b/gcc/m2/pge-boot/Gerrno.h index 7f065cc..5ab2ab1 100644 --- a/gcc/m2/pge-boot/Gerrno.h +++ b/gcc/m2/pge-boot/Gerrno.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_errno_H) # define _errno_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/Gldtoa.h b/gcc/m2/pge-boot/Gldtoa.h index 0678e9e..26152b7 100644 --- a/gcc/m2/pge-boot/Gldtoa.h +++ b/gcc/m2/pge-boot/Gldtoa.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_ldtoa_H) # define _ldtoa_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif @@ -68,7 +66,7 @@ EXTERN long double ldtoa_strtold (void *s, bool *error); sign does the string have a sign? */ -EXTERN void * ldtoa_ldtoa (long double d, ldtoa_Mode mode, int ndigits, int *decpt, bool *sign); +EXTERN void * ldtoa_ldtoa (long double d, int mode, int ndigits, int *decpt, bool *sign); # ifdef __cplusplus } # endif diff --git a/gcc/m2/pge-boot/Glibc.h b/gcc/m2/pge-boot/Glibc.h index 0a5481e..95027e6 100644 --- a/gcc/m2/pge-boot/Glibc.h +++ b/gcc/m2/pge-boot/Glibc.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_libc_H) # define _libc_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif @@ -41,6 +39,8 @@ extern "C" { typedef struct { PROC_t proc; } PROC; # endif +#include <stdlib.h> +# include <sys/types.h> # include "GSYSTEM.h" # if defined (_libc_C) @@ -85,6 +85,17 @@ typedef libc_exitP_t libc_exitP_C; struct libc_exitP_p { libc_exitP_t proc; }; +EXTERN double libc_atof (void * nptr); +EXTERN int libc_atoi (void * nptr); +EXTERN ssize_t libc_atol (void * nptr); +EXTERN long int libc_atoll (void * nptr); +EXTERN double libc_strtod (void * nptr, void * endptr); +EXTERN float libc_strtof (void * nptr, void * endptr); +EXTERN long double libc_strtold (void * nptr, void * endptr); +EXTERN ssize_t libc_strtol (void * nptr, void * endptr, int base); +EXTERN long int libc_strtoll (void * nptr, void * endptr, int base); +EXTERN size_t libc_strtoul (void * nptr, void * endptr, int base); +EXTERN long unsigned int libc_strtoull (void * nptr, void * endptr, int base); EXTERN ssize_t libc_write (int d, void * buf, size_t nbytes); EXTERN ssize_t libc_read (int d, void * buf, size_t nbytes); EXTERN int libc_system (void * a); @@ -198,7 +209,7 @@ EXTERN ssize_t libc_lseek (int fd, ssize_t offset, int whence); perror - writes errno and string. (ARRAY OF CHAR is translated onto ADDRESS). */ -EXTERN void libc_perror (const char *str); +EXTERN void libc_perror (const char *string_, unsigned int _string_high); /* readv - reads an io vector of bytes. diff --git a/gcc/m2/pge-boot/Glibm.h b/gcc/m2/pge-boot/Glibm.h index d3c9415..899d7dd 100644 --- a/gcc/m2/pge-boot/Glibm.h +++ b/gcc/m2/pge-boot/Glibm.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_libm_H) # define _libm_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/Gpge.cc b/gcc/m2/pge-boot/Gpge.cc index e231abee..383a8f8 100644 --- a/gcc/m2/pge-boot/Gpge.cc +++ b/gcc/m2/pge-boot/Gpge.cc @@ -3621,7 +3621,7 @@ static void Format1 (const char *src_, unsigned int _src_high, unsigned int n, c j = 0; while ((((i < HighSrc) && (src[i] != ASCII_nul)) && (j < HighDest)) && (src[i] != '%')) { - dest[j] = src[i]; + const_cast<char *>(dest)[j] = src[i]; i += 1; j += 1; } @@ -3630,7 +3630,7 @@ static void Format1 (const char *src_, unsigned int _src_high, unsigned int n, c /* avoid gcc warning by using compound statement even if not strictly necessary. */ if (src[i+1] == 's') { - dest[j] = ASCII_nul; + const_cast<char *>(dest)[j] = ASCII_nul; NameKey_GetKey (n, (char *) &str.array[0], MaxString); StrLib_StrConCat ((const char *) dest, _dest_high, (const char *) &str.array[0], MaxString, (char *) dest, _dest_high); j = StrLib_StrLen ((const char *) dest, _dest_high); @@ -3639,7 +3639,7 @@ static void Format1 (const char *src_, unsigned int _src_high, unsigned int n, c else if (src[i+1] == 'd') { /* avoid dangling else. */ - dest[j] = ASCII_nul; + const_cast<char *>(dest)[j] = ASCII_nul; NumberIO_CardToStr (n, 0, (char *) &str.array[0], MaxString); StrLib_StrConCat ((const char *) dest, _dest_high, (const char *) &str.array[0], MaxString, (char *) dest, _dest_high); j = StrLib_StrLen ((const char *) dest, _dest_high); @@ -3648,7 +3648,7 @@ static void Format1 (const char *src_, unsigned int _src_high, unsigned int n, c else { /* avoid dangling else. */ - dest[j] = src[i]; + const_cast<char *>(dest)[j] = src[i]; i += 1; j += 1; } @@ -3656,13 +3656,13 @@ static void Format1 (const char *src_, unsigned int _src_high, unsigned int n, c /* and finish off copying src into dest */ while (((i < HighSrc) && (src[i] != ASCII_nul)) && (j < HighDest)) { - dest[j] = src[i]; + const_cast<char *>(dest)[j] = src[i]; i += 1; j += 1; } if (j < HighDest) { - dest[j] = ASCII_nul; + const_cast<char *>(dest)[j] = ASCII_nul; } } @@ -7490,9 +7490,9 @@ static bool FindStr (pge_CodeHunk *code, unsigned int *i, const char *str_, unsi /* make a local copy of each unbounded array. */ memcpy (str, str_, _str_high+1); - j = StrLib_StrLen ((const char *) str, _str_high); t = (*code); k = (StrLib_StrLen ((const char *) &(*code)->codetext.array[0], MaxCodeHunkLength))+1; + j = StrLib_StrLen ((const char *) str, _str_high); while (t != NULL) { do { @@ -7804,7 +7804,7 @@ static void OrSet (pge_SetDesc *to, pge_SetDesc from) default: - Debug_Halt ((const char *) "unknown element in enumeration type", 35, (const char *) "m2/gm2-auto/pge.mod", 19, (const char *) "OrSet", 5, 4133); + Debug_Halt ((const char *) "unknown element in enumeration type", 35, (const char *) "m2/gm2-auto/pge.mod", 19, (const char *) "OrSet", 5, 4134); break; } from = from->next; diff --git a/gcc/m2/pge-boot/Gtermios.h b/gcc/m2/pge-boot/Gtermios.h index acb7fcf..fe510d5 100644 --- a/gcc/m2/pge-boot/Gtermios.h +++ b/gcc/m2/pge-boot/Gtermios.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_termios_H) # define _termios_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/m2/pge-boot/Gwrapc.h b/gcc/m2/pge-boot/Gwrapc.h index e4db1e2..b28f3ca 100644 --- a/gcc/m2/pge-boot/Gwrapc.h +++ b/gcc/m2/pge-boot/Gwrapc.h @@ -29,8 +29,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #if !defined (_wrapc_H) # define _wrapc_H -#include "config.h" -#include "system.h" # ifdef __cplusplus extern "C" { # endif diff --git a/gcc/multiple_target.cc b/gcc/multiple_target.cc index 1fdd279..d2c9671 100644 --- a/gcc/multiple_target.cc +++ b/gcc/multiple_target.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/objc/objc-act.cc b/gcc/objc/objc-act.cc index cec64c4..58d465f 100644 --- a/gcc/objc/objc-act.cc +++ b/gcc/objc/objc-act.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/objc/objc-encoding.cc b/gcc/objc/objc-encoding.cc index 7cb0e5a..d0078eb 100644 --- a/gcc/objc/objc-encoding.cc +++ b/gcc/objc/objc-encoding.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/objc/objc-gnu-runtime-abi-01.cc b/gcc/objc/objc-gnu-runtime-abi-01.cc index 2eca5f4..1f504f4 100644 --- a/gcc/objc/objc-gnu-runtime-abi-01.cc +++ b/gcc/objc/objc-gnu-runtime-abi-01.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/objc/objc-lang.cc b/gcc/objc/objc-lang.cc index b0b3e13..430b6b2 100644 --- a/gcc/objc/objc-lang.cc +++ b/gcc/objc/objc-lang.cc @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ - +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/objc/objc-next-runtime-abi-01.cc b/gcc/objc/objc-next-runtime-abi-01.cc index 32a8d69..60cd763 100644 --- a/gcc/objc/objc-next-runtime-abi-01.cc +++ b/gcc/objc/objc-next-runtime-abi-01.cc @@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see of additions made for properties and optional protocol methods as ABI=1 (module version 7). */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/objc/objc-next-runtime-abi-02.cc b/gcc/objc/objc-next-runtime-abi-02.cc index 248ef64..a9614e6 100644 --- a/gcc/objc/objc-next-runtime-abi-02.cc +++ b/gcc/objc/objc-next-runtime-abi-02.cc @@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see This version is intended to match (logically) the output of Apple's 4.2.1 compiler. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/objc/objc-runtime-shared-support.cc b/gcc/objc/objc-runtime-shared-support.cc index 21a8822..bd40195 100644 --- a/gcc/objc/objc-runtime-shared-support.cc +++ b/gcc/objc/objc-runtime-shared-support.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/objcp/objcp-decl.cc b/gcc/objcp/objcp-decl.cc index 1c8912f..9d100c9 100644 --- a/gcc/objcp/objcp-decl.cc +++ b/gcc/objcp/objcp-decl.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/objcp/objcp-lang.cc b/gcc/objcp/objcp-lang.cc index 83447f8..3b54050 100644 --- a/gcc/objcp/objcp-lang.cc +++ b/gcc/objcp/objcp-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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/omp-expand.cc b/gcc/omp-expand.cc index 9ff9553..0c3f986 100644 --- a/gcc/omp-expand.cc +++ b/gcc/omp-expand.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/omp-general.cc b/gcc/omp-general.cc index f4c5f57..f74b9bf 100644 --- a/gcc/omp-general.cc +++ b/gcc/omp-general.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/omp-low.cc b/gcc/omp-low.cc index da2051b..6f7b740 100644 --- a/gcc/omp-low.cc +++ b/gcc/omp-low.cc @@ -22,6 +22,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/omp-oacc-neuter-broadcast.cc b/gcc/omp-oacc-neuter-broadcast.cc index 64a596c..651284b 100644 --- a/gcc/omp-oacc-neuter-broadcast.cc +++ b/gcc/omp-oacc-neuter-broadcast.cc @@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/omp-offload.cc b/gcc/omp-offload.cc index 934fbd8..5c98536 100644 --- a/gcc/omp-offload.cc +++ b/gcc/omp-offload.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/omp-simd-clone.cc b/gcc/omp-simd-clone.cc index 8645862..14a37f7 100644 --- a/gcc/omp-simd-clone.cc +++ b/gcc/omp-simd-clone.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index 0eccb19..551cc5c 100644 --- a/gcc/optc-gen.awk +++ b/gcc/optc-gen.awk @@ -158,6 +158,7 @@ for (i = 0; i < n_opts; i++) { print "/* This file is auto-generated by optc-gen.awk. */" print "" +print "#define INCLUDE_MEMORY" n_headers = split(header_name, headers, " ") for (i = 1; i <= n_headers; i++) print "#include " quote headers[i] quote diff --git a/gcc/optc-save-gen.awk b/gcc/optc-save-gen.awk index b1289c2..6fa10c5 100644 --- a/gcc/optc-save-gen.awk +++ b/gcc/optc-save-gen.awk @@ -31,6 +31,7 @@ END { print "/* This file is auto-generated by optc-save-gen.awk. */" print "" +print "#define INCLUDE_MEMORY" n_headers = split(header_name, headers, " ") for (i = 1; i <= n_headers; i++) print "#include " quote headers[i] quote diff --git a/gcc/options-urls-cc-gen.awk b/gcc/options-urls-cc-gen.awk index a293323..33715a6 100644 --- a/gcc/options-urls-cc-gen.awk +++ b/gcc/options-urls-cc-gen.awk @@ -29,6 +29,7 @@ END { print "/* This file is auto-generated by options-urls-cc-gen.awk. */" print "" +print "#define INCLUDE_MEMORY" n_headers = split(header_name, headers, " ") for (i = 1; i <= n_headers; i++) print "#include " quote headers[i] quote diff --git a/gcc/opts-common.cc b/gcc/opts-common.cc index 70ac225..ac0e2bd 100644 --- a/gcc/opts-common.cc +++ b/gcc/opts-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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #define INCLUDE_STRING #include "config.h" #include "system.h" diff --git a/gcc/opts-global.cc b/gcc/opts-global.cc index a9bc0d5..893d299 100644 --- a/gcc/opts-global.cc +++ b/gcc/opts-global.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/opts.cc b/gcc/opts.cc index acd53be..1c5092e 100644 --- a/gcc/opts.cc +++ b/gcc/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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "intl.h" diff --git a/gcc/pair-fusion.cc b/gcc/pair-fusion.cc index ccbb551..ff84c16 100644 --- a/gcc/pair-fusion.cc +++ b/gcc/pair-fusion.cc @@ -20,6 +20,7 @@ #define INCLUDE_ALGORITHM #define INCLUDE_FUNCTIONAL #define INCLUDE_LIST +#define INCLUDE_MEMORY #define INCLUDE_TYPE_TRAITS #define INCLUDE_ARRAY #include "config.h" diff --git a/gcc/passes.cc b/gcc/passes.cc index ae80f40..d1e6fe3 100644 --- a/gcc/passes.cc +++ b/gcc/passes.cc @@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see in the proper order, and counts the time used by each. Error messages and low-level interface to malloc also handled here. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/pointer-query.cc b/gcc/pointer-query.cc index a85c041..fea69c8 100644 --- a/gcc/pointer-query.cc +++ b/gcc/pointer-query.cc @@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/predict.cc b/gcc/predict.cc index 87b3459..f30e67d 100644 --- a/gcc/predict.cc +++ b/gcc/predict.cc @@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see [3] "Corpus-based Static Branch Prediction" Calder, Grunwald, Lindsay, Martin, Mozer, and Zorn; PLDI '95. */ - +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/pretty-print.cc b/gcc/pretty-print.cc index 8082dbc..f18214d 100644 --- a/gcc/pretty-print.cc +++ b/gcc/pretty-print.cc @@ -2519,10 +2519,10 @@ pretty_printer::~pretty_printer () /* Base class implementation of pretty_printer::clone vfunc. */ -pretty_printer * +std::unique_ptr<pretty_printer> pretty_printer::clone () const { - return new pretty_printer (*this); + return ::make_unique<pretty_printer> (*this); } /* Append a string delimited by START and END to the output area of diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h index 05dbb19..561ebfb 100644 --- a/gcc/pretty-print.h +++ b/gcc/pretty-print.h @@ -21,6 +21,14 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_PRETTY_PRINT_H #define GCC_PRETTY_PRINT_H +/* This header uses std::unique_ptr, but <memory> 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 pretty-print.h" +#endif + #include "obstack.h" #include "rich-location.h" #include "diagnostic-url.h" @@ -269,7 +277,7 @@ public: virtual ~pretty_printer (); - virtual pretty_printer *clone () const; + virtual std::unique_ptr<pretty_printer> clone () const; void set_output_stream (FILE *outfile) { diff --git a/gcc/print-rtl.cc b/gcc/print-rtl.cc index 69c2e19..1688d4e 100644 --- a/gcc/print-rtl.cc +++ b/gcc/print-rtl.cc @@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #endif +#define INCLUDE_MEMORY #include "system.h" #include "coretypes.h" #include "tm.h" diff --git a/gcc/print-tree.cc b/gcc/print-tree.cc index 0dda09a..d313a2a 100644 --- a/gcc/print-tree.cc +++ b/gcc/print-tree.cc @@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/profile-count.cc b/gcc/profile-count.cc index b26f38e..0f30fa2 100644 --- a/gcc/profile-count.cc +++ b/gcc/profile-count.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 2754dd8..a42bca0 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/range-op-ptr.cc b/gcc/range-op-ptr.cc index ef2b2cc..9f500c5 100644 --- a/gcc/range-op-ptr.cc +++ b/gcc/range-op-ptr.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 3f5cf08..937bee2 100644 --- a/gcc/range-op.cc +++ b/gcc/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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/range.cc b/gcc/range.cc index 5ee0edc..3b56556 100644 --- a/gcc/range.cc +++ b/gcc/range.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/read-rtl-function.cc b/gcc/read-rtl-function.cc index fa1aeb5..51dc119 100644 --- a/gcc/read-rtl-function.cc +++ b/gcc/read-rtl-function.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/rtl-error.cc b/gcc/rtl-error.cc index 6d05f0b..0a92a1a 100644 --- a/gcc/rtl-error.cc +++ b/gcc/rtl-error.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/rtl-ssa/accesses.cc b/gcc/rtl-ssa/accesses.cc index ef99759..9fa7fee 100644 --- a/gcc/rtl-ssa/accesses.cc +++ b/gcc/rtl-ssa/accesses.cc @@ -19,6 +19,7 @@ #define INCLUDE_ALGORITHM #define INCLUDE_FUNCTIONAL +#define INCLUDE_MEMORY #define INCLUDE_ARRAY #include "config.h" #include "system.h" diff --git a/gcc/rtl-ssa/blocks.cc b/gcc/rtl-ssa/blocks.cc index dfc4e7d..780a241 100644 --- a/gcc/rtl-ssa/blocks.cc +++ b/gcc/rtl-ssa/blocks.cc @@ -19,6 +19,7 @@ #define INCLUDE_ALGORITHM #define INCLUDE_FUNCTIONAL +#define INCLUDE_MEMORY #define INCLUDE_ARRAY #include "config.h" #include "system.h" diff --git a/gcc/rtl-ssa/changes.cc b/gcc/rtl-ssa/changes.cc index 0476296..f2be119 100644 --- a/gcc/rtl-ssa/changes.cc +++ b/gcc/rtl-ssa/changes.cc @@ -19,6 +19,7 @@ #define INCLUDE_ALGORITHM #define INCLUDE_FUNCTIONAL +#define INCLUDE_MEMORY #define INCLUDE_ARRAY #include "config.h" #include "system.h" diff --git a/gcc/rtl-ssa/functions.cc b/gcc/rtl-ssa/functions.cc index bffccc5..b14fb07 100644 --- a/gcc/rtl-ssa/functions.cc +++ b/gcc/rtl-ssa/functions.cc @@ -19,6 +19,7 @@ #define INCLUDE_ALGORITHM #define INCLUDE_FUNCTIONAL +#define INCLUDE_MEMORY #define INCLUDE_ARRAY #include "config.h" #include "system.h" diff --git a/gcc/rtl-ssa/insns.cc b/gcc/rtl-ssa/insns.cc index d0c3e56..bfc6683 100644 --- a/gcc/rtl-ssa/insns.cc +++ b/gcc/rtl-ssa/insns.cc @@ -19,6 +19,7 @@ #define INCLUDE_ALGORITHM #define INCLUDE_FUNCTIONAL +#define INCLUDE_MEMORY #define INCLUDE_ARRAY #include "config.h" #include "system.h" diff --git a/gcc/rtl-ssa/movement.cc b/gcc/rtl-ssa/movement.cc index 3843211..c34c70d 100644 --- a/gcc/rtl-ssa/movement.cc +++ b/gcc/rtl-ssa/movement.cc @@ -19,6 +19,7 @@ #define INCLUDE_ALGORITHM #define INCLUDE_FUNCTIONAL +#define INCLUDE_MEMORY #define INCLUDE_ARRAY #include "config.h" #include "system.h" diff --git a/gcc/rtl-tests.cc b/gcc/rtl-tests.cc index 4569770..ef717cc 100644 --- a/gcc/rtl-tests.cc +++ b/gcc/rtl-tests.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.cc b/gcc/rust/resolve/rust-ast-resolve-expr.cc index 5520dc2..74f11dd 100644 --- a/gcc/rust/resolve/rust-ast-resolve-expr.cc +++ b/gcc/rust/resolve/rust-ast-resolve-expr.cc @@ -16,6 +16,7 @@ // along with GCC; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +#define INCLUDE_MEMORY #include "rust-ast-resolve-expr.h" #include "rust-ast-resolve-stmt.h" #include "rust-ast-resolve-struct-expr-field.h" diff --git a/gcc/rust/rust-attribs.cc b/gcc/rust/rust-attribs.cc index 86d5b3d..ddcef72 100644 --- a/gcc/rust/rust-attribs.cc +++ b/gcc/rust/rust-attribs.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/rust/rust-system.h b/gcc/rust/rust-system.h index 2382e5b..1833b93 100644 --- a/gcc/rust/rust-system.h +++ b/gcc/rust/rust-system.h @@ -21,6 +21,7 @@ #define RUST_SYSTEM_H #define INCLUDE_ALGORITHM +#define INCLUDE_MEMORY #include "config.h" /* Define this so that inttypes.h defines the PRI?64 macros even diff --git a/gcc/sanopt.cc b/gcc/sanopt.cc index 604db6b..0d79a02 100644 --- a/gcc/sanopt.cc +++ b/gcc/sanopt.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/sched-rgn.cc b/gcc/sched-rgn.cc index 3d8cff7..4f511b3 100644 --- a/gcc/sched-rgn.cc +++ b/gcc/sched-rgn.cc @@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. If not see priorities are computed, and (3) block level: insns in the block are actually scheduled. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/selftest-diagnostic-path.cc b/gcc/selftest-diagnostic-path.cc index 6d21f2e..1b0ba2c 100644 --- a/gcc/selftest-diagnostic-path.cc +++ b/gcc/selftest-diagnostic-path.cc @@ -20,6 +20,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/selftest-diagnostic.cc b/gcc/selftest-diagnostic.cc index 4e9ee92..a066fe2 100644 --- a/gcc/selftest-diagnostic.cc +++ b/gcc/selftest-diagnostic.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/splay-tree-utils.cc b/gcc/splay-tree-utils.cc index 6437a5a..eb99b6b 100644 --- a/gcc/splay-tree-utils.cc +++ b/gcc/splay-tree-utils.cc @@ -19,6 +19,7 @@ #define INCLUDE_ALGORITHM #define INCLUDE_ARRAY +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/sreal.cc b/gcc/sreal.cc index be557e7..b9f0497 100644 --- a/gcc/sreal.cc +++ b/gcc/sreal.cc @@ -47,6 +47,7 @@ along with GCC; see the file COPYING3. If not see sig == 0 && exp == -SREAL_MAX_EXP */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include <math.h> diff --git a/gcc/stmt.cc b/gcc/stmt.cc index ae1527f..d272a45 100644 --- a/gcc/stmt.cc +++ b/gcc/stmt.cc @@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see The functions whose names start with `expand_' are called by the expander to generate RTL instructions for various kinds of constructs. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/substring-locations.cc b/gcc/substring-locations.cc index 156c121..96224d3 100644 --- a/gcc/substring-locations.cc +++ b/gcc/substring-locations.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/symtab-clones.cc b/gcc/symtab-clones.cc index d50a95e..79c9312 100644 --- a/gcc/symtab-clones.cc +++ b/gcc/symtab-clones.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/symtab-thunks.cc b/gcc/symtab-thunks.cc index c7ca06f..f754a8a 100644 --- a/gcc/symtab-thunks.cc +++ b/gcc/symtab-thunks.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/symtab.cc b/gcc/symtab.cc index 3b018ab..5e19062 100644 --- a/gcc/symtab.cc +++ b/gcc/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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.c b/gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.c index 2f78033..7e6d7e1 100644 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.c +++ b/gcc/testsuite/gcc.dg/plugin/diagnostic_group_plugin.c @@ -29,6 +29,7 @@ #include "diagnostic.h" #include "diagnostic-format-text.h" #include "context.h" +#include "make-unique.h" int plugin_is_GPL_compatible; @@ -229,7 +230,7 @@ plugin_init (struct plugin_name_args *plugin_info, diagnostic_text_starter (global_dc) = test_diagnostic_text_starter; diagnostic_start_span (global_dc) = test_diagnostic_start_span_fn; - global_dc->set_output_format (new test_output_format (*global_dc)); + global_dc->set_output_format (::make_unique<test_output_format> (*global_dc)); pass_info.pass = new pass_test_groups (g); pass_info.reference_pass_name = "*warn_function_noreturn"; diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_xhtml_format.c b/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_xhtml_format.c index eb29476..2f95e4a 100644 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_xhtml_format.c +++ b/gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_xhtml_format.c @@ -689,9 +689,10 @@ public: diagnostic_output_format::dump (out, indent); } - diagnostic_per_format_buffer *make_per_format_buffer () final override + std::unique_ptr<diagnostic_per_format_buffer> + make_per_format_buffer () final override { - return new diagnostic_xhtml_format_buffer (m_builder); + return ::make_unique<diagnostic_xhtml_format_buffer> (m_builder); } void set_buffer (diagnostic_per_format_buffer *base_buffer) final override { @@ -810,7 +811,7 @@ diagnostic_output_format_init_xhtml (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 XHTML output to stderr. */ @@ -949,9 +950,10 @@ plugin_init (struct plugin_name_args *plugin_info, if (!plugin_default_version_check (version, &gcc_version)) return 1; - global_dc->set_output_format (new xhtml_stream_output_format (*global_dc, - line_table, - stderr)); + global_dc->set_output_format + (::make_unique<xhtml_stream_output_format> (*global_dc, + line_table, + stderr)); #if CHECKING_P selftest::xhtml_format_selftests (); diff --git a/gcc/testsuite/gcc.dg/plugin/ggcplug.c b/gcc/testsuite/gcc.dg/plugin/ggcplug.c index a75eed0..d819903 100644 --- a/gcc/testsuite/gcc.dg/plugin/ggcplug.c +++ b/gcc/testsuite/gcc.dg/plugin/ggcplug.c @@ -1,6 +1,7 @@ /* This plugin tests the GGC related plugin events. */ /* { dg-options "-O" } */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/text-art/box-drawing.cc b/gcc/text-art/box-drawing.cc index 7057a4e..e609273 100644 --- a/gcc/text-art/box-drawing.cc +++ b/gcc/text-art/box-drawing.cc @@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #include "config.h" +#define INCLUDE_MEMORY #define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" diff --git a/gcc/text-art/canvas.cc b/gcc/text-art/canvas.cc index 8e5d968..b2315d9 100644 --- a/gcc/text-art/canvas.cc +++ b/gcc/text-art/canvas.cc @@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #include "config.h" +#define INCLUDE_MEMORY #define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" diff --git a/gcc/text-art/ruler.cc b/gcc/text-art/ruler.cc index f80d9bb..2abc36f 100644 --- a/gcc/text-art/ruler.cc +++ b/gcc/text-art/ruler.cc @@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #define INCLUDE_ALGORITHM +#define INCLUDE_MEMORY #define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" diff --git a/gcc/text-art/selftests.cc b/gcc/text-art/selftests.cc index 2b113b6..3c72c94 100644 --- a/gcc/text-art/selftests.cc +++ b/gcc/text-art/selftests.cc @@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #include "config.h" +#define INCLUDE_MEMORY #define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" diff --git a/gcc/text-art/theme.cc b/gcc/text-art/theme.cc index e51b8ef..580c931 100644 --- a/gcc/text-art/theme.cc +++ b/gcc/text-art/theme.cc @@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #include "config.h" +#define INCLUDE_MEMORY #define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" diff --git a/gcc/toplev.cc b/gcc/toplev.cc index 62034c3..a12a2e1 100644 --- a/gcc/toplev.cc +++ b/gcc/toplev.cc @@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see #include "cgraph.h" #include "coverage.h" #include "diagnostic.h" +#include "pretty-print-urlifier.h" #include "varasm.h" #include "tree-inline.h" #include "realmpfr.h" /* For GMP/MPFR/MPC versions, in print_version. */ @@ -94,6 +95,7 @@ along with GCC; see the file COPYING3. If not see #include "dbgcnt.h" #include "gcc-urlifier.h" #include "unique-argv.h" +#include "make-unique.h" #include "selftest.h" @@ -1094,9 +1096,9 @@ general_init (const char *argv0, bool init_signals, unique_argv original_argv) global_dc->m_internal_error = internal_error_function; const unsigned lang_mask = lang_hooks.option_lang_mask (); global_dc->set_option_manager - (new compiler_diagnostic_option_manager (*global_dc, - lang_mask, - &global_options), + (::make_unique<compiler_diagnostic_option_manager> (*global_dc, + lang_mask, + &global_options), lang_mask); global_dc->set_urlifier (make_gcc_urlifier (lang_mask)); diff --git a/gcc/trans-mem.cc b/gcc/trans-mem.cc index fb0c95a..3cf0bf3 100644 --- a/gcc/trans-mem.cc +++ b/gcc/trans-mem.cc @@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-affine.cc b/gcc/tree-affine.cc index 76117aa..1373664 100644 --- a/gcc/tree-affine.cc +++ b/gcc/tree-affine.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-call-cdce.cc b/gcc/tree-call-cdce.cc index befe6ac..077d6fd 100644 --- a/gcc/tree-call-cdce.cc +++ b/gcc/tree-call-cdce.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc index fcb488d..a850146 100644 --- a/gcc/tree-cfg.cc +++ b/gcc/tree-cfg.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-chrec.cc b/gcc/tree-chrec.cc index 9b27207..0c9776f 100644 --- a/gcc/tree-chrec.cc +++ b/gcc/tree-chrec.cc @@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see variables. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-dfa.cc b/gcc/tree-dfa.cc index 77e119a..9671946 100644 --- a/gcc/tree-dfa.cc +++ b/gcc/tree-dfa.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-diagnostic-client-data-hooks.cc b/gcc/tree-diagnostic-client-data-hooks.cc index a2e4a5c..d966cf5 100644 --- a/gcc/tree-diagnostic-client-data-hooks.cc +++ b/gcc/tree-diagnostic-client-data-hooks.cc @@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see #include "langhooks.h" #include "plugin.h" #include "timevar.h" +#include "make-unique.h" /* Concrete class for supplying a diagnostic_context with information about a specific plugin within the client, when the client is the @@ -166,8 +167,8 @@ private: /* Create a compiler_data_hooks (so that the class can be local to this file). */ -diagnostic_client_data_hooks * +std::unique_ptr<diagnostic_client_data_hooks> make_compiler_data_hooks () { - return new compiler_data_hooks (); + return ::make_unique<compiler_data_hooks> (); } diff --git a/gcc/tree-diagnostic.cc b/gcc/tree-diagnostic.cc index 3947102..b7d2c51 100644 --- a/gcc/tree-diagnostic.cc +++ b/gcc/tree-diagnostic.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-dump.cc b/gcc/tree-dump.cc index ba3cf1a..4690878 100644 --- a/gcc/tree-dump.cc +++ b/gcc/tree-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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc index 037fd1e..e869b07 100644 --- a/gcc/tree-inline.cc +++ b/gcc/tree-inline.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-into-ssa.cc b/gcc/tree-into-ssa.cc index fc61d47..78d5b92 100644 --- a/gcc/tree-into-ssa.cc +++ b/gcc/tree-into-ssa.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-logical-location.cc b/gcc/tree-logical-location.cc index ca8b34a..5967e13 100644 --- a/gcc/tree-logical-location.cc +++ b/gcc/tree-logical-location.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-nested.cc b/gcc/tree-nested.cc index fc0495d..a54e72c 100644 --- a/gcc/tree-nested.cc +++ b/gcc/tree-nested.cc @@ -17,6 +17,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-nrv.cc b/gcc/tree-nrv.cc index 0a8f359..aa01b96 100644 --- a/gcc/tree-nrv.cc +++ b/gcc/tree-nrv.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-object-size.cc b/gcc/tree-object-size.cc index 0e4bf84..09aad88 100644 --- a/gcc/tree-object-size.cc +++ b/gcc/tree-object-size.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-outof-ssa.cc b/gcc/tree-outof-ssa.cc index 6d9c125..1d9a4a3 100644 --- a/gcc/tree-outof-ssa.cc +++ b/gcc/tree-outof-ssa.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-pretty-print.cc b/gcc/tree-pretty-print.cc index cf36b37..e8dc82c 100644 --- a/gcc/tree-pretty-print.cc +++ b/gcc/tree-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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-profile.cc b/gcc/tree-profile.cc index 153c932..91a1492 100644 --- a/gcc/tree-profile.cc +++ b/gcc/tree-profile.cc @@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see /* Generate basic block profile instrumentation and auxiliary files. Tree-based version. See profile.cc for overview. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-scalar-evolution.cc b/gcc/tree-scalar-evolution.cc index abb2bad..357e210 100644 --- a/gcc/tree-scalar-evolution.cc +++ b/gcc/tree-scalar-evolution.cc @@ -253,6 +253,7 @@ along with GCC; see the file COPYING3. If not see at: http://cri.ensmp.fr/~pop/gcc/20040604/gccsummit-lno-spop.pdf */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-sra.cc b/gcc/tree-sra.cc index c0915dc..1ad4c45 100644 --- a/gcc/tree-sra.cc +++ b/gcc/tree-sra.cc @@ -71,6 +71,7 @@ along with GCC; see the file COPYING3. If not see Finally, if a parameter got scalarized, the scalar replacements are initialized with values from respective parameter aggregates. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-address.cc b/gcc/tree-ssa-address.cc index c4dfa37..61f54ec 100644 --- a/gcc/tree-ssa-address.cc +++ b/gcc/tree-ssa-address.cc @@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see /* Utility functions for manipulation with TARGET_MEM_REFs -- tree expressions that directly map to addressing modes of the target. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-alias.cc b/gcc/tree-ssa-alias.cc index fab048b..2cdb5c9 100644 --- a/gcc/tree-ssa-alias.cc +++ b/gcc/tree-ssa-alias.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-ccp.cc b/gcc/tree-ssa-ccp.cc index db12872..5852fdc 100644 --- a/gcc/tree-ssa-ccp.cc +++ b/gcc/tree-ssa-ccp.cc @@ -118,6 +118,7 @@ along with GCC; see the file COPYING3. If not see Advanced Compiler Design and Implementation, Steven Muchnick, Morgan Kaufmann, 1997, Section 12.6 */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-coalesce.cc b/gcc/tree-ssa-coalesce.cc index 8d8727d..8c9aafb 100644 --- a/gcc/tree-ssa-coalesce.cc +++ b/gcc/tree-ssa-coalesce.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-copy.cc b/gcc/tree-ssa-copy.cc index 9c9ec47..6cbf594 100644 --- a/gcc/tree-ssa-copy.cc +++ b/gcc/tree-ssa-copy.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-dce.cc b/gcc/tree-ssa-dce.cc index 015c179..c44eff3 100644 --- a/gcc/tree-ssa-dce.cc +++ b/gcc/tree-ssa-dce.cc @@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see giving values to operands in necessary statements; and 3. Removing dead statements. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-dom.cc b/gcc/tree-ssa-dom.cc index 221fe6d..ef4e6c1 100644 --- a/gcc/tree-ssa-dom.cc +++ b/gcc/tree-ssa-dom.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc index 766eaf0..7af4dc1 100644 --- a/gcc/tree-ssa-forwprop.cc +++ b/gcc/tree-ssa-forwprop.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-ifcombine.cc b/gcc/tree-ssa-ifcombine.cc index 6a3bc99..f806409 100644 --- a/gcc/tree-ssa-ifcombine.cc +++ b/gcc/tree-ssa-ifcombine.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-loop-ch.cc b/gcc/tree-ssa-loop-ch.cc index 6552ddd..ec936d8 100644 --- a/gcc/tree-ssa-loop-ch.cc +++ b/gcc/tree-ssa-loop-ch.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-loop-im.cc b/gcc/tree-ssa-loop-im.cc index ccc56dc..26b4147 100644 --- a/gcc/tree-ssa-loop-im.cc +++ b/gcc/tree-ssa-loop-im.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-loop-manip.cc b/gcc/tree-ssa-loop-manip.cc index 213f069..3261193 100644 --- a/gcc/tree-ssa-loop-manip.cc +++ b/gcc/tree-ssa-loop-manip.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-loop-niter.cc b/gcc/tree-ssa-loop-niter.cc index 4583c2b..799ace2 100644 --- a/gcc/tree-ssa-loop-niter.cc +++ b/gcc/tree-ssa-loop-niter.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-loop-split.cc b/gcc/tree-ssa-loop-split.cc index 6843548..8427b01 100644 --- a/gcc/tree-ssa-loop-split.cc +++ b/gcc/tree-ssa-loop-split.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc index f9ccdf4..e78ef76 100644 --- a/gcc/tree-ssa-math-opts.cc +++ b/gcc/tree-ssa-math-opts.cc @@ -84,6 +84,7 @@ along with GCC; see the file COPYING3. If not see The data structures would be more complex in order to work on all the variables in a single pass. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-operands.cc b/gcc/tree-ssa-operands.cc index 1dbf6b9..a01aa51 100644 --- a/gcc/tree-ssa-operands.cc +++ b/gcc/tree-ssa-operands.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-phiprop.cc b/gcc/tree-ssa-phiprop.cc index 2a1cdae..ded0a4e 100644 --- a/gcc/tree-ssa-phiprop.cc +++ b/gcc/tree-ssa-phiprop.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-pre.cc b/gcc/tree-ssa-pre.cc index 13f2c8a..7cbad30 100644 --- a/gcc/tree-ssa-pre.cc +++ b/gcc/tree-ssa-pre.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-propagate.cc b/gcc/tree-ssa-propagate.cc index d96d0a9..43b1760 100644 --- a/gcc/tree-ssa-propagate.cc +++ b/gcc/tree-ssa-propagate.cc @@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-reassoc.cc b/gcc/tree-ssa-reassoc.cc index 347350f..a898658 100644 --- a/gcc/tree-ssa-reassoc.cc +++ b/gcc/tree-ssa-reassoc.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc index 84a0c37..d5db053 100644 --- a/gcc/tree-ssa-sccvn.cc +++ b/gcc/tree-ssa-sccvn.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-scopedtables.cc b/gcc/tree-ssa-scopedtables.cc index c367d37..3f43b64 100644 --- a/gcc/tree-ssa-scopedtables.cc +++ b/gcc/tree-ssa-scopedtables.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-sink.cc b/gcc/tree-ssa-sink.cc index 8c551e4..eace914 100644 --- a/gcc/tree-ssa-sink.cc +++ b/gcc/tree-ssa-sink.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-strlen.cc b/gcc/tree-ssa-strlen.cc index ee60909..25c0ada 100644 --- a/gcc/tree-ssa-strlen.cc +++ b/gcc/tree-ssa-strlen.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc index 73ba5aa..a6adec3 100644 --- a/gcc/tree-ssa-structalias.cc +++ b/gcc/tree-ssa-structalias.cc @@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-ter.cc b/gcc/tree-ssa-ter.cc index 9b338bd..890ad01 100644 --- a/gcc/tree-ssa-ter.cc +++ b/gcc/tree-ssa-ter.cc @@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssa-uninit.cc b/gcc/tree-ssa-uninit.cc index 726684e..9c3c687 100644 --- a/gcc/tree-ssa-uninit.cc +++ b/gcc/tree-ssa-uninit.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #define INCLUDE_STRING #include "config.h" #include "system.h" diff --git a/gcc/tree-ssa.cc b/gcc/tree-ssa.cc index f4fa4e9..7c6807c 100644 --- a/gcc/tree-ssa.cc +++ b/gcc/tree-ssa.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-ssanames.cc b/gcc/tree-ssanames.cc index ae6a0cd..d138c1f 100644 --- a/gcc/tree-ssanames.cc +++ b/gcc/tree-ssanames.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-stdarg.cc b/gcc/tree-stdarg.cc index 33763cd..79b549a 100644 --- a/gcc/tree-stdarg.cc +++ b/gcc/tree-stdarg.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-streamer-in.cc b/gcc/tree-streamer-in.cc index 2fa998d..bf9df99 100644 --- a/gcc/tree-streamer-in.cc +++ b/gcc/tree-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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-streamer-out.cc b/gcc/tree-streamer-out.cc index 2fdd914..93ef905 100644 --- a/gcc/tree-streamer-out.cc +++ b/gcc/tree-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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-streamer.cc b/gcc/tree-streamer.cc index 72e967a..0a80af7 100644 --- a/gcc/tree-streamer.cc +++ b/gcc/tree-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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-switch-conversion.cc b/gcc/tree-switch-conversion.cc index 00426d4..3302387 100644 --- a/gcc/tree-switch-conversion.cc +++ b/gcc/tree-switch-conversion.cc @@ -22,6 +22,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA /* This file handles the lowering of GIMPLE_SWITCH to an indexed load, or a series of bit-test-and-branch expressions. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-tailcall.cc b/gcc/tree-tailcall.cc index 1901b1a..d188da7 100644 --- a/gcc/tree-tailcall.cc +++ b/gcc/tree-tailcall.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc index a19f8ec..c265672 100644 --- a/gcc/tree-vrp.cc +++ b/gcc/tree-vrp.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/tree.cc b/gcc/tree.cc index b40f4d3..0e0dbee 100644 --- a/gcc/tree.cc +++ b/gcc/tree.cc @@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see 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/ubsan.cc b/gcc/ubsan.cc index 76ca7a0..ae48dc9 100644 --- a/gcc/ubsan.cc +++ b/gcc/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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/value-pointer-equiv.cc b/gcc/value-pointer-equiv.cc index cfb53ab..3e415c5 100644 --- a/gcc/value-pointer-equiv.cc +++ b/gcc/value-pointer-equiv.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/value-prof.cc b/gcc/value-prof.cc index ddb4b4e..61578be 100644 --- a/gcc/value-prof.cc +++ b/gcc/value-prof.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/value-query.cc b/gcc/value-query.cc index 34499da..d68ac5d 100644 --- a/gcc/value-query.cc +++ b/gcc/value-query.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/value-range-pretty-print.cc b/gcc/value-range-pretty-print.cc index b11d649..cbd7bc5 100644 --- a/gcc/value-range-pretty-print.cc +++ b/gcc/value-range-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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/value-range-storage.cc b/gcc/value-range-storage.cc index d3d98f9..b74ae7f 100644 --- a/gcc/value-range-storage.cc +++ b/gcc/value-range-storage.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 3046232..775e97d 100644 --- a/gcc/value-range.cc +++ b/gcc/value-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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index d8a2ed9..5c7986e 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/var-tracking.cc b/gcc/var-tracking.cc index 0817466..5f1358c 100644 --- a/gcc/var-tracking.cc +++ b/gcc/var-tracking.cc @@ -85,6 +85,7 @@ */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/varpool.cc b/gcc/varpool.cc index e40504d..0b5d448 100644 --- a/gcc/varpool.cc +++ b/gcc/varpool.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/vr-values.cc b/gcc/vr-values.cc index cf273a3f..6db1704 100644 --- a/gcc/vr-values.cc +++ b/gcc/vr-values.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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/wide-int-print.cc b/gcc/wide-int-print.cc index 3e02ee1..c4ee779 100644 --- a/gcc/wide-int-print.cc +++ b/gcc/wide-int-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 <http://www.gnu.org/licenses/>. */ +#define INCLUDE_MEMORY #include "config.h" #include "system.h" #include "coretypes.h" |