Compare commits

...

284 Commits

Author SHA1 Message Date
Gaius Mulley
4f27bc50e6 PR-108123 Rebuilt gcc/m2/gm2config.h.in
Rebuilt the file gcc/m2/gm2config.h.in using autoheader-2.69.

gcc/m2/ChangeLog:

	* gm2config.h.in: Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-15 10:40:11 +00:00
Gaius Mulley
2e0ff34783 Add modula-2 into doc/install.texi and doc/sourcebuild.texi.
Add modula-2 into doc/install.texi and doc/sourcebuild.texi.

gcc/ChangeLog:

	* doc/install.texi: Add m2 as a language.
	(--disable-libgm2) Documented.  Add make check-m2 to
	testing selected tests.
	* doc/sourcebuild.texi (GM2): New prerequisite item.
        (Python3 modules) New item.  (libgm2) Added.
	(gcc/m2) Added.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-14 13:55:22 +00:00
Gaius Mulley
fb2a3f4708 Merge branch 'master' into devel/modula-2. 2022-12-14 12:28:57 +00:00
Gaius Mulley
144b3ad102 Move hand built ChangeLogs out of the way premerge.
Move hand built ChangeLogs out of the way premerge.

libgm2/ChangeLog:

	* ChangeLog-2022: (New file).

gcc/m2/ChangeLog:

	* ChangeLog-2022: (New file).

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-14 12:25:48 +00:00
Gaius Mulley
2922dd0987 Add list of potential target datatype comments to SYSTEM.def
Add list of potential target datatype comments to all SYSTEM.def
files to improve usefulness of target independent documentation.

gcc/m2/ChangeLog:

	* gm2-libs-coroutines/SYSTEM.def: Added list of data types.
	* gm2-libs-iso/SYSTEM.def: Added list of data types.
	* gm2-libs/SYSTEM.def: Added list of data types.
	* target-independent/SYSTEM-iso.texi: Rebuilt.
	* target-independent/SYSTEM-pim.texi: Rebuilt.
	* target-independent/gm2-libs.texi: Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-14 12:17:48 +00:00
Gaius Mulley
28f261c515 Tidyup fixes relating to python3 detection and documentation generation.
Fixes a typo and improves the warning configure.ac message if python3
is not found.  Remove gcc/m2/target-independent/*rst files for now.
Provide demangler function for system data types comment.

gcc/ChangeLog:

	* configure.ac (ACX_CHECK_PROG_VER): Improve warning
	message.
	* doc/install.texi (GM2): Update description about
	documentation created if no python3 is detected.

gcc/m2/ChangeLog:

	* Make-maintainer.in (m2-target-independent-doc-rst):
	Disabled.
	* gm2-libs/SYSTEM.def: Corrected typo.
	* target-independent/SYSTEM-pim.texi: (Rebuilt).
	* target-independent/gm2-libs.texi: (Rebuilt).
	* tools-src/def2doc.py (demangle_system_datatype): New
	function.
	(emit_texinfo_content) Call demangle_system_datatype.
	(emit_sphinx_content) Call demangle_system_datatype.
	* target-independent/Builtins.rst: (Removed).
	* target-independent/SYSTEM-iso.rst: (Removed).
	* target-independent/SYSTEM-pim.rst: (Removed).
	* target-independent/gm2-libs.rst: (Removed).

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-14 06:30:46 +00:00
Gaius Mulley
0ce58b3761 Introduce target independent copies of document chapters.
This patch introduces target independent copies of document chapters
which will be used if HAVE_PYTHON is no, thus providing a fall back
for documentation production.

gcc/m2/ChangeLog:

	* doc/gm2.texi: Tidy up mailing testsuite results
	(formatting).
	* Make-lang.in (gm2-libs-texi-check): Copy
	target-dependent copy
	if HAVE_PYTHON is no.  (gm2-libs-rst-check) Copy
	target-dependent copy
	if HAVE_PYTHON is no.  (SYSTEM-pim-texi-check) Copy
	target-dependent copy
	if HAVE_PYTHON is no.  (SYSTEM-pim-rst-check) Copy
	target-dependent copy
	if HAVE_PYTHON is no.  (SYSTEM-iso-texi-check) Copy
	target-dependent copy
	if HAVE_PYTHON is no.  (SYSTEM-iso-rst-check) Copy
	target-dependent copy
	if HAVE_PYTHON is no.  (Builtins.texi-check) Copy
	target-dependent copy if HAVE_PYTHON is no.
	(Builtins.rst-check) Copy target-dependent copy if
	HAVE_PYTHON is no.
	* Make-maintainer.in (m2-target-independent-doc): New rule.
	(m2-target-independent-doc-texi) New rule.
	(m2-target-independent-doc-rst) New rule.
	* gm2-libs-coroutines/SYSTEM.def: Tidied up comments.
	* gm2-libs-iso/README.texi: Corrected dates.
	* gm2-libs-iso/SYSTEM.def: Tidied up comments.
	* gm2-libs/README.texi: Corrected dates.
	* tools-src/def2doc.py (emit_texinfo_content): Do not change state
	in texinfo files.  Replace @SYSTEM_DATATYPES@ with 'Target
	specific data types.'.  Replace @SYSTEM_TYPES@ with '(* Target
	specific data types.  *)'
	* target-independent/Builtins.rst: New file.
	* target-independent/Builtins.texi: New file.
	* target-independent/gm2-libs.rst: New file.
	* target-independent/gm2-libs.texi: New file.
	* target-independent/readme.txt: New file.
	* target-independent/SYSTEM-iso.rst: New file.
	* target-independent/SYSTEM-iso.texi: New file.
	* target-independent/SYSTEM-pim.rst: New file.
	* target-independent/SYSTEM-pim.texi: New file.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-13 22:07:26 +00:00
Gaius Mulley
ea1c601751 Rebuilt gcc/config.in and gcc/configure.
Last commit forgot to rerun autoreconf and aclocal
within the gcc subdirectory.

gcc/ChangeLog:

   * config.in: (Rebuilt).
   * configure: (Rebuilt).

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-12 22:27:28 +00:00
Gaius Mulley
d5d3e57d33 Python3 detected in gcc/configure.ac, python3 modules install.texi.
This patch fixes three problems.  Firstly python3 is now detected
via a re-exp match python3 --version.  Secondly python3 modules
are described in doc/install.texi and modula-2 documentation
dependency upon python3 is mentioned.  Thirdly bug fixes for
--enable-generated-files-in-srcdir with the modula-2 front end
are made to Make-lang.in.

gcc/ChangeLog:

	* gcc/aclocal.m4: Rebuilt.
	* gcc/configure: Rebuilt.
	* gcc/configure.ac (HAVE_PYTHON): Use ACX_CHECK_PROG_VER
	and re-exp to detect Python3.
	* doc/install.texi (GM2): New prerequisite item added.
	(Python3 modules) New item added.
	* m2/Make-lang.in: Bugfixes for
	--enable-generated-files-in-srcdir.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-12 18:03:31 +00:00
Gaius Mulley
5a359399d8 Remove ServerSocket.def and ServerSocket.mod
Remove the two source files.

gcc/m2/ChangeLog:

	* gm2-libs-iso/ServerSocket.def: Remove file.
	* gm2-libs-iso/ServerSocket.mod: Remove file.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-11 15:07:58 +00:00
Gaius Mulley
74d1529a36 Remove incomplete ServerSocket module.
Final (hopeful) tidying up before the merge.  Remove the incomplete
additional module as it is not part of the ISO standard and it could
return when complete during the next stage1.

ChangeLog:

	* configure: Rebuilt.

gcc/ChangeLog:

	* configure: Rebuilt.

gcc/m2/ChangeLog:

	* gm2-libs-iso/ServerSocket.def: Removed.
	* gm2-libs-iso/ServerSocket.mod: Removed.

libgm2/ChangeLog:

	* Makefile.in: Rebuilt.
	* configure: Rebuilt.
	* libm2cor/Makefile.in: Rebuilt.
	* libm2iso/Makefile.am (M2DEFS): Remove ServerSocket.def.
	(M2MODS) Remove ServerSocket.mod.
	* libm2iso/Makefile.in: Rebuilt.
	* libm2log/Makefile.in: Rebuilt.
	* libm2min/Makefile.in: Rebuilt.
	* libm2pim/Makefile.in: Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-11 15:03:41 +00:00
Gaius Mulley
fd7e057183 gcc/doc/gm2.texi sub range.
The data type subrange should not be split into two words.

gcc/ChangeLog:

	* doc/gm2.texi: Revert (sub range) back to subrange.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-11 11:31:18 +00:00
Gaius Mulley
f6984c8112 More spelling corrections, spacing and minor obvious corrections.
More spelling corrections have been made via emacs-ispell (American).
All sentances have two spaces after the full stop and some
minor improvements describing how third party libraries
are installed.

gcc/ChangeLog:

	* doc/gm2.texi: Spelling changed to American.  Spacing after full
	stops.  Spacing in code examples.  More detail describing where
	third party libraries are installed.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-11 11:28:10 +00:00
Gaius Mulley
d90b603b6b Purged out of gcc tree info from the documentation.
All references to gm2 being outside the GCC tree have been purged.
The News section has been removed.  British spelling changed to American.
The Obtaining section has also been removed.

gcc/ChangeLog:

	* doc/gm2.texi (News): Removed.  (Obtaining) Removed.
	Spelling changed to American.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-10 11:09:07 +00:00
Gaius Mulley
4487e05a7c Alphabetically order options in gm2.texi and lang.opt and purge -fxcode.
This patch tidies up the options in gm2.texi and ensures that every
implemented option is documented.  -fxcode has been removed now that
the modula-2 front end uses gcc error/warning infastructure.

gcc/m2/ChangeLog:

	* doc/gm2.texi: Alphabetically sort options.
	Add entry for -fwholevalue.
	* m2/gm2-lang.cc (gm2_langhook_handle_option)
	Comment out OPT_fxcode as it is unimplemented.
	* m2/lang.opt: Remove entry for -fxcode.  Alphabetically order
	remaining options.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-09 23:53:46 +00:00
Gaius Mulley
aaa673daca Merge branch 'master' into devel/modula-2.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-07 19:51:10 +00:00
Gaius Mulley
442bcd0e9f Documentation tools python3 flake8 style improvements.
gcc/m2/ChangeLog:

	* tools-src/boilerplate.py: Flake8 conformity changes.
	* tools-src/def2doc.py (emit_texinfo_content): Replace
	module method invocation with object method invocation.
	(emit_sphinx_content): Replace
	module method invocation with object method invocation.
	Flake8 conformity changes.
	* tools-src/tidydates.py: Flake8 conformity changes.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-07 12:11:39 +00:00
Gaius Mulley
e487d6fa02 Create namespace for modula2 debug tree routines.
gcc/m2/ChangeLog:

	* m2/m2pp.cc: Create namespace modula2.
	* m2/m2pp.h: Create namespace modula2.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-06 19:33:56 +00:00
Gaius Mulley
98b201a33b Bugfix gm2_type_for_size. Patchset suggestion missed.
A feedback suggestion missed with the previous commits.
Use build_nonstandard_integer_type to avoid getting
a different type each time this function is called.

gcc/m2/ChangeLog:

	* m2/gm2-lang.cc (gm2_type_for_size):
	Use build_nonstandard_integer_type.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-06 18:43:44 +00:00
Gaius Mulley
5405813b8a gm2-lang.cc further tidyup of code.
More tidying and complete the feedback suggestions made during
the code review.

gcc/m2/ChangeLog:

	* m2/gm2-lang.cc (gm2_langhook_init_options_struct):
	Remove x_flag_non_call_exceptions.  Remove commented code.
	Add for loop to check whether any prebuilt integer types
	are suitable for use.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-06 02:45:37 +00:00
Gaius Mulley
db80db0aab gm2-lang.cc tidyup post review.
Removed misleading comments, use a simplified
gm2_eh_peronality_decl borrowed from cp.  Addressed the comments
made during the code review:
https://gcc.gnu.org/pipermail/gcc-patches/2022-November/606694.html.

gcc/ChangeLog:

	* m2/gm2-lang.cc: Removed misleading comments.
	(m2_write_global_declarations) Rewritten.
	(gm2_langhook_type_for_mod) Rewritten the case statements
	into more portable code.  (personality_decl) Removed.
	(gm2_eh_personality_decl) New tree decl.
	(gm2_langhook_eh_personality) Rewritten.
	(gm2_langhook_init) Do not create void_list_node as it is
	created by build_common_builtin_nodes.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-06 01:21:32 +00:00
Gaius Mulley
60035bdefe Tidy up removing unused procedure, add missing include and error token.
Some minor tidy ups which remove an unused procedure, add a missing
include header file and use a different token for the production of
error messages.

libgm2/ChangeLog:

	* libgm2/libm2min/libc.c: Add include stdlib.h.

gcc/m2/ChangeLog:

	* gm2-compiler/M2Quads.mod (CheckInCompatible): Removed usused
	procedure.  (CheckVariableOrConstantOrProcedure) use destok when
	generating an error about the designator.
	* gm2-compiler/PHBuild.bnf (ModuleDeclaration): Remove unused
	variable endt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-05 17:43:07 +00:00
Gaius Mulley
14e295ecf0 Add missing procedure name to the range error message.
Bugfix.  Runtime range errors generated via CodeErrorCheckLoc omit the
procedure name.

gcc/m2/ChangeLog:

	* gm2-compiler/M2Range.mod (CodeErrorCheckLoc): Concat function
	string to range error.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-05 14:18:19 +00:00
Gaius Mulley
071c72a9e4 Bugfix the scope name when generating constants.
A bug occurs when generating an error while constructing constants.
The scope name is incorrect.  Fixed by changing GetGlobalQuads
and moving StartBuildInit after Declaration.

gcc/m2/ChangeLog:

	* gm2-compiler/M2Scope.mod (GetGlobalQuads): Use prev to remember
	previous block and assign the scope characteristics of the next
	block with the same as the previous.
	* gm2-compiler/P0SymBuild.mod (FlushImport): Remove unused
	variable modname.
	* gm2-compiler/P3Build.bnf (Block): Move StartBuildInit after
	the Declaration.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-12-04 19:12:53 +00:00
Gaius Mulley
e171e6b291 PR-107959 bugfix ICE detect attempt to create aggregate constant using bad type
The module below causes an ICE.

MODULE badipv4 ;
TYPE
  IPV4 = ARRAY [1..4] OF CHAR ;
CONST
  Loopback = IPV4 {127, 0, 0, 1} ;
END badipv4.

The fix was to replace the internal error with a failure boolean and
issue error messages based on the constructor.  It also required changes
propagating tokenno into the range checking code which is then passed
to M2ALU which generates the aggregate constant.

gcc/m2/ChangeLog:

	* gm2-compiler/M2ALU.mod (CheckGetCharFromString): Return TRUE if
	successful otherwise return FALSE and issue an error message.
	Add extra parameter baseType.
	(InitialiseArrayOfCharWith) Use CheckGetCharFromString and pass
	baseType.
	* gm2-compiler/M2Quads.def (StartBuildDefFile):
	Add parameter tok.  (StartBuildModFile) Add parameter tok.
	(EndBuildFile) Add parameter tok.
	(StartBuildInit) Add parameter tok.
	(EndBuildInit) Add parameter tok.
	(StartBuildFinally) Add parameter tok.
	(EndBuildFinally) Add parameter tok.
	(BuildExceptInitial) Add parameter tok.
	(BuildExceptInitial) Add parameter tok.
	(BuildExceptFinally) Add parameter tok.
	(BuildExceptProcedure) Add parameter tok.
	(BuildReThrow) Add parameter tok.
	(StartBuildInnerInit) Add parameter tok.
	(EndBuildInnerInit) Add parameter tok.
	(BuildModuleStart) Add parameter tok.
	(BuildModuleStart) Add parameter tok.
	* gm2-compiler/M2Quads.mod (ForLoopInfo): Redefined as a pointer
	to record.  (ForInfo) Redefined as an Index.
	(EndBuildFile) Add parameter tok.
	(StartBuildInit) Add parameter tok.
	(EndBuildInit) Add parameter tok.
	(StartBuildFinally) Add parameter tok.
	(EndBuildFinally) Add parameter tok.
	(BuildExceptInitial) Add parameter tok.
	(BuildExceptInitial) Add parameter tok.
	(BuildExceptFinally) Add parameter tok.
	(BuildExceptProcedure) Add parameter tok.
	(BuildReThrow) Add parameter tok.
	(StartBuildInnerInit) Add parameter tok.
	(EndBuildInnerInit) Add parameter tok.
	(BuildModuleStart) Add parameter tok.
	(BuildModuleStart) Add parameter tok.
        (ForLoopAnalysis): Use ForInfo Indexing
	procedures and ForLoopInfo to check for loops.
	(AddForInfo): Reimplemented using ForInfo and
	Indexing procedures.
	(CheckForIndex): Pass ForLoopInfo parameter.
	Reimplemented.
	(BuildEndFor): Add parameter to AddForInfo.
	* gm2-compiler/M2Range.mod (FoldAssignment):
	Use tokenNo in the Range when declaring constant.
	(FoldParameterAssign) Use tokenNo in the Range
	when declaring constant.  (FoldReturn) Use tokenNo
	in the Range when declaring constant.
        (FoldReturn) Use tokenNo
	in the Range when declaring constant.
	* gm2-compiler/P3Build.bnf (ProgramModule) pass module
	token and end token to respective build procedures.
	(ImplementationModule) pass module
	token and end token to respective build procedures.
	(Block) Pass token to build routines.
	(InitialBlockBody) Pass token to build routines.
	(FinalBlockBody) Pass token to build routines.
	(ProcedureBlockBody) Pass token to build routines.
	(ModuleDeclaration) Pass token to build routines.
	(DefinitionModule) Pass token to build routines.
	* gm2-compiler/PHBuild.bnf (ProgramModule) pass module
	token and end token to respective build procedures.
	(ImplementationModule) pass module
	token and end token to respective build procedures.
	(Block) Pass token to build routines.
	(InitialBlockBody) Pass token to build routines.
	(FinalBlockBody) Pass token to build routines.
	(ProcedureBlockBody) Pass token to build routines.
	(ModuleDeclaration) Pass token to build routines.
	(DefinitionModule) Pass token to build routines.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-03 16:59:52 +00:00
Gaius Mulley
2ed9ad9b91 Bugfix to catch assigning a standard procedure function to a const.
These bug fix the bug exposed when attempting to import from a local
module.  They also include many token accuracy improvements.

gcc/m2/ChangeLog:

	* gm2-compiler/M2Base.def (CheckExpressionCompatible):
	Add tok parameter.  (CheckAssignmentCompatible) Add tok
	parameter.  (CheckParameterCompatible) Add tok parameter.
	* gm2-compiler/M2Base.mod (EmitTypeIncompatibleWarning):
	Add tok parameter and use it within MetaErrorT2 calls.
	(EmitTypeIncompatibleError) Add tok parameter and use it
	within MetaErrorT2 calls.  (CheckCompatible) Add tok
	parameter and use it within error messages.
	* gm2-compiler/M2MetaError.mod (symDesc): Add standard
	procedure and standard function procedure description.
	* gm2-compiler/M2Quads.mod (CheckCompatibleWithBecomes)
	Add tok parameter.  (CheckBecomesMeta) Add
	combinedtok, destok, exprtok.  (CheckAssignCompatible) Add
	combinedtok, destok, exprtok.
	* gm2-compiler/P0SymBuild.mod: Reformatted.
	(RegisterLocalModule) Fix modname/name bug.  (RegisterImports)
	Fix n/modname bug.
	* gm2-compiler/PCSymBuild.mod (PushConstFunctionType): Use
	token position when generating error messages.

gcc/testsuite/gm2/ChangeLog:

	* iso/fail/realbitscast.mod: Minor formatting changes.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-01 22:01:42 +00:00
Gaius Mulley
54ea48efe1 Merge branch 'master' into devel/modula-2
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-12-01 00:30:29 +00:00
Gaius Mulley
bdec440d71 Token accuracy fixes for module symbol creation.
This patch improves the accuracy of tokens when module symbols
are created.  Improve token position accuracy within WITH and
RETRY statements.

gcc/m2/ChangeLog:

	* gm2-compiler/M2CaseList.mod (MissingCaseBounds):
	Change format string to use keyword specifiers and
	MetaErrorT1.
	* gm2-compiler/M2Comp.mod (DoPass0): Use MetaError 'A'
	format specifier to signify unrecoverable errors.
	* gm2-compiler/M2MetaError.mod: Import FlushWarnings.
	(checkAbort) Call FlushWarnings.
	* gm2-compiler/M2Quads.def (BuildRetry): Add tok parameter.
	* gm2-compiler/M2Quads.mod (BuildDesignatorRecord): Remove
	parameters if an error is detected.  (BuildDesignatorError)
	New procedure.  (BuildDesignatorArray) tidied up error
	reporting.
	* gm2-compiler/P0SymBuild.mod: Introduced tok recording
	of module idents.  (RegisterImports) Rewritten.
	(RegisterImport) Rewritten.
	* gm2-compiler/SymbolTable.mod: Added spacing.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-30 21:45:33 +00:00
Gaius Mulley
cad9dac282 Bugfix to detect re-assigning a constant record in a code block.
Detect re-assigning a value into an aggregate constant formed
from a record type.

gcc/m2/ChangeLog:

	* gm2-compiler/M2Quads.def (StartBuildWith): Add token
	parameter.
	* gm2-compiler/M2Quads.mod (StartBuildWith): Add token
	parameter.
	(BuildAssignment): Use IsReadOnly.
	(IsReadOnly): New procedure function.
	(BuildDesignatorRecord): Rewritten to propagate constant
	and correct token location.
	(BuildDynamicArray): Reformatted.
        (StartBuildWith): Rewritten to propagate constant
	and correct token location.
	(PushWith): New parameter token location.
	(CheckWithReference): Rewritten to use the token showing
	the with expression.
	* gm2-compiler/P3Build.bnf: Pass the token for the with
	keyword to BuildStartWith.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-29 20:25:06 +00:00
Gaius Mulley
918e3a0d1f New regression tests added.
gcc/testsuite/gm2/ChangeLog:

	* iso/fail/constarray.mod: New file.
	* iso/fail/constarray2.mod: New file.
	* iso/fail/constrecord.mod: New file.
	* iso/fail/constrecord2.mod: New file.
	* iso/fail/constrecord3.mod: New file.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-29 14:54:09 +00:00
Gaius Mulley
5d09bba11a Bugfix to detect re-assigning a constant array in a code block.
These patches detect re-assigning a constant array.  The patches
also correct the token position for aggregate constants.

gcc/m2/ChangeLog:

	* gm2-compiler/M2AsmUtil.mod
	* gm2-compiler/M2Quads.def (PushTFntok): Exported.
	(PopConstructor) Exported.
	(BuildConstructor): Add parameter.
	(BuildConstructorStart): Add parameter.
	(BuildConstructorEnd): Add parameter.
	(BuildComponentValue): Improved comment.
	* gm2-compiler/M2Quads.mod (SymbolTable): Import list inserted
	identifiers IsVarConst, PutVarConst and PutDeclared.
	(BuildConstructorStart): Add parameter.
	(BuildConstructorEnd): Add parameter.
	(BuildAssignment): Detect assignment to a constant.
	(BuildDesignatorArray): Detect assignment to a constant.
	(BuildStaticArray): Detect assignment to a constant.
	(BuildDynamicArray): Improve comments.
	(PushConstructor): Improve comments.
	(NextConstructorField): Improve comments.
	(BuildConstructor): Add parameter and use token position
	of type and parameter.
	* gm2-compiler/PCBuild.bnf (M2Quads): Import PopConstructor
	and PushTFntok.
	(ErrorStringAt): New procedure.
	* gm2-compiler/PCSymBuild.mod (PushConstructorCastType):
	Propagate token position.
	* gm2-compiler/PHBuild.bnf (Constructor): BuildConstructorStart
	pass token position of {.  BuildConstructorEnd
	pass token position of }.
	* gm2-compiler/SymbolTable.def (PutVarConst): Exported.
	(IsVarConst) Exported.
	* gm2-compiler/SymbolTable.mod (PutVarConst): New procedure.
	(IsVarConst) New procedure function.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-29 14:49:41 +00:00
Gaius Mulley
806751e5e9 Bugfix detect assigning constant constructors within a code block.
gcc/m2/ChangeLog:

	* gm2-compiler/M2Quads.def (BuildAssignConstant):
	Exported.
	* gm2-compiler/M2Quads.mod (BuildAssignConstant): New
	procedure.  (BuildAssignment) check whether designator
	is a constant and generate an error.
	* gm2-compiler/P3Build.bnf: Call BuildAssignConstant
	during ConstStatement.  Pass tokenno down to constant
	constructor parameters.
	* gm2-compiler/PHBuild.bnf: Call BuildAssignConstant
	during ConstStatement.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-25 15:10:17 +00:00
Gaius Mulley
deaeee4c18 PR-107611 Use correct parameter type in termios (doUnset).
2022-11-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/m2/ChangeLog:

	* gm2-libs-ch/termios.c (doUnset): Use correct parameter
	tcflag_t *.
	* mc-boot-ch/Gtermios.cc (doUnset): Use correct parameter
	tcflag_t *.
	* pge-boot/Gtermios.cc (doUnset): Use correct parameter
	tcflag_t *.

libgm2/ChangeLog:

	* libm2pim/termios.cc (doUnset): Use correct parameter
	tcflag_t *.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-11-24 17:02:48 +00:00
Gaius Mulley
55ca43c9f2 Disable regression tests which depend upon plugins (if ENABLE_PLUGINs) is false.
gcc/testsuite/gm2/ChangeLog:

	* testsuite/gm2/iso/check/fail/iso-check-fail.exp: Disable test if
	plugins have not been built.
	* testsuite/gm2/switches/auto-init/fail/switches-auto-init-fail.exp:
	Disable test if	plugins have not been built.
	* testsuite/gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp:
	Disable test if	plugins have not been built.
	* testsuite/gm2/switches/check-all/plugin/iso/fail/switches-check-all-plugin-iso-fail.exp:
	Disable test if	plugins have not been built.
	* testsuite/gm2/switches/check-all/plugin/pim2/fail/switches-check-all-plugin-pim2-fail.exp:
	Disable test if	plugins have not been built.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-11-23 17:07:34 +00:00
Gaius Mulley
fd4db55374 Definition files in m2/gm2-gcc changed to FOR "C" and plugin fix.
gcc/m2/ChangeLog:

	* gm2-gcc/init.def: Change to DEFINITION FOR "C".
	* gm2-gcc/m2block.def: Change to DEFINITION FOR "C".
	* gm2-gcc/m2builtins.def: Change to DEFINITION FOR "C".
	* gm2-gcc/m2convert.def: Change to DEFINITION FOR "C".
	* gm2-gcc/m2except.def: Change to DEFINITION FOR "C".
	* gm2-gcc/m2misc.def: Change to DEFINITION FOR "C".
	* gm2-gcc/m2statement.def: Change to DEFINITION FOR "C".
	* gm2-gcc/m2top.def: Change to DEFINITION FOR "C".
	* gm2-gcc/m2tree.def: Change to DEFINITION FOR "C".
	* gm2-gcc/m2type.def: Change to DEFINITION FOR "C".
	* m2/gm2spec.cc: Generate an error if the user requests
	the m2-plugin when plugins were disabled during
	the build.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-11-23 14:50:34 +00:00
Gaius Mulley
7b0ef381ac Improve detection of python.
Use a safer mechanism to detect python.

gcc/ChangeLog:

	* configure.ac: Use AM_PATH_PYTHON
	and AM_CONDITIONAL to detect python.
	* aclocal.m4: Rebuilt.
	* configure: Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-11-22 18:01:43 +00:00
Gaius Mulley
1e33c0019b Revert sphinx and reintroduce texinfo make rules.
gcc/m2/ChangeLog:

	* Make-lang.in: Revert rules to build documentation from
	texinfo sources.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-11-18 12:21:16 +00:00
Gaius Mulley
59f312880b Merge branch 'master' into devel/modula-2. 2022-11-18 01:26:18 +00:00
Gaius Mulley
5561d86a22 Rebuilt libgm2 Makefile.in's.
libgm2/ChangeLog:

	* libm2cor/Makefile.in: Rebuilt.
	* libm2iso/Makefile.in: Rebuilt.
	* libm2log/Makefile.in: Rebuilt.
	* libm2min/Makefile.in: Rebuilt.
	* libm2pim/Makefile.in: Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-17 22:33:55 +00:00
Gaius Mulley
681cb6addd pge ebnf and def2doc.py first cut complete for Sphinx
The m2 tools have been changed to emit Sphinx output.
pge has also been rebuilt.

gcc/m2/ChangeLog:

	* gcc/m2/Make-lang.in: Introduced rst rules for
	subcomponents: gm2-libs.rst, gm2-ebnf.rst
	SYSTEM-pim.rst, SYSTEM-iso.rst and Builtins.rst.
	* gcc/m2/Make-maintainer.in: Added pge-clean rule.
	* gcc/m2/gm2-compiler/ppg.mod: Introduced new option
	-x for sphinx output.  Implemented ebnf pretty printing.
	* gcc/m2/tools-src/def2doc.py: Introduced state class
	to ensure that the rst block is only changed if
	necessary.
	* gcc/m2/pge-boot/GASCII.c: Rebuilt.
	* gcc/m2/pge-boot/GArgs.c: Rebuilt.
	* gcc/m2/pge-boot/GAssertion.c: Rebuilt.
	* gcc/m2/pge-boot/GDebug.c: Rebuilt.
	* gcc/m2/pge-boot/GDynamicStrings.c: Rebuilt.
	* gcc/m2/pge-boot/GFIO.c: Rebuilt.
	* gcc/m2/pge-boot/GIO.c: Rebuilt.
	* gcc/m2/pge-boot/GIndexing.c: Rebuilt.
	* gcc/m2/pge-boot/GLists.c: Rebuilt.
	* gcc/m2/pge-boot/GM2Dependent.c: Rebuilt.
	* gcc/m2/pge-boot/GM2EXCEPTION.c: Rebuilt.
	* gcc/m2/pge-boot/GM2RTS.c: Rebuilt.
	* gcc/m2/pge-boot/GNameKey.c: Rebuilt.
	* gcc/m2/pge-boot/GNumberIO.c: Rebuilt.
	* gcc/m2/pge-boot/GOutput.c: Rebuilt.
	* gcc/m2/pge-boot/GPushBackInput.c: Rebuilt.
	* gcc/m2/pge-boot/GRTExceptions.c: Rebuilt.
	* gcc/m2/pge-boot/GSFIO.c: Rebuilt.
	* gcc/m2/pge-boot/GStdIO.c: Rebuilt.
	* gcc/m2/pge-boot/GStorage.c: Rebuilt.
	* gcc/m2/pge-boot/GStrCase.c: Rebuilt.
	* gcc/m2/pge-boot/GStrIO.c: Rebuilt.
	* gcc/m2/pge-boot/GStrLib.c: Rebuilt.
	* gcc/m2/pge-boot/GSymbolKey.c: Rebuilt.
	* gcc/m2/pge-boot/GSysStorage.c: Rebuilt.
	* gcc/m2/pge-boot/Gbnflex.c: Rebuilt.
	* gcc/m2/pge-boot/Gpge.c: Rebuilt.
	* gcc/m2/pge-boot/main.c: Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-17 22:32:13 +00:00
Gaius Mulley
b0545fc190 Rebuilt generated files post merge.
Rebuilt configure and Makefile.in after the recent merge.

ChangeLog:

	* Makefile.in: Rebuilt.
	* configure: Rebuilt.

libgm2/ChangeLog:

	* Makefile.in: Rebuilt.
	* configure: Rebuilt.
	* libm2cor/Makefile.in: Rebuilt.
	* libm2iso/Makefile.in: Rebuilt.
	* libm2log/Makefile.in: Rebuilt.
	* libm2min/Makefile.in: Rebuilt.
	* libm2pim/Makefile.in: Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-15 22:56:52 +00:00
Gaius Mulley
81b4437fd0 Merge branch 'master' into devel/modula-2
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-15 20:52:14 +00:00
Gaius Mulley
0685f29d72 Revert autogenerated files before merge and doc files.
ChangeLog:

	* Makefile.in: Reverted.

gcc/ChangeLog:

	* configure: Reverted.
	* doc/install.texi: Reverted.
	* doc/sourcebuild.texi: Reverted.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-15 20:48:27 +00:00
Gaius Mulley
5c95b7e7dc Bugfix -fm2-whole-program linking.
Linking a project using -fm2-whole-program would fail under the new
linking schema.  The bugfixes here fix them.  The problem was that the
naming of the dtor/ctor/init/fini functions (for outer modules) must
not get name mangled.  Ensure that the special variables exported from
M2LINK are only created once.  Subsequent attempts return with the
existing variables.  Also fixed an obvious attribute name.  Allow
the ZTYPE to be compared to WORD and BYTE without requiring a cast.
Definition for "C" no longer automatically implies export unqualified.

gcc/m2/ChangeLog:

	* Make-lang.in (CPP_GM2): Removed.  -fpermissive removed.
	Ensure that M2LINK.o is linked in to stage1/m2/cc1gm2.
	* gm2-compiler/M2Base.mod: Allow the ZTYPE to be compared
	to WORD and BYTE without requiring a cast.
	* gm2-compiler/M2AsmUtil.mod (SymbolTable): Import list added
	identifiers IsExtern, IsMonoName and IsPublic.
	(StringToKey): Reformatted.  (GetFullScopeAsmName): Rewritten.
	* gm2-compiler/M2Base.mod: Allow the ZTYPE to be compared
	to WORD and BYTE without requiring a cast.
	* gm2-compiler/M2Batch.mod: Improved comment.
	* gm2-compiler/M2GCCDeclare.def (DeclareM2linkGlobals):
	Add to export list.
	* gm2-compiler/M2GCCDeclare.mod: Ensure that
	DeclareModuleInit is called when -fm2-whole-program is
	employed.
	(DoVariableDeclaration) check to see if the special M2LINK
	variables require an initial value.  (AddEntryM2Link) New
	procedure.  (GetEntryM2Link) New procedure function.
	(DeclareM2linkGlobals) New procedure.  (DetectM2LinkInitial)
	New procedure.  (DeclareVariableWholeProgram) Rewritten.
	(InitM2LinkModule) New procedure.
	* gm2-compiler/M2GenGCC.mod: Call to DeclareM2linkGlobals
	change parameters.
	* gm2-compiler/M2Quad.mod (BuildTry): New procedure.
	(BuildExcept) New procedure.  (BuildM2MainFunction) create
	try/catch around _M2_init/_M2_fini providing exceptions
	are allowed.
	* gm2-compiler/M2Scaffold.mod: Add extra parameter to calls to
	PutModuleCtorExtern.  Call PutMonoName for all
	init/fini/link/main functions.  (initialized) New variable.
	* gm2-compiler/P1SymBuild.mod: Changed behaviour of
	definition for "C" to be consistant and the same as the
	bootstrap tool mc.  Definition for "C" no longer
	automatically implies export unqualified.
	* gm2-compiler/P2Build.bnf: Corrected ident comparison
	to unused.
	* gm2-compiler/SymbolTable.def: New definitions for
	IsMonoName and PutMonoName.
	* gm2-compiler/SymbolTable.mod: (IsMonoName) New procedure
	function.  (PutMonoName) New procedure.  ctor, init,
	fini, dep use MonoName as appropriate.
	(PutModuleCtorExtern): Add new parameter.
	(MakeProcedure): Initialize IsMonoName.
	* gm2-gcc/init.cc: Remove declarations for M2LINK
	variables.
	* gm2-gcc/m2decl.def (DeclareM2linkForcedModuleInitOrder)
	New procedure.  (DeclareM2linkStaticInitialization) New
	procedure.  (BuildPtrToTypeString) New function.
	* tools-src/boilerplate.py: Change all double quotes to
	single quotes.
	* tools-src/def2doc.py: Change all double quotes to
	single quotes.

gcc/testsuite/gm2/ChangeLog:

	* calling-c/datatypes/unbounded/run/pass/c.def: Add
	EXPORT UNQUALIFIED.
	* examples/callingC/run/pass/c.def: Add EXPORT
	UNQUALIFIED.
	* extensions/run/pass/cvararg.def: Add EXPORT
	UNQUALIFIED.
	* pim/run/pass/minhello.mod: New file.
	* switches/check-all/run/fail/tinyrange.mod: New file.
	* switches/whole-program/pass/run/hello.mod: New file.
	* switches/whole-program/pass/run/hello2.mod: New file.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-15 19:07:18 +00:00
Gaius Mulley
0c1fe5e2aa Bugfix for tiny modules importing from definition for "C".
If a tiny application module imports only from a definition for "C"
the import graph will not join with the core modula-2 libraries.
Thus if a range exception were to occur in the application the
libraries might be uninitialized.  This patch forces the application
module to be initialized last.

gcc/m2/ChangeLog:

	* gm2-libs/M2Dependent.mod (DisplayModuleInfo): Use variable count
	to display entry number.  (CheckApplication) Check that the
	application is the last entry in the list and move the list head
	if appropriate.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-15 14:11:04 +00:00
Gaius Mulley
d1eed60431 gcc/m2/tools-src/*.py coding style changes.
Use pythonic naming scheme.  Use python3 string method invocation.
Replace double quotes by single quotes.

gcc/m2/ChangeLog:

	* tools-src/boilerplate.py: Name style changes.  Double
	quotes to single quotes.  String method invocation
	changes.
	* tools-src/def2doc.py: Name style changes.  Double
	quotes to single quotes.  String method invocation
	changes.
	* tools-src/tidydates.py: Name style changes.  Double
	quotes to single quotes.  String method invocation
	changes.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-09 19:03:57 +00:00
Gaius Mulley
fe8cdf1cab PR-101392 fix pass binop.proc to CodeBinarySetshift.
Change m2expr.def to DEFINITION MODULE FOR "C" so that the
bootstrap tool mc generates M2GenGCC.c passing the procedure
parameter without the struct wrapper.

gcc/m2/ChangeLog:

	* gm2-gcc/m2expr.def: Change to FOR "C" module.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-09 16:33:56 +00:00
Gaius Mulley
b7bbab2f69 New regression tests added.
New test to check INTEGER CARDINAL comparisions are caught.  New test
to check missing actual parameters for intrinsic procedure functions
are also caught.

gcc/testsuite/gm2/ChangeLog:

	* gm2/errors/fail/badhigh.mod: New file.
	* gm2/errors/fail/badexpr.mod: New file.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-09 14:09:08 +00:00
Gaius Mulley
0fea4cded3 Bugfix to catch HIGH. Bugfix to check relational expressions.
These changes catch WHILE i < HIGH DO and also WHILE i < c DO
where i is INTEGER and C is CARDINAL.  Add new expression comparison
matrix in M2Base.mod.  Also add appropriate casts in testsuite and libraries.

gcc/m2/ChangeLog:

	* gm2-compiler/M2Base.def (IsComparisonCompatible): New procedure
	function.
	* gm2-compiler/M2Base.mod (IsComparisonCompatible): New procedure
	function.  Introduce new compatible array for relop checking.
	* gm2-compiler/M2GCCDeclare.mod (TryDeclareConstructor): Skip
	declaration if symbol is NulSym.
	* gm2-compiler/M2Quads.mod (M2MetaError): Import list inserted
	identifier MetaErrorsT1.  (BuildRelOp) add comparison compatible
	check.
	* gm2-compiler/M2Range.def (InitTypesExpressionCheck) Add
	strict and isin parameters.
	* gm2-compiler/M2Range.mod (InitTypesExpressionCheck) Add
	strict and isin parameters.
	* gm2-compiler/SymbolTable.mod (GetConstLitType): Disable
	ability to return LongInt, LongCard instead of ZType.
	* gm2-libs/FIO.mod (ReadChar): Cast to integer to overcome
	strictness of new checks.
	* gm2-libs/FormatStrings.mod: Add relop casting.

gcc/testsuite/gm2/ChangeLog:

	* testsuite/gm2/extensions/run/pass/align3.mod: Add
	relop casting.
	* testsuite/gm2/extensions/run/pass/align4.mod: Add
	relop casting.
	* testsuite/gm2/extensions/run/pass/align5.mod: Add
	relop casting.
	* testsuite/gm2/extensions/run/pass/align6.mod: Add
	relop casting.
	* testsuite/gm2/extensions/run/pass/align7.mod: Add
	relop casting.
	* testsuite/gm2/extensions/run/pass/record.mod: Add
	relop casting.
	* testsuite/gm2/iso/run/pass/testgeneric.mod: Add relop
	casting.
	* testsuite/gm2/iso/run/pass/testsystem.mod: Add relop
	casting.
	* testsuite/gm2/pim/run/pass/EndFor.mod: Add relop
	casting.
	* testsuite/gm2/pim/run/pass/EnumTest.mod: Add relop
	casting.
	* testsuite/gm2/pim/run/pass/TestLong2.mod: Add relop
	casting.
	* testsuite/gm2/pimlib/base/run/pass/FIO.mod: Add relop
	casting.
	* testsuite/gm2/projects/iso/run/pass/halma/halma.mod: Add
	relop casting.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-09 14:05:00 +00:00
Gaius Mulley
63edc9963c Remove xenix support from bootstrap tool mklink.c.
Remove conditional filename truncation necessary under XENIX.

gcc/m2/ChangeLog:

	* tools-src/mklink.c

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-07 19:08:06 +00:00
Gaius Mulley
be86a95e80 Further commenting and formatting changes for def2doc.py.
gcc/m2/ChangeLog:

	* tools-src/def2doc.py: Corrected Python3 formatting.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-05 17:23:25 +00:00
Gaius Mulley
f879a1e7e7 Improved comment formatting in Python3 scripts.
gcc/m2/ChangeLog:

	* tools-src/boilerplate.py: Improved comment formatting.
	* tools-src/def2doc.py: Improved comment formatting.
	* tools-src/tidydates.py: Improved comment formatting.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-05 16:12:49 +00:00
Gaius Mulley
a72dedb728 PR-107524 Ensure gm2.texi has a top node
Building html docs from gm2.texi fails due to missing top node.

2022-11-04  Matthias Klose  <doko@debian.org>

gcc/ChangeLog:

	* doc/gm2.texi: Remove conditional around top node.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-04 13:37:34 +00:00
Gaius Mulley
09d45192ff PR-107245 remove --no-headers from makeinfo.
Remove --no-headers from the invocation to makeinfo.

gcc/m2/ChangeLog:

	* m2/Make-lang.in: Remove --no-headers from the invocation to
	makeinfo.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-03 17:56:39 +00:00
Gaius Mulley
b94c3d78cf PR 207235 Bugfix gcc/m2/mc/mc.flex fclose the input file.
Keep a global copy of the input file and
fclose the input file prior to opening a new file.

gcc/m2/ChangeLog:

	* mc/mc.flex (openSource): Close the previous inputFile
	before opening the new file.  inputFile new global variable.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-03 15:07:02 +00:00
Gaius Mulley
28504e8e71 Rebuilt configure and gcc/configure.
ChangeLog:

	* configure: Rebuilt.

gcc/ChangeLog:

	* configure: Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-02 23:16:37 +00:00
Gaius Mulley
59a8e4ef46 Merge branch 'master' into devel/modula-2.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-02 23:10:37 +00:00
Gaius Mulley
494609a749 Python3 scripts in gcc/m2/tools-src flake8 compliant and use argparse.
tidydates.py and boilerplate.py have been changed to use argparse.
All python3 scripts are flake8 compliant.

gcc/m2/ChangeLog:

	* tools-src/boilerplate.py: Rewritten.
	* tools-src/tidydates.py: Rewritten.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-11-02 21:46:09 +00:00
Gaius Mulley
ca91bc242a Fix urls in gm2.texi, remove older news, improvements to def2doc.py.
Remove older papers and talks as the front end has changed
significantly.  Remove older text description for coroutines since the
underlying threading model has also changed.  Corrected other urls
given floppsie.comp.glam.ac.uk has disappeared.

gcc/ChangeLog:

	* doc/gm2.texi (Papers and talks): Removed.
	Urls to floppsie.comp.glam.ac.uk replaced.

gcc/m2/ChangeLog:

	* gm2-libs-coroutines/README.texi: Remove all GNU Pthread text
	as the processes now use __gthread.
	* tools-src/def2doc.py (emitSubSection): Use '-' character.
	(parseDefinition) Improved.
2022-11-01 11:43:19 +00:00
Gaius Mulley
a0fa580fb0 gcc/m2/tools-src/def2doc.py use with statement to open files.
Use with statement to open files.

gcc/m2/ChangeLog:

	* tools-src/def2doc.py (parseDefinition): use with statement.
	(doCat) Use with statement.  (handleFile) New function.
	(main) Use with statement.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-10-22 03:15:54 +01:00
Gaius Mulley
b66b8be4a0 gcc/configure rebuilt.
gcc/ChangeLog:

	* configure: Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-10-22 03:00:06 +01:00
Gaius Mulley
a2bb2bc376 Merge branch 'master' into devel/modula-2. 2022-10-22 02:43:56 +01:00
Gaius Mulley
1c4163fda4 gcc/configure reverted prior to a merge
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-10-22 02:43:19 +01:00
Gaius Mulley
f7b2d2d0ab gcc/m2/tools-src/def2doc.py rewritten to use argparse
gcc/m2/tools-src/def2texi.py renamed to gcc/m2/tools-src/def2doc.py.
It has been rewritten to use argparse and now has additional options
-x (partial sphinx output at present), -t texinfo output and -o output
filename.  It has been reformatted to conform to flake8.  The
gcc/configure.ac has been extended to check for the existance of
python3.  gcc/m2/Make-lang.in checks HAVE_PYTHON before invoking
python3.

gcc/ChangeLog:

	* configure.ac (HAVE_PYTHON): New test added.
	(PYTHON) New test added.
	* doc/gm2.texi (Copying): Menu item moved between
	Contributing and Licence.

gcc/m2/ChangeLog:

	* tools-src/def2doc.py (Renamed from def2texi.py): Rewritten to
	use argparse rather than getopt.  New options introduced -t texinfo
	and -x for sphinx output.  New option -o output file introduced.
	Code reformatted to conform to flake8.
	* m2/Make-lang.in: Only build texi files with def2texi.py if
	HAVE_PYTHON allows.
	* m2/config-make.in (HAVE_PYTHON): Added.  (PYTHON) Added.
	* m2/configure : Rebuilt.
	* m2/configure.ac: Remove check for flex as it is checked in
	gcc/configure.ac.
	* gm2-libs-pim/README.texi: Remove local menu and use 3 links
	instead.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-10-21 16:37:26 +01:00
Gaius Mulley
4a7481c6ed Merge branch 'master' into devel/modula-2. 2022-10-12 13:24:45 +01:00
Gaius Mulley
c92177a3eb Remove unused script.
Remove an unused script.

gcc/m2/ChangeLog:

	* tool-src/createUlmSys: (Removed).

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-10-10 14:42:04 +01:00
Gaius Mulley
b8bcd40cae Remove unnecessary scripts and scaffold files.
gcc/m2/ChangeLog:

	* init/gm2-gccinit: Removed.
	* init/gm2linit: Removed.
	* tools-src/gensum.py: Removed.
	* tools-src/makeversion: Removed.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-10-07 20:08:56 +01:00
Gaius Mulley
2cd0f1de97 Remove m2-version and -version processing in gm2.
This patch removes the m2-version option and removes -version
processing from the gm2 driver.  The patch removes various small
scripts which propagate the option into c/cp/m2 and texi files.

gcc/ChangeLog:

	* doc/gm2.texi (m2/version.texi): Include removed.  References
	made to version-GM2 and version-GCC removed.

gcc/m2/ChangeLog:

	* m2/Make-lang.in: Remove references to m2/version.texi,
	gm2version.c, M2Version.o, M2Version.c, makeversion and
	M2Version.mod.
	* gm2-compiler/M2Options.def (DisplayVersion): Removed.
	* gm2-compiler/M2Options.mod (DisplayVersion): Removed.
	* gm2-gcc/init.cc (_M2_M2Version_init): Removed.
	* gm2-lang.cc: Remove case clause for OPT_fm2_version
	and OPT_version.  (gm2version.h) Remove include.
	* gm2spec.cc (gm2version.h) Remove include.
	* lang.opt: Remove -fm2-version and -version.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-10-07 19:41:09 +01:00
Gaius Mulley
72db6dad8e Remove temporary files atexit.
This fixes a bug in the bootstrap program mc which would
leave temporary files in /tmp if it exited before reaching
the end of the top level module.

gcc/m2/ChangeLog:

	* mc-boot/Gdecl.c: Rebuilt.
	* mc-boot/GmcStream.c: Rebuilt.
	* mc-boot/GmcStream.h: Rebuilt.
	* mc-boot/Gtop.c: Rebuilt.
	* mc/mcStream.def (removeFiles): Exported.
	* mc/mcStream.mod (removeFiles): Added comment.
	* mc/top.mod (atexit): Imported.  (init) Install
	atexit handler to remove temporary files.
	(wrapRemoveFiles) New procedure function.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-10-06 15:24:31 +01:00
Gaius Mulley
389e72cc5e Revert unnecessary patch in gcc/c/gccspec.cc.
gcc/ChangeLog:

	* c/gccspec.c (lang_register_spec_functions): Removed.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-10-05 16:57:35 +01:00
Gaius Mulley
c9e2b1929b Purge of unnecessary files.
Removal of unnecessary files for the integration to GCC mainline.
Also removal of all references to gm2tools and unused development
scripts.

gcc/ChangeLog:

	* doc/sourcebuild.texi (Top level): Remove description
	about gm2tools.

gcc/m2/ChangeLog:

	* config-lang.in: Reordered the directory names.
	* gm2-gcc/gcc-consolidation.h: Remove ununsed #ifdef.
	* m2/m2-tree.h: Removed #if 0.
	* m2/m2.flex: Removed ununsed #ifdef.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-10-05 15:03:20 +01:00
Gaius Mulley
f2c218d067 Merge branch 'master' into devel/modula-2. 2022-10-04 11:55:51 +01:00
Gaius Mulley
8239b43c4b Bugfix for gcc/doc/gm2.texi add Linking section to the Using node.
Add a Linking section to the Using menu node.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-28 11:47:44 +01:00
Gaius Mulley
4ba09edbfd Remove unnecessary directories
More tidying up, removal of the script to generate the webpages
and removal of a modern modula-2 emacs mode.

gcc/m2/Changelog:

	* www: Removed.
	* el: Removed.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-28 11:44:31 +01:00
Gaius Mulley
92a438dee0 Merge branch 'master' into devel/modula-2. 2022-09-26 12:01:08 +01:00
Gaius Mulley
a5bebf26c9 Merge branch 'master' into devel/modula-2. 2022-09-20 14:35:46 +01:00
Gaius Mulley
d2e4f24ef5 Fixes to remove warnings and rebuild gcc/m2/configure.
gcc/m2/ChangeLog:

	* configure: Rebuilt.
	* gm2-compiler/M2GenGCC.mod (FoldBuiltin): Replace variable op3.
	* gm2-compiler/M2Quads.mod (IsBackReference): Fix spacing.
	(IsBackReferenceConditional): Fix spacing.
	* gm2-gcc/m2color.cc: Correct line breaks and change drop
	const from return to allow modula-2 to build without warning.
	* gm2-gcc/m2color.def: Tidyup comments and use PtrToChar
	as the return result rather than ADDRESS.
	* gm2-gcc/m2color.h: Change return result to char * (avoiding const).
	* gm2-libs-min/libc.c: Correct spacing.
	* gm2-libs/FIO.mod (StringFormat1): Initialize local variables to
	avoid warning.	(FormatError) Correct spacing.
	(FormatError2) Correct spacing.  (CheckAccess) Tidy comments and
	spacing.  (SetEndOfLine) Tidy comments and spacing.

libgm2/ChangeLog:

	* libm2pim/wrapc.c (wrapc_fileinode): Avoid a warning by using a
	check whether to assign high to 0 if sizeof (high) in bits <=
	shift length.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-20 12:00:56 +01:00
Gaius Mulley
c7ddd74ac0 Force qualification of type names while bootstrapping.
Force qualification of types generated by mc during bootstrap.
Also remove ACX_NONCANONICAL_HOST and ACX_NONCANONICAL_TARGET
from configure.ac.

gcc/m2/ChangeLog:

	* configure: Rebuilt.
	* configure.ac (ACX_NONCANONICAL_HOST): Removed.
	(ACX_NONCANONICAL_TARGET) Removed.
	* mc/decl.mod (forceQualified): New constant.
	(isQualifiedForced) New procedure function.
	(getFQstring) check isQualifiedForced.
	(getFQDstring) check isQualifiedForced.
	* mc-boot/GArgs.c: Rebuilt.
	* mc-boot/GCmdArgs.c: Rebuilt.
	* mc-boot/GDebug.c: Rebuilt.
	* mc-boot/GDynamicStrings.c: Rebuilt.
	* mc-boot/GEnvironment.c: Rebuilt.
	* mc-boot/GFIO.c: Rebuilt.
	* mc-boot/GFpuIO.c: Rebuilt.
	* mc-boot/GIO.c: Rebuilt.
	* mc-boot/GIndexing.c: Rebuilt.
	* mc-boot/GM2Dependent.c: Rebuilt.
	* mc-boot/GM2RTS.c: Rebuilt.
	* mc-boot/GMemUtils.c: Rebuilt.
	* mc-boot/GNumberIO.c: Rebuilt.
	* mc-boot/GPushBackInput.c: Rebuilt.
	* mc-boot/GRTExceptions.c: Rebuilt.
	* mc-boot/GRTint.c: Rebuilt.
	* mc-boot/GSArgs.c: Rebuilt.
	* mc-boot/GStdIO.c: Rebuilt.
	* mc-boot/GTimeString.c: Rebuilt.
	* mc-boot/Galists.c: Rebuilt.
	* mc-boot/Gdecl.c: Rebuilt.
	* mc-boot/Gkeyc.c: Rebuilt.
	* mc-boot/Glists.c: Rebuilt.
	* mc-boot/GmcComment.c: Rebuilt.
	* mc-boot/GmcComp.c: Rebuilt.
	* mc-boot/GmcError.c: Rebuilt.
	* mc-boot/GmcLexBuf.c: Rebuilt.
	* mc-boot/GmcMetaError.c: Rebuilt.
	* mc-boot/GmcPretty.c: Rebuilt.
	* mc-boot/GmcStack.c: Rebuilt.
	* mc-boot/GmcStream.c: Rebuilt.
	* mc-boot/Gmcp1.c: Rebuilt.
	* mc-boot/Gmcp2.c: Rebuilt.
	* mc-boot/Gmcp3.c: Rebuilt.
	* mc-boot/Gmcp4.c: Rebuilt.
	* mc-boot/Gmcp5.c: Rebuilt.
	* mc-boot/GnameKey.c: Rebuilt.
	* mc-boot/GsymbolKey.c: Rebuilt.
	* mc-boot/Gvarargs.c: Rebuilt.
	* mc-boot/Gwlists.c: Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-18 00:47:27 +01:00
Gaius Mulley
206c4f7760 Remove unused parameter warning via introducing attribute unused.
Introduce attribute unused into the grammar of gm2 and mc.
Emit attribute ((unused)) during parameters if specified.
Removes many unused warnings when building gm2 under bootstrap
(specifically used during generic walk procedures in M2GCCDeclare.mod).

gcc/m2/ChangeLog:

	* gm2-compiler/M2AsmUtil.mod (UnderScoreString): Removed.
	* gm2-compiler/M2GCCDeclare.mod (DeclareStringConstant): delete
	variable location and remove passing it to any procedure.
	(PromoteToString) remove variable location and remove it from all
	usage.
	(TryDeclareConst) remove tokenno.
	(DeclareConst): remove tokenno.
	* gm2-compiler/M2GenGCC.mod (CodeStatement): Remove first
	parameter for CodeInitStart and CodeFinallyStart.
	(BuildTreeFromInterface): Remove location variable as
	BuildStringConstant no longer has this parameter.
	(CodeInitStart): Remove the unused first parameter.
	(CodeFinallyStart): Remove the unused first parameter.
	(CodeAddr): Remove location variable as
	BuildStringConstant no longer has this parameter.
	* gm2-compiler/M2LexBuf.mod (stop): Removed.
	* gm2-compiler/M2Options.def (m2linemap): Import list replaced
	identifier GetSaveTempsDir.
	* gm2-compiler/M2Options.mod (DynamicStrings): Import list replaced
	identifiers GenModuleListFlag and SaveTempsDir.
	(SetSaveTempsDir) copy directory string.
	(GetSaveTempsDir) New procedure function.
	* gm2-compiler/M2Range.mod (BuildStringParamLoc): Remove location
	variable as it is no longer needed by BuildStringConstant.
	* gm2-compiler/P0SyntaxCheck.bnf: Extend grammar to allow
	attribute unused in parameters.
	* gm2-compiler/P1Build.bnf: Extend grammar to allow
	attribute unused in parameters.
	* gm2-compiler/P2Build.bnf (NameKey): Imported.  (MetaErrorT1)
	Imported.  Extend grammar to allow attribute unused in parameters
	and also check attribute contents for usused and noreturn.
	* gm2-compiler/P3Build.bnf: Extend grammar to allow attribute
	unused in parameters.
	* gm2-compiler/PCBuild.bnf: Extend grammar to allow attribute
	unused in parameters.
	* gm2-compiler/PHBuild.bnf: Extend grammar to allow attribute
	unused in parameters.
	* gm2-compiler/SymbolTable.mod (GetOuterModule): Remove function
	procedure.
	* gm2-gcc/m2decl.cc (BuildStringConstant): Remove unused
	location parameter.
	* gm2-gcc/m2decl.def (BuildStringConstant): Remove unused
	location parameter.
	* gm2-gcc/m2decl.h (BuildStringConstant): Remove unused
	location parameter.
	* m2/gm2-lang.cc: Tidy up comments.
	* m2/m2-tree.def: Tidy up comments.
	* m2/m2-tree.h: Tidy up comments.
	* m2/m2pp.cc: Tidy up comments.
	* m2/m2pp.h: Tidy up comments.
	* mc-boot/GASCII.c: Rebuilt.
	* mc-boot/GArgs.c: Rebuilt.
	* mc-boot/GAssertion.c: Rebuilt.
	* mc-boot/GBreak.c: Rebuilt.
	* mc-boot/GCmdArgs.c: Rebuilt.
	* mc-boot/GDebug.c: Rebuilt.
	* mc-boot/GDynamicStrings.c: Rebuilt.
	* mc-boot/GEnvironment.c: Rebuilt.
	* mc-boot/GFIO.c: Rebuilt.
	* mc-boot/GFormatStrings.c: Rebuilt.
	* mc-boot/GFpuIO.c: Rebuilt.
	* mc-boot/GIO.c: Rebuilt.
	* mc-boot/GIndexing.c: Rebuilt.
	* mc-boot/GM2Dependent.c: Rebuilt.
	* mc-boot/GM2EXCEPTION.c: Rebuilt.
	* mc-boot/GM2RTS.c: Rebuilt.
	* mc-boot/GMemUtils.c: Rebuilt.
	* mc-boot/GNumberIO.c: Rebuilt.
	* mc-boot/GPushBackInput.c: Rebuilt.
	* mc-boot/GRTExceptions.c: Rebuilt.
	* mc-boot/GRTint.c: Rebuilt.
	* mc-boot/GSArgs.c: Rebuilt.
	* mc-boot/GSFIO.c: Rebuilt.
	* mc-boot/GStdIO.c: Rebuilt.
	* mc-boot/GStorage.c: Rebuilt.
	* mc-boot/GStrCase.c: Rebuilt.
	* mc-boot/GStrIO.c: Rebuilt.
	* mc-boot/GStrLib.c: Rebuilt.
	* mc-boot/GStringConvert.c: Rebuilt.
	* mc-boot/GSysStorage.c: Rebuilt.
	* mc-boot/GTimeString.c: Rebuilt.
	* mc-boot/Galists.c: Rebuilt.
	* mc-boot/Gdecl.h: Rebuilt.
	* mc-boot/Gkeyc.c: Rebuilt.
	* mc-boot/Glists.c: Rebuilt.
	* mc-boot/GmcComment.c: Rebuilt.
	* mc-boot/GmcComp.c: Rebuilt.
	* mc-boot/GmcDebug.c: Rebuilt.
	* mc-boot/GmcError.c: Rebuilt.
	* mc-boot/GmcFileName.c: Rebuilt.
	* mc-boot/GmcLexBuf.c: Rebuilt.
	* mc-boot/GmcMetaError.c: Rebuilt.
	* mc-boot/GmcPreprocess.c: Rebuilt.
	* mc-boot/GmcPretty.c: Rebuilt.
	* mc-boot/GmcPrintf.c: Rebuilt.
	* mc-boot/GmcQuiet.c: Rebuilt.
	* mc-boot/GmcReserved.c: Rebuilt.
	* mc-boot/GmcSearch.c: Rebuilt.
	* mc-boot/GmcStack.c: Rebuilt.
	* mc-boot/GmcStream.c: Rebuilt.
	* mc-boot/Gmcp1.c: Rebuilt.
	* mc-boot/Gmcp2.c: Rebuilt.
	* mc-boot/Gmcp3.c: Rebuilt.
	* mc-boot/Gmcp4.c: Rebuilt.
	* mc-boot/Gmcp5.c: Rebuilt.
	* mc-boot/GnameKey.c: Rebuilt.
	* mc-boot/GsymbolKey.c: Rebuilt.
	* mc-boot/Gtop.c: Rebuilt.
	* mc-boot/Gvarargs.c: Rebuilt.
	* mc-boot/Gwlists.c: Rebuilt.
	* mc/decl.def (makeVarParameter): Add parameter to signify used.
	(makeNonVarParameter): Add parameter to signify used.
	(addVarParameters): Add parameter to signify used.
	* mc/decl.mod: Add isused boolean to parameters.
	* mc/mcp1.bnf: Extend grammar to handle attribute unused during
	parameters.
	* mc/mcp2.bnf: Extend grammar to handle attribute unused during
	parameters.
	* mc/mcp3.bnf: Extend grammar to handle attribute unused during
	parameters. (mcPrintf): Import list replaced identifiers makekey
	and makeKey.
	* mc/mcp4.bnf: Extend grammar to handle attribute unused during
	parameters.
	* mc/mcp5.bnf: Extend grammar to handle attribute unused during
	parameters.
	* tools-src/mklink.c: Pass envp with argc, argv parameters for
	module initializer/finalization calls.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-17 16:17:50 +01:00
Gaius Mulley
59ad15abea Merge branch 'master' into devel/modula-2. 2022-09-14 19:29:59 +01:00
Gaius Mulley
37e5e898dd Add definition for GM2_FOR_TARGET into gcc/m2/Make-lang.in.
gcc/m2/ChangeLog:

	* Make-lang.in (GM2_FOR_TARGET): Added.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-14 16:08:38 +01:00
Gaius Mulley
737bcb5ef6 GM2_FOR_TARGET added to all Makefile.ams in libgm2.
Added GM2_FOR_TARGET to be substituted into all Makefile.in
in libgm2 and below.  Also added GM2_FOR_TARGET into configure.ac.

libgm2/ChangeLog:

	* libgm2/Makefile.am (GM2_FOR_TARGET): Added.
	* libgm2/Makefile.in: Rebuilt.
	* libgm2/configure: Rebuilt.
	* libgm2/configure.ac (GM2_FOR_TARGET): Use AC_SUBST.
	* libm2cor/Makefile.am (GM2_FOR_TARGET): Added.
	* libm2cor/Makefile.in : Rebuilt.
	* libm2iso/Makefile.am (GM2_FOR_TARGET): Added.
	* libm2iso/Makefile.in : Rebuilt.
	* libm2log/Makefile.am (GM2_FOR_TARGET): Added.
	* libm2log/Makefile.in : Rebuilt.
	* libm2min/Makefile.am (GM2_FOR_TARGET): Added.
	* libm2min/Makefile.in : Rebuilt.
	* libm2pim/Makefile.am (GM2_FOR_TARGET): Added.
	* libm2pim/Makefile.in : Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-14 13:37:59 +01:00
Gaius Mulley
6ca7afc483 m2decl.cc DeclareKnownVariable to use const char parameter.
Avoid generating a warning by using const char * parameter.

gcc/m2/ ChangeLog:

	* gm2-gcc/m2decl.cc (DeclareKnownVariable): Use const char *
	parameter.
	* gm2-gcc/m2decl.h (DeclareKnownVariable): Use const char *
	parameter.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-09-14 00:54:57 +01:00
Gaius Mulley
d5e34c12f8 Tidyup of m2type.cc, m2decl.cc and other comments.
Removal of nop (m2block_begin_statement_list) function and
tidying up of many comments in m2type.cc and m2decl.cc.

gcc/m2/ChangeLog:

	* gm2-gcc/m2type.cc: Many comments tidied up.
	* gm2-gcc/m2decl.cc: Many comments tidied up.
	* gm2-gcc/m2block.cc (begin_statement_list):  Removed.
	All references made to begin_statement_list are replaced by
	its parameter.
	* gm2-gcc/m2block.h (begin_statement_list):  Removed.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-09-13 08:32:42 +01:00
Gaius Mulley
fd24c17e62 Merge branch 'master' into devel/modula-2. 2022-09-12 20:57:37 +01:00
Gaius Mulley
34a21a5666 gm2.texi documentation order options alphabetically.
Add -fscaffold-main description and order all options.

gcc/ChangeLog:

	* doc/gm2.texi: All options have been alphabetically ordered.
	(-fscaffold-main) Documented.  (Environment variable) section
	removed.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-09 14:39:40 +01:00
Gaius Mulley
89ef821b08 Merge branch 'master' into devel/modula-2. 2022-09-08 16:03:24 +01:00
Gaius Mulley
971d9ba31f M2Quads.mod tidyup and mc/decl.mod bugfix.
gcc/m2/ChangeLog:

	* gm2-compiler/M2Quads.mod (SafeRequestSym): Remove unused
	parameter procedure.  (BuildM2LinkFunction) Remove modulesym
	unused parameter.  (BuildM2MainFunction) Remove modulesym
	unused parameter.  Remove the first parameter in all calls to
	the above functions.
	* mc-boot/Gdecl.c: Rebuilt.
	* mc/decl.mod (isIntrinsicFunction): Remove throw.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-08 12:33:40 +01:00
Gaius Mulley
4b1cbb1e4f Tidyup gcc/m2/Make-lang.in remove gm2-auto build directory.
Trivial tidyup patch to remove a build directory which is no longer
needed.

gcc/m2/ChangeLog:

	* Make-lang.in (gm2-auto): Ensure gm2-auto is no longer
	referenced and remove the gm2-auto rule.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-07 10:49:48 +01:00
Gaius Mulley
ae6d944ee8 Bugfix mc memset correction, correct comments and add options to mc.
gcc/m2/ChangeLog:

	* gm2-compiler/M2Quads.mod: Correct init/fini function names
	in comments relating to intemediate code.
	* m2/mc/decl.mod (nodeRec): Introduced.  (newNode) Call
	memset with SIZE (d^) as a parameter.
	(scaffoldStatic) New procedure.  (emitCtor) New procedure.
	(scaffoldDynamic) New procedure.  (scaffoldMain) New procedure.
	(outImpInitC) Rewritten.
	* mc/mcOptions.def (getScaffoldStatic) New definition.
	(getScaffoldDynamic) New definition.
	(getScaffoldMain) New definition.
	* mc/mcOptions.mod (getScaffoldStatic) New procedure function.
	(getScaffoldDynamic) New procedure function.
	(getScaffoldMain) New definition function.
	* mc-boot/Gdecl.c: Rebuilt.
	* mc-boot/GmcOptions.c: Rebuilt.
	* mc-boot/GmcOptions.h: Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-07 00:06:31 +01:00
Gaius Mulley
7b1a727b06 Bugfix mc memset zero all nodes created by newNode.
newNode now memset zero the allocated memory.  Every
node created uses newNode.  Bug fix identified by Martin Liška.

gcc/m2/ChangeLog:

	* m2/mc/decl.mod (newNode): Call memset of allocated
	memory.  (doMakeBinary) call newNode.  (makeBase)
	call newNode.
	* m2/Make-maintainer.in: Many bugfixes to allow
	mc-maintainer to succeed.
	* m2/mc-boot/Gdecl.c: Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-05 23:39:42 +01:00
Gaius Mulley
3e960b43e6 Bugfix added missing rule change to gcc/m2/Make-lang.in
Tiny fix adding missing patch to gcc/m2/Make-lang.in.

gcc/m2/ChangeLog:

	* gcc/m2/Make-lang.in (m2/gm2-compiler-boot/%.mod) Remove
	$(objdir) from the rule	target.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-05 16:43:13 +01:00
Gaius Mulley
589b0719a2 Bugfix constant overflow detection and improved error messages.
Detect constant overflow (or whether the constant requires unsigned
int or long int or long unsigned int).  Also further tidying up of
mc/decl.mod and m2/Make-lang.in.

gcc/m2/ChangeLog:

	* gcc/m2/Make-lang.in (m2/mc-boot/main.o): Avoid temporary file.
	(m2/gm2-compiler/%.o) Remove $(objdir) from the rule target.
	(m2/gm2-compiler/%.mod) Remove $(objdir) from the rule target.
	(m2/gm2-compiler/%.mod) Remove $(objdir) from the rule target.
	(m2/gm2-compiler-boot/%.mod) Remove $(objdir) from the rule
	target.
	* gm2-compiler/M2ALU.def (PushString): Add tokenno as a parameter.
	* gm2-compiler/M2ALU.mod (PushString): Add tokenno as a parameter.
	Call BuildConstLiteralNumber with extra parameter location.
	* gm2-compiler/M2Options.def: Remove CppProg.
	* gm2-compiler/SymbolTable.mod: Import location_t, TokenToLineNo.
	(MakeConstLit) Pass tok to GetConstLitType and PushString.
	(GetConstLitType) Add tok parameter.  Call DetermineSizeOfConstant
	with location as a parameter.
	* gm2-gcc/m2decl.cc (DetermineSizeOfConstant): Add location
	parameter.  (BuildConstLiteralNumber) Add location parameter.
	(BuildConstLiteralNumber) use error_at with a quoted string.
	* gm2-gcc/m2decl.def (DetermineSizeOfConstant): Add location
	parameter.  (BuildConstLiteralNumber) Add location parameter.
	* gm2-gcc/m2decl.h (DetermineSizeOfConstant): Add location
	parameter.  (BuildConstLiteralNumber) Add location parameter.
	* gm2-gcc/m2expr.cc (interpret_integer): Added space.
	(append_m2_digit) Pass extra parameter needsUnsigned.
	Detect whether the constant will fit if an unsigned int or
	unsigned long int is used.  (interpret_m2_integer)
	extra parameters needsLong and needsUnsigned.  Function rewritten.
	* gm2-gcc/m2expr.h (interpret_m2_integer): Declared with two
	extra parameters; needsLong and needsUnsigned.
	* mc/decl.mod (visitIntrinsicFunction): Refactored case statement.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-09-05 15:41:42 +01:00
Gaius Mulley
65bc1e9925 Merge branch 'master' into devel/modula-2. 2022-09-02 15:04:36 +01:00
Gaius Mulley
06c977f80e Bugfix mc visitIntrinsicFunction rewritten.
Rewritten visitIntrinsicFunction to differentiate
between the different kind of intrinic functions.

gcc/m2/ChangeLog:

	* m2/mc/decl.mod (visitIntrinsicFunction): Rewritten.
	* m2/Make-maintainer.in (m2/boot-bin/mc-devel$(exeext)):
	Use -fuse-list= in place of -fuselist=.
	* m2/mc-boot/GDynamicStrings.c: Rebuilt.
	* m2/mc-boot/GFIO.c: Rebuilt.
	* m2/mc-boot/GIndexing.c: Rebuilt.
	* m2/mc-boot/GM2Dependent.c: Rebuilt.
	* m2/mc-boot/GM2EXCEPTION.c: Rebuilt.
	* m2/mc-boot/GPushBackInput.c: Rebuilt.
	* m2/mc-boot/GRTExceptions.c: Rebuilt.
	* m2/mc-boot/GRTint.c: Rebuilt.
	* m2/mc-boot/GStdIO.c: Rebuilt.
	* m2/mc-boot/GStringConvert.c: Rebuilt.
	* m2/mc-boot/GSysStorage.c: Rebuilt.
	* m2/mc-boot/Gdecl.c: Rebuilt.
	* m2/mc-boot/Gkeyc.c: Rebuilt.
	* m2/mc-boot/GmcComment.c: Rebuilt.
	* m2/mc-boot/GmcComp.c: Rebuilt.
	* m2/mc-boot/GmcDebug.c: Rebuilt.
	* m2/mc-boot/GmcMetaError.c: Rebuilt.
	* m2/mc-boot/GmcStack.c: Rebuilt.
	* m2/mc-boot/Gmcp1.c: Rebuilt.
	* m2/mc-boot/Gmcp2.c: Rebuilt.
	* m2/mc-boot/Gmcp3.c: Rebuilt.
	* m2/mc-boot/Gmcp4.c: Rebuilt.
	* m2/mc-boot/Gmcp5.c: Rebuilt.
	* m2/mc-boot/GnameKey.c: Rebuilt.
	* m2/mc-boot/GsymbolKey.c: Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-09-01 22:20:57 +01:00
Gaius Mulley
3eced900a6 Merge branch 'master' into devel/modula-2. 2022-08-28 18:54:43 +01:00
Gaius Mulley
54111a6d18 Merge branch 'master' into devel/modula-2. 2022-08-25 23:08:31 +01:00
Gaius Mulley
6ed0a391b3 gcc/dwarf2out.cc detect and set language to Modula-2.
Set language to Modula-2 in the debugging output.

gcc/ChangeLog:

	* gcc/dwarf2out.cc (gen_compile_unit_die): Add clause to
	set language to DW_LANG_Modula2 if language_string is
	"GNU Modula-2".

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-08-25 23:07:15 +01:00
Gaius Mulley
846d4284ea Tidy up gcc/m2/Make-lang.in and add pge-push to Make-maintainer.in
gcc/m2/ChangeLog:

	* Make-lang.in: Remove unused declarations.  Change all
	lists to one item per line.  Added comments for each list.
	* Make-maintainer.in: Added comments for each list.
	(pge-push) Added.
	* gm2-compiler/M2Error.mod (AnnounceScope): Remove unused
	variable filename.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-08-24 16:56:08 +01:00
Gaius Mulley
b47bc3ef67 Merge branch 'master' into devel/modula-2. 2022-08-21 23:03:11 +01:00
Gaius Mulley
28be13f565 Added gcc/m2/Make-maintainer.in.
gcc/m2/ChangeLog:

	* Make-maintainer.in: New file.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-08-21 20:14:52 +01:00
Gaius Mulley
03322fa685 Refactor gcc/m2/Make-lang.in and move maintainer rules to gcc/m2/Make-maintainer.in.
Remove unused declarations from gcc/m2/Make-lang.in and use more
generic rules.  Also add C++ version of the parser generator to the source
tree to simplify the bootstrap procedure.  All bnf files are renamed to
match their .mod counterparts and the bnf directory has been removed.

gcc/m2/ChangeLog:

	* Make-lang.in: Usused declarations removed.  Moved maintainer
	rules into Make-maintainer.in.  Added rules to build PGE from C++
	sources for non-maintainer.
	* Make-maintainer.in: New file.
	* config-lang.in (compilers): gm2l Removed. gm2lcc Removed.
	gm2lgen Removed.  gm2lsub Removed.  gm2cc Removed.  gm2lorder
	Removed.
	* configure: Rebuilt.
	* configure.ac: Corrected spelling.  (AR_PATH_PROGS) Removed.
	* gm2-compiler/M2GCCDeclare.mod (PrintNum): Commented out.
	* gm2-compiler/SymbolTable.mod (stop): Removed.
	* gm2config.h.in (AR_PATH): Removed.  (RANLIB_PATH) Removed.
	* pge-boot/GASCII.c: New file.
	* pge-boot/GASCII.h: New file.
	* pge-boot/GArgs.c: New file.
	* pge-boot/GArgs.h: New file.
	* pge-boot/GAssertion.c: New file.
	* pge-boot/GAssertion.h: New file.
	* pge-boot/GBreak.h: New file.
	* pge-boot/GBuiltins.c: New file.
	* pge-boot/GCmdArgs.h: New file.
	* pge-boot/GDebug.c: New file.
	* pge-boot/GDebug.h: New file.
	* pge-boot/GDynamicStrings.c: New file.
	* pge-boot/GDynamicStrings.h: New file.
	* pge-boot/GEnvironment.h: New file.
	* pge-boot/GFIO.c: New file.
	* pge-boot/GFIO.h: New file.
	* pge-boot/GFormatStrings.h: New file.
	* pge-boot/GFpuIO.h: New file.
	* pge-boot/GIO.c: New file.
	* pge-boot/GIO.h: New file.
	* pge-boot/GIndexing.c: New file.
	* pge-boot/GIndexing.h: New file.
	* pge-boot/GLists.c: New file.
	* pge-boot/GLists.h: New file.
	* pge-boot/GM2Dependent.c: New file.
	* pge-boot/GM2Dependent.h: New file.
	* pge-boot/GM2EXCEPTION.c: New file.
	* pge-boot/GM2EXCEPTION.h: New file.
	* pge-boot/GM2LINK.c: New file.
	* pge-boot/GM2LINK.h: New file.
	* pge-boot/GM2RTS.c: New file.
	* pge-boot/GM2RTS.h: New file.
	* pge-boot/GNameKey.c: New file.
	* pge-boot/GNameKey.h: New file.
	* pge-boot/GNumberIO.c: New file.
	* pge-boot/GNumberIO.h: New file.
	* pge-boot/GOutput.c: New file.
	* pge-boot/GOutput.h: New file.
	* pge-boot/GPushBackInput.c: New file.
	* pge-boot/GPushBackInput.h: New file.
	* pge-boot/GRTExceptions.c: New file.
	* pge-boot/GRTExceptions.h: New file.
	* pge-boot/GRTco.c: New file.
	* pge-boot/GSArgs.h: New file.
	* pge-boot/GSEnvironment.h: New file.
	* pge-boot/GSFIO.c: New file.
	* pge-boot/GSFIO.h: New file.
	* pge-boot/GSYSTEM.c: New file.
	* pge-boot/GSYSTEM.h: New file.
	* pge-boot/GScan.h: New file.
	* pge-boot/GSelective.c: New file.
	* pge-boot/GStdIO.c: New file.
	* pge-boot/GStdIO.h: New file.
	* pge-boot/GStorage.c: New file.
	* pge-boot/GStorage.h: New file.
	* pge-boot/GStrCase.c: New file.
	* pge-boot/GStrCase.h: New file.
	* pge-boot/GStrIO.c: New file.
	* pge-boot/GStrIO.h: New file.
	* pge-boot/GStrLib.c: New file.
	* pge-boot/GStrLib.h: New file.
	* pge-boot/GStringConvert.h: New file.
	* pge-boot/GSymbolKey.c: New file.
	* pge-boot/GSymbolKey.h: New file.
	* pge-boot/GSysExceptions.c: New file.
	* pge-boot/GSysExceptions.h: New file.
	* pge-boot/GSysStorage.c: New file.
	* pge-boot/GSysStorage.h: New file.
	* pge-boot/GTimeString.h: New file.
	* pge-boot/GUnixArgs.cc: New file.
	* pge-boot/GUnixArgs.h: New file.
	* pge-boot/Gabort.c: New file.
	* pge-boot/Gbnflex.c: New file.
	* pge-boot/Gbnflex.h: New file.
	* pge-boot/Gcbuiltin.c: New file.
	* pge-boot/Gdtoa.c: New file.
	* pge-boot/Gdtoa.h: New file.
	* pge-boot/Gerrno.c: New file.
	* pge-boot/Gerrno.h: New file.
	* pge-boot/Gldtoa.c: New file.
	* pge-boot/Gldtoa.h: New file.
	* pge-boot/Glibc.c: New file.
	* pge-boot/Glibc.h: New file.
	* pge-boot/Glibm.c: New file.
	* pge-boot/Glibm.h: New file.
	* pge-boot/Gmcrts.c: New file.
	* pge-boot/Gmcrts.h: New file.
	* pge-boot/Gnetwork.h: New file.
	* pge-boot/Gpge.c: New file.
	* pge-boot/Gtermios.cc: New file.
	* pge-boot/Gtermios.h: New file.
	* pge-boot/Gwrapc.c: New file.
	* pge-boot/Gwrapc.h: New file.
	* pge-boot/README: New file.
	* pge-boot/m2rts.h: New file.
	* pge-boot/main.c: New file.
	* pge-boot/network.c: New file.
	* bnf: Removed.
	* bnf/m2.bnf: Moved to gm2-compiler/P0SyntaxCheck.bnf.
	* bnf/m2-1.bnf: Moved to gm2-compiler/P1Build.bnf.
	* bnf/m2-2.bnf: Moved to gm2-compiler/P2Build.bnf.
	* bnf/m2-3.bnf: Moved to gm2-compiler/P3Build.bnf.
	* bnf/m2-h.bnf: Moved to gm2-compiler/PHBuild.bnf.
	* bnf/m2-c.bnf: Moved to gm2-compiler/PCBuild.bnf.
	* bnf/mc-1.bnf: Moved to mc/mcp1.bnf.
	* bnf/mc-2.bnf: Moved to mc/mcp2.bnf.
	* bnf/mc-3.bnf: Moved to mc/mcp3.bnf.
	* bnf/mc-4.bnf: Moved to mc/mcp4.bnf.
	* bnf/mc-5.bnf: Moved to mc/mcp5.bnf.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-08-21 19:59:26 +01:00
Gaius Mulley
ecba4ac821 Merge branch 'master' into devel/modula-2. 2022-08-14 19:17:27 +01:00
Gaius Mulley
627be3b3ac Cleanup revert lang_register_spec_functions in all spec files.
The new Modula-2 linking implementation allows
all patches to other language spec files to be removed.
It also allows all patches to be removed from gcc.cc and gcc.h.
lang_register_spec_functions has been removed from gm2spec.cc.

gcc/ChangeLog:

	* c-family/cppspec.cc: Reverted.
	* cp/g++spec.cc: Reverted.
	* d/d-spec.cc: Reverted.
	* fortran/gfortranspec.cc: Reverted.
	* gcc.cc: Reverted.
	* gcc.h: Reverted.
	* go/gospec.cc: Reverted.
	* jit/jit-spec.cc: Reverted.
	* m2/gm2spec.cc (lang_register_spec_functions): Removed.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-08-14 14:36:00 +01:00
Gaius Mulley
8ee798366e gcc/m2/gm2-gcc/m2configure.h new file.
Add missing file.

gcc/m2/ChangeLog:

	* gm2-gcc/m2configure.h: New file.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-08-14 00:44:00 +01:00
Gaius Mulley
6e8e31eb93 Partial cleanup to implement calling cc1 from within cc1gm2.
A partial cleanup in preparation for removing
lang_register_spec_functions.  Allow the preprocessor to be invoked
from cc1gm2 without passing the path of cc1 though lang-specs.

gcc/m2/ChangeLog:

	* Make-lang.in (GM2_C_OBJS): Added m2/gm2-gcc/m2configure.o.
	(m2/gm2-gcc/m2configure.o) New rule.  (GM2-COMP-BOOT-DEFS)
	Removed M2Configure.mod.  (GM2-GCC-DEFS) Removed M2Configure.def.
	(GM2-COMP-MODS) Removed M2Configure.mod.  (GM2-VERIFY-MODS)
	Removed M2Configure.mod.
	* el/gm2-mode.el (m2-link-command-default): Remove -fonlylink.
	* gm2-compiler/M2AsmUtil.def: Purged all unused declarations.
	* gm2-compiler/M2AsmUtil.mod: Purged all unused declarations.
	* gm2-compiler/M2GCCDeclare.mod (M2Configure): Removed import.
	(PushParametersLeftToRight) Removed asserts.
	* gm2-compiler/M2GenGCC.mod (M2AsmUtil): Removed import.
	* gm2-compiler/M2Options.def (SetB): New procedure.
	(GetB) New procedure function.
	* gm2-compiler/M2Options.mod (SetB): New procedure implemented.
	(GetB) New procedure function implemented.  (CppCommandLine)
	Check CPreProcessor and return NIL if true.  Use FulPathCPP.
	(CppRemember) Remove -fcpp-prog= test.  (Barg) Declared
	and initialized to NIL.
	* gm2-compiler/M2Preprocess.mod: Check result of command
	and return filename if NIL.
	* gm2-compiler/M2Quads.mod (M2Configure): Remove import.
	(PushParametersLeftToRight) Remove all condition tests
	and rewrite to assume left to right parameters.
	* gm2-gcc/m2configure.def: New file (Renamed from
	gm2-compiler/M2Configure.def).
	* gm2-gcc/m2options.h (SetB): New declaration.
	(GetB) New declaration.
	* gm2-lang.cc (gm2_langhook_handle_option): Add OPT_B
	case.  (OPT_fcpp_prog_) Removed.
	* gm2spec.cc (seen_B): Removed.  (B_path) Removed.
	(gen_gm2_libexec) Removed.  (add_exec_dir) Removed.
	(lang_specific_driver) Removed OPT_B case.
	(lang_register_spec_functions) commented out fe_add_spec_function.
	* lang-specs.h (M2CPP): Removed exec_prefix(cc1).
	Pass %{B*} to cc1gm2.
	* lang.opt: Added -B option.   (fcpp-prog=) Removed.
	* gm2-gcc/m2configure.cc: New file.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-08-14 00:10:41 +01:00
Gaius Mulley
352fd437af Partial cleanup for gcc/m2/gm2spec.cc
The code was derived from a mixture of the fortran
and C++ front end spec sources.  This patch removes
comments which are not relevant for Modula-2 and also removes
many ifdef development/test comments.

gcc/m2/ChangeLog:

	* gm2spec.cc: Removed many of the test #ifdef comments and
	rationalized the include files.  (stop) Removed.

libgm2/ChangeLog:

	* libm2iso/Makefile.in: Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-08-13 13:01:30 +01:00
Gaius Mulley
b824d80744 Merge branch 'master' into devel/modula-2. 2022-08-12 09:39:52 +01:00
Gaius Mulley
820fb90479 New regression binary and unary expression failure tests added.
gcc/testsuite/gm2/ChangeLog:

	* errors/fail/binaryconst.mod
	* errors/fail/binarygeneric.mod
	* errors/fail/binarygenericconst.mod
	* errors/fail/unarygeneric.mod

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-08-11 18:24:07 +01:00
Gaius Mulley
06642d296d Improvements to binary and unary expression error messages.
This patch improves binary expression error messages and unary expression
error messages.  The location uses the virtual token created
and the description about the error contains more detail.

gcc/m2/ChangeLog:

	* gm2-compiler/M2GCCDeclare.mod: Corrected spacing.
	* gm2-compiler/M2GenGCC.mod (M2MetaError): Import MetaErrorStringT1.
	(DynamicStrings): Import ConCatChar.  (M2Quads) Import
	GetM2OperatorDesc and GetQuadOp.
	(m2except): Import list inserted identifiers GetM2OperatorDesc and
	GetQuadOp.
	(CodeMakeAdr): Corrected grammer of the error message.
	(FoldMakeAdr): Corrected grammer of the error message.
	(CheckBinaryOperand): New procedure function.
        (BinaryOperands): Rewritten.
	(UnaryOperand): New procedure function.
	(FoldAdd): Corrected spacing.
	(CodeAddChecked): Corrected spacing.
	(CodeAddCheck): Corrected spacing.
	(CodeMult): Corrected spacing.
	(CodeModM2Checked): Corrected spacing.
	(CodeModM2Checked): Corrected spacing.
	(FoldDivM2): Corrected spacing.
	(CodeSetShift): Corrected spacing.
	(FoldSetRotate): Corrected spacing.
	(CodeSetRotate): Corrected spacing.
	(CodeUnaryCheck): Corrected spacing.
	(CodeUnaryCheck): Corrected spacing.
	(CheckReferenced): Improved error message grammar.
	(CodeIfLess): Improved error message grammar.
	(CodeIfGre): Improved error message grammar.
	(CodeIfLessEqu): Improved error message grammar.
	(CodeIfSetEqu): Improved error message grammar.
	* gm2-compiler/M2Quads.def (GetQuadOp): New procedure function
	defined and exported.  (GetM2OperatorDesc) New procedure function
	defined and exported.
	* gm2-compiler/M2Quads.mod (GetQuadOp): New procedure function.
	(GetM2OperatorDesc) New procedure function.
	* gm2-compiler/M2Scope.mod (GetGlobalQuads): Added condition
	for InitStartOp, which fixes an error scope bug when resolving
	constant expressions.
	* gm2-gcc/m2statement.def: Improved comment.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-08-11 18:15:34 +01:00
Gaius Mulley
82bcda7e2a gcc/gcc.cc fix format specifier.
A simple patch to correct a format specifier in the debug routine.

gcc/ChangeLog:

	* gcc.cc (print_option): Replace format specifier %ld with
          %lu.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-08-09 23:36:30 +01:00
Gaius Mulley
1d7705735b Merge branch 'master' into devel/modula-2. 2022-08-08 11:38:49 +01:00
Gaius Mulley
d7183fef74 PR-106443 Fixes for multilib install.
Removed toolexecdir and toolexeclibdir from AM_MAKEFLAGS.

libgm2/ChangeLog:

	* libgm2/Makefile.am (AM_MAKEFLAGS): Remove
	toolexeclibdir and toolexeclib.
	* libgm2/Makefile.in: Rebuilt.
	* libm2cor/Makefile.am (AM_MAKEFLAGS): Remove
	toolexeclibdir and toolexeclib.
	* libm2cor/Makefile.in: Rebuilt.
	* libm2iso/Makefile.am (AM_MAKEFLAGS): Remove
	toolexeclibdir and toolexeclib.
	* libm2iso/Makefile.in: Rebuilt.
	* libm2log/Makefile.am (AM_MAKEFLAGS): Remove
	toolexeclibdir and toolexeclib.
	* libm2log/Makefile.in: Rebuilt.
	* libm2min/Makefile.am (AM_MAKEFLAGS): Remove
	toolexeclibdir and toolexeclib.
	* libm2min/Makefile.in: Rebuilt.
	* libm2pim/Makefile.am (AM_MAKEFLAGS): Remove
	toolexeclibdir and toolexeclib.
	* libm2pim/Makefile.in: Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-08-07 23:05:22 +01:00
Gaius Mulley
c560f1cecb Rebuilt autoconf files using gnu automake-1.15.1.
ChangeLog:

	* Makefile.in : Rebuilt.

libgm2/ChangeLog:

	* libgm2/Makefile.in : Rebuilt.
	* libgm2/aclocal.m4: Rebuilt.
	* libgm2/configure : Rebuilt.
	* libm2cor/Makefile.in : Rebuilt.
	* libm2iso/Makefile.in : Rebuilt.
	* libm2log/Makefile.in : Rebuilt.
	* libm2min/Makefile.in : Rebuilt.
	* libm2pim/Makefile.in : Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-08-04 16:35:06 +01:00
Gaius Mulley
a3192a7ec4 Shared library scaffold fixes.
These changes allow the module scaffold to be activated from within
a shared library as a ctor.  The changes also correct the dtor names of
wrapsock.c, wraptime.c, Selective.cc and wrapc.c.

ChangeLog:

	* Makefile.tpl (BUILD_EXPORTS): GM2FLAGS added.

gcc/m2/ChangeLog:

	* gm2-compiler/M2Graph.mod (Graph): Tidied up indent.
	(KillNode) Assign deps to result of KillIndex.
	* gm2-compiler/M2Options.def (GetUseList): Spelling corrected.
	(SharedFlag) exported.  (SetShared) New procedure.
	* gm2-compiler/M2Options.mod (SetShared): New procedure.
	(SharedFlag) Assigned to FALSE.
	* gm2-compiler/M2Scaffold.mod (SafeRequestSym): New procedure.
	(BuildM2MainFunction) Use SharedFlag to determine whether to
	generate main and if not produce ctors for the shared library.
	Use SafeRequest to access argc, argv, envp parameters.
	* gm2-compiler/M2Quads.mod (SymbolTable): Import list inserted
	identifiers IsCtor, IsExtern and IsPublic.
	(DisplayProcedureAttributes) New procedure.
	(BuildM2InitFunction): Use SafeRequest to access argc, argv,
	envp parameters.  (BuildM2FiniFunction): Use SafeRequest to
	access argc, argv, envp parameters.
	* gm2-gcc/m2options.h: (SetShared): New function.
	* gm2-lang.cc (gm2_langhook_handle_option): Call SetShared.

libgm2/ChangeLog:

	* libm2iso/wrapsock.c: Replaced _finish with _fini.
	* libm2iso/wraptime.c: Replaced _finish with _fini.
	* libm2pim/Selective.cc: Replaced _finish with _fini.
	* libm2pim/wrapc.c: Replaced _finish with _fini.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-08-02 20:27:11 +01:00
Gaius Mulley
8ea7cdc1d0 Merge branch 'master' into devel/modula-2. 2022-07-29 14:28:33 +01:00
Gaius Mulley
9fb8757161 Topological sort implemented for -fscaffold-static.
This patch implements the compile time topological sort for resolving the
module initialization order should -fscaffold-static be used.  It also fixes
some library bugs (_finish renamed _fini).  The autoconf files were
rebuilt using gnu autoconf-269.  Application link tests have been added.

ChangeLog:

	* Makefile.in : Rebuilt.
	* configure : Rebuilt.

gcc/m2/ChangeLog:

	* Make-lang.in (GM2-COMP-BOOT-DEFS): M2Graph.def added.
	(GM2-COMP-BOOT-MODS) M2Graph.mod added.
	(GM2-COMP-DEFS): M2Graph.def added.  (GM2-COMP-MODS) M2Graph.mod
	added.
	* gm2-compiler/M2Scaffold.mod (SymbolTable): Import identifiers
	IsImport, IsImportStatement, GetModuleDefImportStatementList,
	GetModuleModImportStatementList, GetImportModule and
	GetImportStatementList.  (Lists) Import KillList, IsItemInList.
	(addDependentStatement) New procedure.  (addDependentImport) New
	procedure.  (TopologicallySortList) New procedure function.
	(AddEntry) Only add name to ctorGlobals if ctorGlobals is non NIL.
	(AddModuleToCtor) Check that the module is not a DEFINITION FOR
	"C".  (WriteList) Renamed from WriteCtorList and pass list as a
	parameter.  (CreateCtorListFromImports) Extended to topologically
	sort the import dependency graph.
	* gm2-compiler/SymbolTable.mod: Corrected indentation.
	* mc/keyc.mod: Add "public" as a variable name to avoid.
	* gm2-compiler/M2Graph.def: New file.
	* gm2-compiler/M2Graph.mod: New file.

libgm2/ChangeLog:

	* Makefile.in: Rebuilt.
	* aclocal.m4: Rebuilt.
	* configure: Rebuilt.
	* libm2cor/Makefile.in: Rebuilt.
	* libm2iso/Makefile.in: Rebuilt.
	* libm2log/Makefile.in: Rebuilt.
	* libm2min/Makefile.in: Rebuilt.
	* libm2pim/Makefile.in: Rebuilt.
	* libm2pim/UnixArgs.cc: Replaced _finish with _fini.
	* libm2pim/dtoa.cc: Replaced _finish with _fini.
	* libm2pim/ldtoa.cc: Replaced _finish with _fini.

gcc/testsuite/gm2/ChangeLog:

	* projects/log/run/pass/hello/projects-log-run-pass-hello.exp: New file.
	* projects/log/run/pass/hello/hello.mod: New file.
	* projects/README: New file.
	* projects/iso/run/pass/hello/projects-iso-run-pass-hello.exp: New file.
	* projects/iso/run/pass/hello/hello.mod: New file.
	* projects/iso/run/pass/halma/halma.mod: New file.
	* projects/iso/run/pass/halma/projects-iso-run-pass-halma.exp: New file.
	* projects/pim/run/pass/hello/projects-pim-run-pass-hello.exp: New file.
	* projects/pim/run/pass/hello/hello.mod: New file.
	* projects/pim/run/pass/random/MakeBoxes.def: New file.
	* projects/pim/run/pass/random/AdvMap.def: New file.
	* projects/pim/run/pass/random/MakeBoxes.mod: New file.
	* projects/pim/run/pass/random/WriteMap.def: New file.
	* projects/pim/run/pass/random/Map.mod: New file.
	* projects/pim/run/pass/random/StoreCoords.mod: New file.
	* projects/pim/run/pass/random/Chance.mod: New file.
	* projects/pim/run/pass/random/MapOptions.mod: New file.
	* projects/pim/run/pass/random/Options.mod: New file.
	* projects/pim/run/pass/random/BoxMap.def: New file.
	* projects/pim/run/pass/random/StoreCoords.def: New file.
	* projects/pim/run/pass/random/MapOptions.def: New file.
	* projects/pim/run/pass/random/Options.def: New file.
	* projects/pim/run/pass/random/Chance.def: New file.
	* projects/pim/run/pass/random/projects-pim-run-pass-random.exp:
	New file.
	* projects/pim/run/pass/random/RoomMap.def: New file.
	* projects/pim/run/pass/random/WriteMap.mod: New file.
	* projects/pim/run/pass/random/Geometry.def: New file.
	* projects/pim/run/pass/random/AdvMap.mod: New file.
	* projects/pim/run/pass/random/RoomMap.mod: New file.
	* projects/pim/run/pass/random/Geometry.mod: New file.
	* projects/pim/run/pass/random/BoxMap.mod: New file.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-29 11:41:17 +01:00
Gaius Mulley
36e6b503bc gm2tools removed.
This patch removes the top level gm2tools and associated
source files in gcc/m2/gm2-compiler and gcc/m2/bnf.

ChangeLog:

	* Makefile.def: Remove all references to gm2tools.
	* Makefile.tpl (local-distclean): Remove gm2tools.
	* gm2tools: Removed.

gcc/m2/ChangeLog:

	* Make-lang.in: Remove references and rules for M2Depth.
	Remove references and rules for gm2l.bnf gm2m.bnf.
	(GM2_LINK_TOOLS) Removed.  (GM2_LINK_TOOLS_BOOT)
	Removed.  (gm2lcc) Rule removed.  (gm2l) Rule removed.
	(gm2lgen) Rule removed.  (gm2lorder) Removed.  (gm2m)
	Rule removed.  (GM2-COMP-BOOT-DEFS) Removed M2Depth.def.
	(GM2-COMP-BOOT-MODS) Removed M2Depth.mod, gm2lgen.mod, gm2lcc.mod
	and gm2lorder.mod.  (GM2-VERIFY-MODS) Removed M2Depth.def.
	(GM2-COMP-BOOT-MODS) Removed M2Depth.mod, gm2lgen.mod, gm2lcc.mod
	and gm2lorder.mod.  (GM2-TOOLS-MOD) Removed M2Depth.def.
	(GM2-COMP-BOOT-MODS) Removed M2Depth.mod, gm2lgen.mod, gm2lcc.mod
	and gm2lorder.mod.  (GM2-VERIFY-AUTO) Removed gm2l.mod and
	gm2m.mod.  Removed rules for building object to the sources above.
	* bnf/gm2m.bnf: Removed.
	* bnf/gm2l.bnf: Removed.
	* gm2-compiler/M2Depth.def: Removed.
	* gm2-compiler/M2Depth.mod: Removed.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-26 16:36:23 +01:00
Gaius Mulley
e5fc377213 Merge branch 'master' into devel/modula-2. 2022-07-25 23:45:13 +01:00
Gaius Mulley
c497ca7343 libgm2/libm2cor/KeyboardLEDs.cc added
Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-24 23:48:32 +01:00
Gaius Mulley
57900dd7f9 Integration of gm2l into cc1gm2 and a rewrite of gm2spec.cc.
This patch integrates the functionality of the gm2l tool into cc1gm2.
The gm2 driver has been rewritten.  New small project tests have
been added to the testsuite to ensure that ISO and PIM linking works.

gcc/ChangeLog:

	* doc/gm2.texi (-fuselist): Removed option.  (-fuse-list=) New
	option.  (-Wstudents) Replaced by (-Wstyle).
	(-Wpedantic-param-names) improved explaination.  (-Wpedantic-cast)
	improved explaination.  (Linking) New node.
	* gcc/gcc.cc (print_option): Removed line break after printing
	errors.

gcc/m2/ChangeLog:

	* m2/Make-lang.in (m2/gm2-compiler/m2flex.c): Add
	insn-attr-common.h as a dependent.
	* bnf/m2-3.bnf (ProgramModule): Correct token location.
	(ImplementationModule) Correct token location.
	* bnf/m2.bnf (DefinitionModule): RegisterDefinitionModule
	is now called with parameter forC.
	* gm2-compiler/M2Base.mod (SymbolTable): Import list inserted identifier
	PutModuleBuiltin.  (InitBase) _BaseTypes now recorded as a builtin
	module.  Spelling changes and formatting changes.
	* gm2-compiler/M2Batch.def (GetModuleNo): Renamed parameter n to
	nth.
	* gm2-compiler/M2Batch.mod (GetModuleNo): Renamed parameter n to
	nth.  Renamed DoneQueue to SeenList.
	* gm2-compiler/M2Code.mod (M2Options): Import list replaced identifiers
	StudentChecking with StyleChecking.
	* gm2-compiler/M2Comp.mod (M2Options): Import list added identifier
	GenModuleList.  (SymbolTable) Import PutModLink, IsDefLink,
	IsModLink.  Added descriptive text "(for C)" and "(linking)" when
	a module is parsed.  Record modules only parsed to obtain module
	dependencies using PutModLink.
	* gm2-compiler/M2GCCDeclare.mod (SymbolTable): Import list replaced
	identifiers IsCtor, IsExtern and IsPublic.
	(DeclareProcedureToGccSeparateProgram) Add IsExtern.
	(PrintScope) Improved information about the scope.
	* gm2-compiler/M2GenGCC.mod:  Corrected indent for trace print.
	* gm2-compiler/M2Options.def: Export list replaced
	identifiers SetStudents with SetStyle.  Added GetUselistFilename,
	StudentChecking, StyleChecking, GetRuntimeModuleOverride,
	GenModuleList, GetGenModuleFilename and	SetGenModuleList.
	* gm2-compiler/M2Options.mod (DynamicStrings): Import list inserted
	identifiers GenModuleListFilename, GenModuleListFlag and
	UselistFlag.  (SetUselist) Extra parameter value.
	(GetUselist) return UselistFlag.  (GetUselistFilename)
	Return UselistFilename.  Replace Students with Style.
	(SetGenModuleList) New procedure.  (GetGenModuleFilename)
	New procedure.
	* gm2-compiler/M2Quads.mod (BuildM2LinkFunction): Rewritten.
	* gm2-compiler/M2Scaffold.def (ctorArray): Declared.
	* gm2-compiler/M2Scaffold.mod (SymbolTable): Import list added
	identifiers ForeachModuleDo, IsDefImp, IsDefinitionForC, IsModule and
	IsModuleBuiltin.  (AddEntry) New procedure.  (AddModuleToCtor)
	New procedure.  (WriteCtorList) New procedure.
	(CreateCtorListFromImports) New procedure.  (CreateCtorList)
	New procedure.  (DeclareScaffoldFunctions) Add warning note
	if attempting to use dynamic linking without a module ctor list.
	* gm2-compiler/M2Students.mod (M2Options): Replaced Students with
	Style.
	* gm2-compiler/P0SymBuild.def (RegisterDefinitionModule): Added
	parameter forC.
	* gm2-compiler/P0SymBuild.mod: Import list includes
	PutDefinitionForC.  (RegisterDefinitionModule) Added
	parameter forC and implemented by calling PutDefinitionForC.
	* gm2-compiler/SymbolTable.def: Import list added identifiers
	PutDefLink, PutModLink, PutModuleBuiltin, IsDefLink, IsModLink and
	IsModuleBuiltin.
	* gm2-compiler/SymbolTable.mod (PutDefLink): New procedure.
	(PutModLink) New procedure.  (PutModuleBuiltin) New procedure.
	(IsDefLink) New procedure function.  (IsModLink) New procedure function.
	and (IsModuleBuiltin) New procedure function.  New field for
	Module and DefImp to determine if the module was necessary for
	linking only.
	* gcc-gm2/m2options.h (SetUselist): Added parameter.  Replace
	Students with Style.  (SetGenModuleList) New procedure.
	* gm2-lang.cc (gm2_langhook_handle_option): Added
	fgen_module_list.  Replaced students with style.  fuselist changed
	to fuselist=_.  fno-pthread changed to fpthread.
	* gm2-libs-iso/COROUTINES.mod: Corrected comment by removing libpth.
	(localInit) call Init.
	* gm2-libs-iso/RTentity.mod: Introduced many asserts.
	(Initialize) New boolean.
	* gm2-libs-iso/Storage.mod (Initialize): New boolean.  All
	exported procedures check Initialize and call Init if required.
	* gm2-libs/COROUTINES.def: Added FOR "C".
	* gm2-libs/M2Dependent.mod (ForceDependencies): Set forced
	to TRUE.
	* gm2spec.cc: Rewritten heavily using the fortran and c++ spec
	code.
	* tools-src/makeSystem: Add ${MINIMAL} to the flags list.

gcc/testsuite/gm2/ChangeLog:

	* calling-c/datatypes/unbounded/run/pass/calling-c-datatypes-unbounded-run-pass.exp:
	Use new library abbreviations and gm2_link_lib.
	* calling-c/datatypes/unbounded/run/pass/m.mod: Use new library
	abbreviations and gm2_link_lib.
	* complex/run/pass/complex-run-pass.exp: Use new library
	abbreviations and gm2_link_lib.
	* complex/run/pass/main.c: Use new library abbreviations and
	gm2_link_lib.
	* coroutines/pim/run/pass/coroutines-pim-run-pass.exp: Use new
	library abbreviations and gm2_link_lib.
	* examples/callingC/run/pass/examples-callingC-run-pass.exp: Use
	new library abbreviations and gm2_link_lib.
	* exceptions/run/pass/cpp.cpp: Use new library abbreviations and
	gm2_link_lib.
	* exceptions/run/pass/exceptions-run-pass.exp: Use new library
	abbreviations and gm2_link_lib.
	* exceptions/run/pass/m2test.mod: Use new library abbreviations
	and gm2_link_lib.
	* exceptions/run/pass/mycpp.cpp: Use new library abbreviations and
	gm2_link_lib.
	* extensions/run/pass/extensions-run-pass.exp: Use new library
	abbreviations and gm2_link_lib.
	* imports/run/pass/imports-run-pass.exp: Use new library
	abbreviations and gm2_link_lib.
	* iso/run/pass/iso-run-pass.exp: Use new library abbreviations and
	gm2_link_lib.
	* link/externalscaffold/pass/link-externalscaffold-pass.exp: Use
	new library abbreviations and gm2_link_lib.
	* linking/libarchive/pass/linking-libarchive-pass.exp: Use new
	library abbreviations and gm2_link_lib.
	* pim/no-options/run/pass/pim-no-options-run-pass.exp: Use new
	library abbreviations and gm2_link_lib.
	* pim/options/optimize/run/pass/pim-options-optimize-run-pass.exp:
	Use new library abbreviations and gm2_link_lib.
	* pim/run/fail/pim-run-fail.exp: Use new library abbreviations and
	gm2_link_lib.
	* pim/run/pass/pim-run-pass.exp: Use new library abbreviations and
	gm2_link_lib.
	* pimcoroutines/run/pass/pimcoroutines-run-pass.exp: Use new
	library abbreviations and gm2_link_lib.
	* pimlib/logitech/run/pass/pimlib-logitech-run-pass.exp: Use new
	library abbreviations and gm2_link_lib.
	* pimlib/run/pass/pimlib-run-pass.exp: Use new library
	abbreviations and gm2_link_lib.
	* projects/README: (New file).
	* projects/iso/run/pass/halma/halma.mod: (New file).
	* projects/iso/run/pass/halma/projects-iso-run-pass-halma.exp:
	(New file).
	* projects/iso/run/pass/hello/hello.mod: (New file).
	* projects/iso/run/pass/hello/projects-iso-run-pass-hello.exp:
	(New file).
	* projects/log/run/pass/hello/hello.mod: (New file).
	* projects/log/run/pass/hello/projects-log-run-pass-hello.exp:
	(New file).
	* testsuite/gm2/projects/pim/run/pass/hello/hello.mod: (New file).
	* testsuite/gm2/projects/pim/run/pass/hello/projects-pim-run-pass-hello.exp:
	(New file).
	* projects/pim/run/pass/random/AdvMap.def: (New file).
	* projects/pim/run/pass/random/AdvMap.mod: (New file).
	* projects/pim/run/pass/random/BoxMap.def: (New file).
	* projects/pim/run/pass/random/BoxMap.mod: (New file).
	* projects/pim/run/pass/random/Chance.def: (New file).
	* projects/pim/run/pass/random/Chance.mod: (New file).
	* projects/pim/run/pass/random/Geometry.def: (New file).
	* projects/pim/run/pass/random/Geometry.mod: (New file).
	* projects/pim/run/pass/random/MakeBoxes.def: (New file).
	* projects/pim/run/pass/random/MakeBoxes.mod: (New file).
	* projects/pim/run/pass/random/Map.mod: (New file).
	* projects/pim/run/pass/random/MapOptions.def: (New file).
	* projects/pim/run/pass/random/MapOptions.mod: (New file).
	* projects/pim/run/pass/random/Options.def: (New file).
	* projects/pim/run/pass/random/Options.mod: (New file).
	* projects/pim/run/pass/random/RoomMap.def: (New file).
	* projects/pim/run/pass/random/RoomMap.mod: (New file).
	* projects/pim/run/pass/random/StoreCoords.def: (New file).
	* projects/pim/run/pass/random/StoreCoords.mod: (New file).
	* projects/pim/run/pass/random/WriteMap.def: (New file).
	* projects/pim/run/pass/random/WriteMap.mod: (New file).
	* sets/run/pass/sets-run-pass.exp: Use new library abbreviations
	and gm2_link_lib.
	* switches/check-all/run/fail/switches-check-all-run-fail.exp: Use
	new library abbreviations and gm2_link_lib.
	* switches/none/run/pass/gm2-none.exp: Use new library
	abbreviations and gm2_link_lib.
	* switches/optimization/run/pass/switches-optimization-run-pass.exp:
	Use new library abbreviations and gm2_link_lib.
	* switches/pic/run/pass/switches-pic-run-pass.exp: Use new library
	abbreviations and gm2_link_lib.
	* switches/pim3/run/pass/switches-pim3-run-pass.exp: Use new
	library abbreviations and gm2_link_lib.
	* switches/pim4/run/pass/switches-pim4-run-pass.exp: Use new
	library abbreviations and gm2_link_lib.
	* switches/whole-program/pass/run/switches-whole-program-pass-run.exp:
	Use new library abbreviations and gm2_link_lib.
	* types/run/pass/types-run-pass.exp: Use new library abbreviations
	and gm2_link_lib.

gcc/testsuite/ChangeLog:

	* testsuite/lib/gm2-simple.exp: Use new library abbreviations and
	gm2_link_lib.
	* testsuite/lib/gm2-torture.exp: Use new library abbreviations and
	gm2_link_lib.
	* testsuite/lib/gm2.exp: Use new library abbreviations and
	gm2_link_lib.

libgm2/ChangeLog:

	* libm2cor/KeyBoardLEDs.cc: Add ctor.  Change parameters for init
	and finish to int, char *[], char *[].
	* libm2cor/Makefile.am: Add rules to compile .cc files.
	* libm2iso/Makefile.am: Install m2rts.h.
	* libm2iso/RTco.cc: Corrected spacing.
	* libm2pim/Makefile.am (M2MODS): Remove COROUTINES.mod.
	* libm2pim/cgetopt.cc: Added ctor/dep/init/finish functions.
	Ensure all external functions are extern "C".
	* libm2pim/wrapc.c (_M2_wrap_ctor): Added.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-24 21:30:49 +01:00
Gaius Mulley
c9642b5a67 dtoa replace index, m2rts export fixes.
This patch replaces the libc index call with strchr.  It also
defines RegisterModule and RequestDependant in the definition
module M2RTS.def for the minimal library.  Finally it regenerates
the Makefile.in's in the libgm2 directories and at the root.

2022-07-12   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

ChangeLog:

	* Makefile.in: Regenerated.

gm2tools/ChangeLog:

	* Makefile.in: Regenerated.

libgm2/ChangeLog:

	* Makefile.in: Regenerated.
	* libm2iso/Makefile.in: Regenerated.
	* libm2log/Makefile.in: Regenerated.
	* libm2min/Makefile.in: Regenerated.
	* libm2pim/Makefile.in: Regenerated.
	* libm2pim/dtoa.cc: Replace index with strchr.

gcc/m2/ChangeLog:

	* gm2-libs-min/M2RTS.def (RegisterModule): Added.
	(RequestDependant) Added.  (ArgCVEnvP) Added.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-12 13:15:03 +01:00
Gaius Mulley
f55158f3ef Add insn-attr-common.h as a dependant to gm2spec.cc.
gcc/m2/ChangeLog:

	* Make-lang.in (gm2spec.o): Add insn-attr-common.h as
	a dependant.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-12 00:15:20 +01:00
Gaius Mulley
0c69befbfe Merge branch 'master' into devel/modula-2.
Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-12 00:12:51 +01:00
Gaius Mulley
5916ce2dac M2Quads.mod format specifier fix.
gcc/m2/ChangeLog:

	* gm2-compiler/M2Quads.mod (GetQualidentImport):
	Removed parenthesis to fix format specifier.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-11 15:23:20 +01:00
Gaius Mulley
90b9a1e447 gm2-libs-min/M2RTS.mod populated with stub support procedures.
gcc/m2/ChangeLog:

	* gm2-compiler/M2MetaError.def (MetaErrorNT0): New procedure.
	(MetaErrorNT1) Renamed parameters.  (MetaErrorNT2) Renamed
	parameters.
	* gm2-compiler/M2MetaError.mod (MetaErrorNT0): New procedure
	implemented.  (MetaErrorNT1) Renamed parameters.  (MetaErrorNT2)
	Renamed parameters.
	* gm2-compiler/M2Quads.mod (BuildAdrFunction): Use MetaErrorNT0.
	(GetQualidentImport) Correct format specifier.
	* gm2-libs-min/M2RTS.mod (RequestDependant): New procedure stub
	added.  (ConstructModules) New procedure stub added.
	(Deconstructmodules) New procedure stub added.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-11 15:05:54 +01:00
Gaius Mulley
dcc8de83f4 Added untracked files after manual merge with master.
* contrib/unicode/DerivedCoreProperties.txt (Added).
      * contrib/unicode/DerivedNormalizationProps.txt (Added).
      * gcc/ada/libgnat/a-cfinse.adb (Added).
      * gcc/ada/libgnat/a-cfinse.ads (Added).
      * gcc/analyzer/inlining-iterator.h (Added).
      * gcc/analyzer/sm-fd.cc (Added).
      * gcc/testsuite/c-c++-common/gomp/linear-4.c (Added).
      * gcc/testsuite/c-c++-common/gomp/target-data-2.c (Added).
      * gcc/testsuite/c-c++-common/gomp/target-data-3.c (Added).
      * gcc/testsuite/c-c++-common/pr105998.c (Added).
      * gcc/testsuite/g++.dg/cpp0x/constexpr-elision1.C (Added).
      * gcc/testsuite/g++.dg/cpp0x/decltype82a.C (Added).
      * gcc/testsuite/g++.dg/cpp0x/initlist130.C (Added).
      * gcc/testsuite/g++.dg/cpp0x/keywords1.C (Added).
      * gcc/testsuite/g++.dg/cpp0x/trailing16.C (Added).
      * gcc/testsuite/g++.dg/cpp1y/constexpr-elision1.C (Added).
      * gcc/testsuite/g++.dg/cpp1z/class-deduction111.C (Added).
      * gcc/testsuite/g++.dg/cpp1z/constexpr-if37.C (Added).
      * gcc/testsuite/g++.dg/cpp1z/constexpr-if38.C (Added).
      * gcc/testsuite/g++.dg/cpp1z/nontype-auto21.C (Added).
      * gcc/testsuite/g++.dg/cpp2a/desig26.C (Added).
      * gcc/testsuite/g++.dg/cpp2a/keywords1.C (Added).
      * gcc/testsuite/g++.dg/cpp2a/lambda-generic10.C (Added).
      * gcc/testsuite/g++.dg/ext/builtin-shufflevector-4.C (Added).
      * gcc/testsuite/g++.dg/modules/init-2_d.C (Added).
      * gcc/testsuite/g++.dg/modules/init-3_a.C (Added).
      * gcc/testsuite/g++.dg/modules/init-3_b.C (Added).
      * gcc/testsuite/g++.dg/modules/init-3_c.C (Added).
      * gcc/testsuite/g++.dg/modules/loc-prune-1.C (Added).
      * gcc/testsuite/g++.dg/modules/loc-prune-2.C (Added).
      * gcc/testsuite/g++.dg/modules/loc-prune-3.C (Added).
      * gcc/testsuite/g++.dg/modules/loc-prune-4.C (Added).
      * gcc/testsuite/g++.dg/template/operator16.C (Added).
      * gcc/testsuite/g++.dg/torture/except-1.C (Added).
      * gcc/testsuite/g++.dg/torture/pr106131.C (Added).
      * gcc/testsuite/g++.dg/ubsan/return-8.C (Added).
      * gcc/testsuite/g++.dg/ubsan/return-8a.C (Added).
      * gcc/testsuite/g++.dg/ubsan/return-8b.C (Added).
      * gcc/testsuite/g++.dg/ubsan/return-8d.C (Added).
      * gcc/testsuite/g++.dg/ubsan/return-8e.C (Added).
      * gcc/testsuite/g++.dg/warn/Wformat-char8_t-1.C (Added).
      * gcc/testsuite/g++.dg/warn/Woverloaded-virt1.C (Added).
      * gcc/testsuite/g++.dg/warn/Woverloaded-virt2.C (Added).
      * gcc/testsuite/g++.dg/warn/Wuse-after-free5.C (Added).
      * gcc/testsuite/g++.target/i386/pr105953.C (Added).
      * gcc/testsuite/g++.target/loongarch/loongarch.exp (Added).
      * gcc/testsuite/g++.target/loongarch/pr106096.C (Added).
      * gcc/testsuite/gcc.c-torture/compile/pr106030.c (Added).
      * gcc/testsuite/gcc.c-torture/execute/pr105984.c (Added).
      * gcc/testsuite/gcc.c-torture/execute/pr106032.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/allocation-size-1.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/allocation-size-2.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/allocation-size-3.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/allocation-size-4.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/allocation-size-5.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/fd-1.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/fd-2.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/fd-3.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/fd-4.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-1-multiline.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-1-no-undo.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-1.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-2-multiline.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-2.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-3-multiline.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-3.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-4-multiline.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-4.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-5-multiline.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-5.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-6-multiline.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-6.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-7-multiline.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/inlining-7.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/torture/uninit-pr106204.c (Added).
      * gcc/testsuite/gcc.dg/analyzer/uninit-pr106204.c (Added).
      * gcc/testsuite/gcc.dg/builtin-object-size-22.c (Added).
      * gcc/testsuite/gcc.dg/fold-convlshift-4.c (Added).
      * gcc/testsuite/gcc.dg/graphite/pr106055.c (Added).
      * gcc/testsuite/gcc.dg/instrument-4.c (Added).
      * gcc/testsuite/gcc.dg/ipa/pr105739.c (Added).
      * gcc/testsuite/gcc.dg/pr105835.c (Added).
      * gcc/testsuite/gcc.dg/pr105911.c (Added).
      * gcc/testsuite/gcc.dg/pr105969.c (Added).
      * gcc/testsuite/gcc.dg/pr106027.c (Added).
      * gcc/testsuite/gcc.dg/pr106114.c (Added).
      * gcc/testsuite/gcc.dg/pr106198.c (Added).
      * gcc/testsuite/gcc.dg/pr94026.c (Added).
      * gcc/testsuite/gcc.dg/pr94899.c (Added).
      * gcc/testsuite/gcc.dg/torture/pr106070.c (Added).
      * gcc/testsuite/gcc.dg/torture/pr106112.c (Added).
      * gcc/testsuite/gcc.dg/torture/pr106182.c (Added).
      * gcc/testsuite/gcc.dg/torture/pr106196.c (Added).
      * gcc/testsuite/gcc.dg/torture/pr106971.c (Added).
      * gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-13.c (Added).
      * gcc/testsuite/gcc.dg/tree-ssa/if-to-switch-11.c (Added).
      * gcc/testsuite/gcc.dg/tree-ssa/pr105860.c (Added).
      * gcc/testsuite/gcc.dg/tree-ssa/pr105983.c (Added).
      * gcc/testsuite/gcc.dg/tree-ssa/pr106126.c (Added).
      * gcc/testsuite/gcc.dg/vect/bb-slp-pr106019.c (Added).
      * gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr96463-1.c (Added).
      * gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr96463-2.c (Added).
      * gcc/testsuite/gcc.target/aarch64/sve/cost_model_14.c (Added).
      * gcc/testsuite/gcc.target/alpha/pr105209.c (Added).
      * gcc/testsuite/gcc.target/i386/bmi-andn-4.c (Added).
      * gcc/testsuite/gcc.target/i386/pr105927.c (Added).
      * gcc/testsuite/gcc.target/i386/pr105951-1.c (Added).
      * gcc/testsuite/gcc.target/i386/pr105951-2.c (Added).
      * gcc/testsuite/gcc.target/i386/pr105960.c (Added).
      * gcc/testsuite/gcc.target/i386/pr105965.c (Added).
      * gcc/testsuite/gcc.target/i386/pr105970.c (Added).
      * gcc/testsuite/gcc.target/i386/pr105993.c (Added).
      * gcc/testsuite/gcc.target/i386/pr106022-1.c (Added).
      * gcc/testsuite/gcc.target/i386/pr106022-2.c (Added).
      * gcc/testsuite/gcc.target/i386/pr106022-3.c (Added).
      * gcc/testsuite/gcc.target/i386/pr106022-4.c (Added).
      * gcc/testsuite/gcc.target/i386/pr106053.c (Added).
      * gcc/testsuite/gcc.target/i386/pr106095.c (Added).
      * gcc/testsuite/gcc.target/i386/pr106122.c (Added).
      * gcc/testsuite/gcc.target/i386/pr43618-1.c (Added).
      * gcc/testsuite/gcc.target/i386/pr53533-1.c (Added).
      * gcc/testsuite/gcc.target/i386/pr53533-2.c (Added).
      * gcc/testsuite/gcc.target/i386/pr53533-3.c (Added).
      * gcc/testsuite/gcc.target/i386/pr53533-4.c (Added).
      * gcc/testsuite/gcc.target/i386/pr53533-5.c (Added).
      * gcc/testsuite/gcc.target/i386/pr7061-1.c (Added).
      * gcc/testsuite/gcc.target/i386/pr7061-2.c (Added).
      * gcc/testsuite/gcc.target/i386/ssse3-palignr-2.c (Added).
      * gcc/testsuite/gcc.target/i386/testnot-3.c (Added).
      * gcc/testsuite/gcc.target/i386/xchg-3.c (Added).
      * gcc/testsuite/gcc.target/powerpc/fold-vec-cmp-int128.c (Added).
      * gcc/testsuite/gcc.target/powerpc/pr103316.c (Added).
      * gcc/testsuite/gcc.target/powerpc/pr105041.c (Added).
      * gcc/testsuite/gcc.target/powerpc/pr105991.c (Added).
      * gcc/testsuite/gcc.target/riscv/zba-shadd.c (Added).
      * gcc/testsuite/gcc.target/xtensa/BALL-BNALL.c (Added).
      * gcc/testsuite/gcc.target/xtensa/constsynth_2insns.c (Added).
      * gcc/testsuite/gcc.target/xtensa/constsynth_3insns.c (Added).
      * gcc/testsuite/gcc.target/xtensa/constsynth_double.c (Added).
      * gcc/testsuite/gcc.target/xtensa/funnel_shifter.c (Added).
      * gcc/testsuite/gcc.target/xtensa/sibcalls.c (Added).
      * gcc/testsuite/gdc.dg/Wbuiltin_declaration_mismatch1.d (Added).
      * gcc/testsuite/gdc.dg/Wbuiltin_declaration_mismatch2.d (Added).
      * gcc/testsuite/gdc.dg/Wpadded.d (Added).
      * gcc/testsuite/gdc.dg/asan/attr_no_sanitize1.d (Added).
      * gcc/testsuite/gdc.dg/attr_register1.d (Added).
      * gcc/testsuite/gdc.dg/attr_register2.d (Added).
      * gcc/testsuite/gdc.dg/attr_register3.d (Added).
      * gcc/testsuite/gdc.dg/attr_simd1.d (Added).
      * gcc/testsuite/gdc.dg/attr_simd2.d (Added).
      * gcc/testsuite/gdc.dg/attr_visibility1.d (Added).
      * gcc/testsuite/gdc.dg/attr_visibility2.d (Added).
      * gcc/testsuite/gdc.dg/attr_visibility3.d (Added).
      * gcc/testsuite/gdc.dg/builtins.d (Added).
      * gcc/testsuite/gdc.dg/pr106139a.d (Added).
      * gcc/testsuite/gdc.dg/pr106139b.d (Added).
      * gcc/testsuite/gdc.dg/pr106139c.d (Added).
      * gcc/testsuite/gdc.dg/pr106139d.d (Added).
      * gcc/testsuite/gdc.dg/rtti1.d (Added).
      * gcc/testsuite/gdc.dg/torture/simd_blendvector.d (Added).
      * gcc/testsuite/gdc.dg/torture/simd_cond.d (Added).
      * gcc/testsuite/gdc.dg/torture/simd_convertvector.d (Added).
      * gcc/testsuite/gdc.dg/torture/simd_load.d (Added).
      * gcc/testsuite/gdc.dg/torture/simd_logical.d (Added).
      * gcc/testsuite/gdc.dg/torture/simd_shuffle.d (Added).
      * gcc/testsuite/gdc.dg/torture/simd_shufflevector.d (Added).
      * gcc/testsuite/gdc.dg/torture/simd_store.d (Added).
      * gcc/testsuite/gdc.dg/ubsan/attr_no_sanitize2.d (Added).
      * gcc/testsuite/gdc.test/compilable/imports/defines.c (Added).
      * gcc/testsuite/gdc.test/compilable/inliner.d (Added).
      * gcc/testsuite/gdc.test/compilable/inliner2.d (Added).
      * gcc/testsuite/gdc.test/compilable/test22626.d (Added).
      * gcc/testsuite/gdc.test/compilable/test23076.d (Added).
      * gcc/testsuite/gdc.test/compilable/test23142.d (Added).
      * gcc/testsuite/gdc.test/compilable/test23168.d (Added).
      * gcc/testsuite/gdc.test/compilable/test23169.d (Added).
      * gcc/testsuite/gdc.test/compilable/test23174.d (Added).
      * gcc/testsuite/gdc.test/compilable/testdefines.d (Added).
      * gcc/testsuite/gdc.test/fail_compilation/mixin_template.d (Added).
      * gcc/testsuite/gdc.test/fail_compilation/previewin2.d (Added).
      * gcc/testsuite/gdc.test/fail_compilation/template_decl.d (Added).
      * gcc/testsuite/gdc.test/fail_compilation/test21477.d (Added).
      * gcc/testsuite/gdc.test/fail_compilation/test23159.d (Added).
      * gcc/testsuite/gdc.test/fail_compilation/udatypes.d (Added).
      * gcc/testsuite/gdc.test/runnable/inline3.d (Added).
      * gcc/testsuite/gdc.test/runnable/test23010.d (Added).
      * gcc/testsuite/gfortran.dg/check_bits_3.f90 (Added).
      * gcc/testsuite/gfortran.dg/class_73.f90 (Added).
      * gcc/testsuite/gfortran.dg/extends_type_of_4.f90 (Added).
      * gcc/testsuite/gfortran.dg/gomp/linear-2.f90 (Added).
      * gcc/testsuite/gfortran.dg/gomp/linear-3.f90 (Added).
      * gcc/testsuite/gfortran.dg/gomp/linear-4.f90 (Added).
      * gcc/testsuite/gfortran.dg/gomp/linear-5.f90 (Added).
      * gcc/testsuite/gfortran.dg/gomp/linear-6.f90 (Added).
      * gcc/testsuite/gfortran.dg/gomp/linear-7.f90 (Added).
      * gcc/testsuite/gfortran.dg/gomp/linear-8.f90 (Added).
      * gcc/testsuite/gfortran.dg/gomp/target-data-1.f90 (Added).
      * gcc/testsuite/gfortran.dg/gomp/target-data-2.f90 (Added).
      * gcc/testsuite/gfortran.dg/gomp/target-device-ancestor-2a.f90 (Added).
      * gcc/testsuite/gfortran.dg/index_6.f90 (Added).
      * gcc/testsuite/gfortran.dg/pr105954.f90 (Added).
      * gcc/testsuite/gfortran.dg/ubsan/pr106062.f90 (Added).
      * gcc/testsuite/gfortran.dg/unpack_vector_1.f90 (Added).
      * gcc/testsuite/jit.dg/test-pr105812-bool-operations.c (Added).
      * gcc/value-range-storage.cc (Added).
      * gcc/value-range-storage.h (Added).
      * libgomp/testsuite/libgomp.c-c++-common/requires-1-aux.c (Added).
      * libgomp/testsuite/libgomp.c-c++-common/requires-1.c (Added).
      * libgomp/testsuite/libgomp.c-c++-common/requires-2-aux.c (Added).
      * libgomp/testsuite/libgomp.c-c++-common/requires-2.c (Added).
      * libgomp/testsuite/libgomp.c-c++-common/requires-3-aux.c (Added).
      * libgomp/testsuite/libgomp.c-c++-common/requires-3.c (Added).
      * libgomp/testsuite/libgomp.c-c++-common/requires-4-aux.c (Added).
      * libgomp/testsuite/libgomp.c-c++-common/requires-4.c (Added).
      * libgomp/testsuite/libgomp.c-c++-common/requires-5-aux.c (Added).
      * libgomp/testsuite/libgomp.c-c++-common/requires-5.c (Added).
      * libgomp/testsuite/libgomp.c-c++-common/requires-6.c (Added).
      * libgomp/testsuite/libgomp.c-c++-common/requires-7-aux.c (Added).
      * libgomp/testsuite/libgomp.c-c++-common/requires-7.c (Added).
      * libgomp/testsuite/libgomp.c/target-45.c (Added).
      * libgomp/testsuite/libgomp.c/target-46.c (Added).
      * libgomp/testsuite/libgomp.c/target-47.c (Added).
      * libgomp/testsuite/libgomp.fortran/requires-1-aux.f90 (Added).
      * libgomp/testsuite/libgomp.fortran/requires-1.f90 (Added).
      * libphobos/libdruntime/core/sync/package.d (Added).
      * libphobos/libdruntime/gcc/simd.d (Added).
      * libstdc++-v3/testsuite/20_util/allocator/105975.cc (Added).
      * libstdc++-v3/testsuite/21_strings/basic_string/cons/char/105995.cc (Added).
      * libstdc++-v3/testsuite/21_strings/basic_string/operations/compare/char/3.cc (Added).
      * libstdc++-v3/testsuite/23_containers/unordered_map/insert/105717.cc (Added).
      * libstdc++-v3/testsuite/23_containers/unordered_set/insert/105717.cc (Added).
      * libstdc++-v3/testsuite/26_numerics/gcd/105844.cc (Added).
      * libstdc++-v3/testsuite/26_numerics/lcm/105844.cc (Added).
      * libstdc++-v3/testsuite/29_atomics/atomic/lwg3220.cc (Added).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 19:14:12 +01:00
Gaius Mulley
abd47db327 New files for new scaffold linking mechanism.
gcc/m2/ChangeLog:

	* gm2-compiler/M2Scaffold.def (New file).
	* gm2-compiler/M2Scaffold.mod (New file).
	* gm2-libs-ch/M2LINK.c (New file).
	* gm2-libs-ch/UnixArgs.cc (New file).
	* gm2-libs-ch/dtoa.cc (New file).
	* gm2-libs-ch/ldtoa.cc (New file).
	* gm2-libs-ch/m2rts.h (New file).
	* gm2-libs/M2Dependent.def (New file).
	* gm2-libs/M2Dependent.mod (New file).
	* gm2-libs/M2LINK.def (New file).
	* mc-boot-ch/GM2LINK.c (New file).
	* mc-boot-ch/GUnixArgs.cc (New file).
	* mc-boot-ch/Gtermios.cc (New file).
	* mc-boot-ch/m2rts.h (New file).
	* mc-boot/GM2Dependent.c (New file).
	* mc-boot/GM2Dependent.h (New file).
	* mc-boot/GM2LINK.h (New file).

gcc/testsuite/gm2/ChangeLog:

	* gcc/testsuite/gm2/link/externalscaffold/pass/hello.mod (New file).
	* gcc/testsuite/gm2/link/externalscaffold/pass/link-externalscaffold-pass.exp (New file).
	* gcc/testsuite/gm2/link/externalscaffold/pass/scaffold.c (New file).

libgm2/ChangeLog:

	* libgm2/libm2iso/ErrnoCategory.cc (New file).
	* libgm2/libm2iso/RTco.cc (New file).
	* libgm2/libm2iso/m2rts.h (New file).
	* libgm2/libm2pim/Selective.cc (New file).
	* libgm2/libm2pim/SysExceptions.cc (New file).
	* libgm2/libm2pim/UnixArgs.cc (New file).
	* libgm2/libm2pim/dtoa.cc (New file).
	* libgm2/libm2pim/errno.cc (New file).
	* libgm2/libm2pim/ldtoa.cc (New file).
	* libgm2/libm2pim/sckt.cc (New file).
	* libgm2/libm2pim/termios.cc (New file).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 16:11:44 +01:00
Gaius Mulley
6a828f6369 Static scaffold fixes, gm2l tidyup.
This patch fixes many static scaffold bugs and contains
a re-implementation of UnixArgs.cc and termios.cc.  gm2l
contains new options --exlude=, --include= and -flibs=.

2022-07-04  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/ChangeLog:

        * doc/gm2.texi (-fscaffold-c): Removed.  (-fscaffold-c++)
        Removed.  (-fmodules) Removed.  (-fonlylink) Removed.

gcc/m2/ChangLog:

        * Make-lang.in (UnixArgs.o): Use UnixArgs.cc.
        (gm2-pge-boot/Gtermsios.o) Use mc-boot-ch/Gtermios.cc.
        * bnf/gm2l.bnf: Partial re-write and introduced
        --include=, --exclude= and -flibs=.  (AddUserInclude)
        New procedure.  (ScanSources) Remove IncludeM2RTS
        filter.  (MakeModule) Return a boolean if a new module
        is seen.  (source) New field userInclude.
        (source) New field userExclude.  (DisplaySources)
        test for userExclude and userInclude and produce
        appropriate diagnostic.  (DisplayUsage) Remove
        --M2RTS.  Add -flibs=, --include-list= and --exclude-list=.
        (PopulateList) New procedure.  (addInclude) New procedure.
        (SetLibs) New procedure.  (SetExclude) New procedure.
        (ScanArgs) Remove IncludeM2RTS.  Remove --M2RTS.
        Add --include=, --exclude= and -flibs=.  Detect if multiple
        source files are given and detect any unrecognized option.
        * bnf/gm2m.bnf (main): Renamed as mainModule.
        * gm2-compiler/M2Options.mod (SetScaffoldDynamic): Ensure that
        ScaffoldStatic is not also set.  (SetScaffoldStatic) Ensure
        that ScaffoldDynamic is not also set.
        * gm2-compiler/M2Quads.mod (BuildM2FiniFunction):
        Add ForeachModuleCallFinish for the static clause.
        (BuildM2InitFunction) Add ForeachModuleCallInit for the
        static clause.
        * gm2-compiler/M2Scaffold.def (ForeachModuleCallInit):
        New procedure.  (ForeachModuleCallFinish) New Procedure.
        * gm2-compiler/M2Scaffold.mod (ForeachModuleCallInit):
        New procedure implemented.  (ForeachModuleCallFinish) New
        Procedure implemented.  (LookupModuleSym) New procedure.
        (ReadModules) Addition parameter tok and populate
        uselistModules.  (DeclareModuleExtern) Renamed from
        DeclareCtorModuleExtern.
        * gm2-compiler/M2Swig.mod (main): Renamed as mainModule.
        * gm2-compiler/SymbolTable.def (PutModuleCtorExtern): Exported
        and declared.  (MakeModuleCtor) Pass extra boolean public true.
        (InitCtorFields) pub new parameter.  (PutProcedureExternPublic)
        New procedure.  (PutCtorExtern) New procedure.
        (PutModuleCtorExtern) New procedure.
        * gm2-gcc/init.cc: Rewritten to pass envp to call init and fini
        functions.
        * gm2-gcc/m2expr.def: FOR "C" removed.
        * gm2-libs-ch/RTcodummy.c: Undo removal of _init and _finish
        functions.
        * gm2-libs-ch/pthdummy.c (Removed).
        * m2/gm2spec.cc (seen_scaffold_static): New boolean.
        (seen_scaffold_dynamic) New boolean.  (scaffold_static)
        New boolean.  (scaffold_dynamic) New boolean.
        (get_libexec) Removed.  (add_exec_dir) Rewritten comment.
        (lang_specific_driver) Check that dynamic scaffold and static
        scaffold are not both enabled.
        * mc-boot-ch/Gpth.c (Removed).
        * mc-boot-ch/Gtermios.c (Removed).
        * mc-boot-ch/Gtermios.cc (Added).  Converted from Gtermios.c.

gm2tools/ChangeLog:

        * gm2l.1 (--M2RTS) Removed.  (-M2RTS) Removed.  (--include=) Added.
        (--exclude=) Added.  (-flibs=) Added.

libgm2/ChangeLog:

        * libm2iso/ErrnoCategory.cc (_finish): Changed to _fini.
        * libm2iso/RTco.cc (_finish): Changed to _fini.
        * libm2pim/SysExceptions.cc (_finish): Changed to _fini.
        * libm2pim/errno.cc (_finish): Changed to _fini.
        * libm2pim/termios.cc (_finish): Changed to _fini.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 16:06:59 +01:00
Gaius Mulley
f6b11ec15d Testsuite changes reflecting changes to UnixArgs.
This patch changes the tests in the testsuite which refer to UnixArgs.

2022-06-29  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/testsuite/gm2/ChangeLog:

        * link/pimc/pass/testgetopt.mod: Replace ArgC with
        call to GetArgC and replace ArgV with a call to GetArgV.
        * link/pimc/pass/testunixargs.mod: Replace ArgC with
        call to GetArgC and replace ArgV with a call to GetArgV.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 16:06:20 +01:00
Gaius Mulley
d6bbca5ee9 Changes to gcc/m2/Make-lang.in to work with the new renamed files.
2022-06-29  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

        * Make-lang.in (GM2-LIBS-BOOT-C): Remove UnixArgs.c,
        dtoa.c and ldtoa.c.  (GM2-LIBS-BOOT-CC) New definition
        containing UnixArgs.cc, dtoa.cc and ldtoa.cc.
        (GM2-LIBS-C) Remove UnixArgs.c, dtoa.c and ldtoa.c.
        (GM2-LIBS-CC) New definition
        containing UnixArgs.cc, dtoa.cc and ldtoa.cc.
        (MC-INTERFACE-CC) New definition
        containing UnixArgs.cc, dtoa.cc and ldtoa.cc.
        (PPG-INTERFACE-CC) New definition
        containing UnixArgs.cc, dtoa.cc and ldtoa.cc.
        Adapted remaining rules to use above definitions
        and added rules to build from .cc files.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 16:05:39 +01:00
Gaius Mulley
79e5e3fe3d Renamed files from .c to .cc and added new support header files.
This patch also includes a mc-boot translated copy of the
module M2Dependent.

gcc/m2/ChangeLog:

        * gm2-libs-ch/UnixArgs.cc: Renamed from gm2-libs-ch/UnixArgs.c.
        * gm2-libs-ch/dtoa.cc: Renamed from gm2-libs-ch/dtoa.c.
        * gm2-libs-ch/ldtoa.cc: Renamed from gm2-libs-ch/ldtoa.c.
        * gm2-libs-ch/m2rts.h: New file.
        * mc-boot-ch/GUnixArgs.cc: New file.
        * mc-boot-ch/m2rts.h: New file.
        * mc-boot/GM2Dependent.c: New file.
        * mc-boot/GM2Dependent.h: New file.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 16:04:55 +01:00
Gaius Mulley
f9812a605a Support library C files changed to C++ with dynamic scaffold signature.
This patch moves more of the C support files in the modula-2 library
into C++ files with a dynamic scaffold signature.  It also tidied
up the interface to UnixArgs and required a rebuild of the bootstrap
tool mc.

2022-06-29  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

        * bnf/gm2l.bnf (BlockInfoPtr): Capitalized comment starts.
        * gm2-libs-ch/UnixArgs.cc: Rewritten from UnixArgs.c in C++
        with ctor scaffold.
        * gm2-libs-ch/dtoa.cc (M2_dtoa_init): Added correct argc,
        argv, envp parameters.  (M2_dtoa_finish) Added correct argc,
        argv, envp parameters.  (M2_dtoa_dep) New function.
        (M2_dtoa_ctor) New function.
        * gm2-libs-ch/ldtoa.cc (M2_ldtoa_init): Added correct argc,
        argv, envp parameters.  (M2_ldtoa_finish) Added correct argc,
        argv, envp parameters.  (M2_ldtoa_dep) New function.
        (M2_ldtoa_ctor) New function.
        * gm2-libs-iso/ProgramArgs.mod: Changed to use GetArgC and
        GetArgV.
        * gm2-libs/Args.def: Renamed parameter name from i to n.
        * gm2-libs/Args.mod: Changed to use GetArgC and
        GetArgV.
        * gm2-libs/SArgs.def: Renamed parameter name from i to n.
        * gm2-libs/SArgs.mod: Changed to use GetArgC and
        GetArgV.
        * gm2-libs/UnixArgs.def: Rewritten to export GetArgC, GetArgV
        and GetEnvV.
        * init/mcinit: Commented out M2Dependent.
        * mc-boot-ch/GM2LINK.c: Include cstddef.h and declare
        ForcedModuleInitOrder.
        * mc-boot-ch/GUnixArgs.cc: Rewritten in C++ from GUnixArgs.c.
        * mc-boot/GArgs.c: Rebuilt.
        * mc-boot/GArgs.h: Rebuilt.
        * mc-boot/GM2RTS.c: Rebuilt.
        * mc-boot/GM2RTS.h: Rebuilt.
        * mc-boot/GSArgs.c: Rebuilt.
        * mc-boot/GSArgs.h: Rebuilt.
        * mc-boot/GUnixArgs.h: Rebuilt.
        * mc-boot/Gdecl.c: Rebuilt.
        * mc/mc.flex: Rebuilt.

libgm2/ChangeLog:

        * libm2pim/Makefile.am (libm2pim_la_SOURCES): UnixArgs.c
        removed UnixArgs.cc added.  (libm2pim_la_SOURCES) sckt.c
        removed sckt.cc added.  (libm2pim_la_SOURCES) dtoa.c
        removed dtoa.cc added.  (libm2pim_la_SOURCES) ldtoa.c
        removed ldtoa.cc added.  (libm2pim_la_SOURCES) Selective.c
        removed Selective.cc added.
        * libm2pim/UnixArgs.cc: Rewritten in C++.
        * libm2pim/dtoa.cc: Rewritten in C++.
        * libm2pim/ldtoa.cc: Rewritten in C++.
        * libm2pim/sckt.cc: Rewritten in C++.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 16:03:51 +01:00
Gaius Mulley
301cbc1baf Testsuite fixes to enable coroutine linking.
This patch allows the remaining coroutine regression tests to
link with the new dynamic module ctors and new scaffold mechanism.

2022-06-27  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/testsuite/gm2/ChangeLog:

        * coroutines/pim/run/pass/coroutines-pim-run-pass.exp
        (gm2_link_with) Assigned to "-lm2cor -lm2pim -lm2iso".
        * iso/run/pass/iso-run-pass.exp: Avoid linking the library module.
        * isocoroutines/run/pass/coroutine.mod (main): Renamed mainc.
        * isocoroutines/run/pass/isocoroutines-run-pass.exp
        (gm2_init_pim): Configure with -fscaffold-main
        -fno-scaffold-dynamic.
        * link/externalscaffold/pass/scaffold.c (_M2_SYSTEM_finish):
        Renamed _M2_SYSTEM_fini.  (_M2_M2RTS_finish) Renamed
        _M2_M2RTS_fini.  (_M2_RTExceptions_finish) Renamed
        _M2_RTExceptions_fini.  (_M2_hello_finish) Renamed
        _M2_hello_fini.
        * pim/options/optimize/run/pass/pim-options-optimize-run-pass.exp
        (gm2_link_with): Assigned to addition.o.
        * pim/run/pass/pim-run-pass.exp (gm2_link_with): Assigned to sys.o.
        Avoid linking sys.mod.
        * pimcoroutines/run/pass/pimcoroutines-run-pass.exp
        (gm2_link_with): Assigned to "-lm2cor -lm2pim -lm2iso".
        * switches/check-all/run/fail/switches-check-all-run-fail.exp
        (gm2_link_with): Assigned to rangesupport.o.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 16:03:11 +01:00
Gaius Mulley
619a463632 Renamed libgm2 C files to C++ and removed unnecessary file.
gcc/m2/ChangeLog:

        * gm2-libs-iso/ErrnoCategory.c (Removed).

libgm2/ChangeLog:

        * libm2iso/ErrnoCategory.cc (Renamed from ErrnoCategory.c).
        * libm2iso/RTco.cc (Renamed from RTco.c).
        * libm2pim/termios.cc (Renamed from termios.c).
        * libm2pim/SysExceptions.cc (Renamed from SysExceptions.c).
        * libm2pim/errno.cc (Renamed from errno.c).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 16:02:29 +01:00
Gaius Mulley
212dacafc2 Fixes to allow -fcpp and regression test link changes.
This patch fixes (re-introduces) the -fcpp option and it
migrates more testsuite tcl files to use the new linking mechanism.

2022-06-26  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

        * bnf/gm2l.bnf (ScanArgs): -fcppbegin changed to -fcpp-begin.
        * gm2-compiler/M2DriverOptions.mod (ScanCppArgs):
        -fcppbegin changed to -fcpp-begin, -fcppend changed to
        -fcpp-end.
        * gm2-compiler/M2GenGCC.mod (CodeFinallyEnd): Check
        we are compiling the main module before generating
        the scaffold.
        * gm2-compiler/M2Options.mod (CppRemember): -fcppbegin
        changed to -fcpp-begin.  (CppArg) -fcppbegin
        changed to -fcpp-begin, -fcppend changed to -fcpp-end.
        -fcppprog changed to -fcpp-prog.
        * gm2-compiler/P2SymBuild.mod (BlockEnd): Added assert.
        (PopBlock) bug fix, curModuleSym is popped in
        correct sequence.
        * gm2-lang.cc (gm2_langhook_init_options):
        -fcppbegin changed to -fcpp-begin.  -fcppend changed to
        -fcpp-end.  -fcppprog changed to -fcpp-prog.
        * gm2spec.cc (get_libexec):  New function.
        (gen_gm2_libexec) New function.  (add_exec_dir) New function.
        (lang_register_spec_functions) add exec_prefix.
        * lang-specs.h: -fcppbegin changed to -fcpp-begin.
        -fcppend changed to -fcpp-end.
        * lang.opt: Uniform internal switch statement used
        where necessary.  -fcppbegin changed to -fcpp-begin.
        -fcppend changed to -fcpp-end.  -fcppprog= changed to -fcpp-prog=.

libgm2/Changelog:

        * libm2iso/m2rts.h: (New file).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 16:01:40 +01:00
Gaius Mulley
1e0e7e1222 Further driver cleanup and allow forced linking of ctors.
This patch further cleans up the driver gm2.  It also moves
some of the C support libraries into C++ mimicing m2 ctor
behaviour.  -fuselist= is also implemented which forces
module ctors to be referenced in the scaffold.

2022-06-25  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/ChangeLog:

        * doc/gm2.texi (-fobject-path=): Removed.  (-fmakeinit)
        Removed.  (-fmakelist) Removed.  (-fuselist) Removed.
        (-fuselist=@file{filename}) Added.

gcc/m2/ChangeLog:

        * m2/gm2-compiler/Lists.mod: Corrected spacing.
        * m2/gm2-compiler/M2Options.def (SetUselist): New procedure.
        (GetUselist) New procedure function.
        * m2/gm2-compiler/M2Options.mod (UselistFilename): New
        variable.  (SetUselist) New procedure implementation.
        (GetUselist) New procedure implementation.
        * m2/gm2-compiler/M2Quads.mod (BuildM2LinkFunction)
        New procedure.  (BuildM2MainFunction) build call to
        linkFunction.  (BuildScaffold) call BuildM2MainFunction.
        (MakeLengthConst) Re-implemented.
        * m2/gm2-compiler/M2Scaffold.def (linkFunction):
        New variable.  (PopulateCtorArray) New procedure.
        * m2/gm2-compiler/M2Scaffold.mod (DeclareCtorArrayType):
        New procedure function.  (DeclareCtorGlobal) New procedure.
        (PopulateCtorArray) New procedure.  (ReadModules) New
        procedure.  (CreateCtorList) New procedure function.
        (DeclareCtorModuleExtern) New procedure.
        (DeclareScaffoldFunctions) Declare the ctor global array and
        declare all external modules ctors.
        * m2/gm2-compiler/PCSymBuild.mod: Remove stop.
        * m2/gm2-compiler/SymbolTable.def (MakeProcedureCtorExtern)
        New procedure function.  (PutExtern) New procedure function.
        (IsExtern) New procedure function.  (MakeConstant) New
        procedure function.
        * m2/gm2-compiler/SymbolTable.mod (Procedure): New field IsExtern.
        (MakeProcedureCtorExtern) New procedure function.
        (PutExtern) New procedure.  (IsExtern) New procedure function.
        (MakeConstant) New procedure function implemented.
        * m2/gm2-gcc/m2options.h (SetUselist): New procedure.
        * m2/gm2-lang.cc (fuselist): Removed.  (fmakelist) Removed.
        (fmodules) Removed.  (fuselist_) Added.
        * m2/gm2spec.cc (fuselist): Removed.
        * m2/lang.opt (fuselist): Removed.  (fmakelist) Removed.
        (fmodules) Removed.  (fuselist=) Added.

libgm2/Changelog:

        * libm2pim/Makefile.am (M2MODS): Add M2Dependent.mod
        (M2DEFS) Add M2Dependent.def.
        * libm2iso/ErrnoCategory.cc (Renamed from ErrnoCategory.c).
        Converted to C++.
        * libm2iso/Makefile.am: Changed .c extensions to .cc.
        * libm2iso/RTco.cc (Renamed from RTco.c): Converted to C++.
        * libm2pim/Makefile.am: Changed .c extensions to .cc.
        * libm2pim/SysExceptions.cc (Renamed from SysExceptions.c):
        Converted to C++.
        * libm2pim/errno.cc (Renamed from errno.c): Converted to C++.
        * libm2pim/termios.cc (Renamed from termios.c): Converted to C++.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 16:00:27 +01:00
Gaius Mulley
6bafc4d528 Driver cleanup and purge of unnecessary code.
This patch cleans up the driver gm2 by removing the old scaffold
support routines.  The driver is now much closer to other language
drivers with the exception of adding default libraries and include
paths if different dialects are chosen.

2022-06-22  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

        * m2/gm2-lang.cc (gm2_langhook_init_options_struct): Remove
        blank line.  (gm2_langhook_handle_option) purged options.
        (ftarget_ar) Removed.  (ftarget_ranlib) Removed.  (fmakeinit)
        Removed.  (fobject-path) Removed.  (fonlylink) Removed.
        * m2/gm2spec.cc (GM2_PREFIX_ENV): Removed.
        (add_exec_prefix) Removed.  (add_B_prefix) Removed.
        (get_objects) Removed.  (*get_link_args) Removed.  (*add_exec_dir)
        Removed.  (*add_exec_name) Removed.  (is_object) Removed.
        (remember_object) Removed.  (remember_link_arg) Removed.
        (scan_for_link_args) Removed.  (add_link_from_include) Removed.
        (check_gm2_root) Removed.  (*gen_gm2_prefix) Removed.
        (*gen_gm2_libexec) Removed.  (*get_libexec) Removed.
        (object_list) Removed.  (head_objects) Removed.
        (head_link_args) Removed.  (inclPos) Removed.
        (linkPos) Removed.  (seen_fonlylink) Removed.
        (seen_fmakeall0) Removed.  (seen_fmakeall) Removed.
        * m2/lang.opt: (fmakeinit) Removed.  (fobject-path) Removed.

libgm2/Changelog:

        * libm2pim/Makefile.am (M2MODS): Add M2Dependent.mod
        (M2DEFS) Add M2Dependent.def.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 15:59:34 +01:00
Gaius Mulley
9fcf394b7c New files implementing the scaffold at compile/runtime.
gcc/m2/ChangeLog:

        * gm2-compiler/M2Scaffold.def (New file).
        * gm2-compiler/M2Scaffold.mod (New file).
        * gm2-libs-ch/M2LINK.c (New file).
        * gm2-libs/M2Dependent.def (New file).
        * gm2-libs/M2Dependent.mod (New file).
        * gm2-libs/M2LINK.def (New file).
        * m2-link-support.h (Removed file).
        * mc-boot-ch/GM2LINK.c (New file).
        * mc-boot/GM2LINK.h (New file).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 15:58:59 +01:00
Gaius Mulley
c196fa13e0 First working commit of the new scaffold implementation.
A large commit consisting of a re-implementing of the scaffold
generation for modula-2.  The changes allow the compiler
to be built, installed and hello world can be compiled and linked.
The default scaffold generated by modula-2 is propagated to M2RTS
via ctors.  At runtime M2RTS resolves the dependency import graph
and calls each module init/fini code.

2022-06-20  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/ChangeLog:

        * doc/gm2.texi: Replaced English spelling to American.
        (-fscaffold-static) New option documented.  (-fscaffold-dynamic)
        New option documented.  (-fscaffold-c) New option documented.
        (-fscaffold-c++) New option documented.

gcc/m2/ChangeLog:

        * Make-lang.in (stage1/m2/cc1gm2$(exeext)): M2LINK.o added.
        (GM2-LIBS-BOOT-MODS) M2Dependent.mod added.  (GM2-COMP-BOOT-MODS)
        M2Scaffold.mod added.  (GM2-LIBS-DEFS) M2Dependent.def added.
        (GM2-LIBS-MODS) added.  (GM2-COMP-DEFS) M2Scaffold.def added.
        (GM2-COMP-MODS) M2Scaffold.mod added.
        (m2/gm2-libs-boot/M2LINK.o) New rule.  (stage1/m2/gm2l$(exeext))
        added M2LINK.o.  (stage1/m2/gm2lcc$(exeext)) added M2LINK.o
        (stage1/m2/gm2lcc$(exeext)) added M2LINK.o.
        (stage1/m2/gm2lgen$(exeext)) added M2LINK.o.
        (stage1/m2/gm2lgen$(exeext)) added M2Link.o.
        (stage1/m2/gm2lorder$(exeext)) added M2Link.o.
        (stage1/m2/gm2m$(exeext)) added M2Link.o.
        (MC-LIB-DEFS) M2LINK.def added.  (MC-INTERFACE-C)
        M2LINK.c added.  (PPG-LIB-DEFS) M2Dependent.def added.
        (PPG-LIB-MODS) M2Dependent.mod added.
        (m2/gm2-ppg-boot/$(SRC_PREFIX)%.o) search m2/gm2-libs-boot.
        (m2/ppg$(exeext)) added M2LINK.o.
        (m2/gm2-pg-boot/$(SRC_PREFIX)%.o) added M2LINK.o.
        (m2/gm2-pge-boot/$(SRC_PREFIX)%.o) added M2LINK.o.
        * bnf/m2-1.bnf: Added production rules to record import
        statements and module dependents.
        * bnf/m2-2.bnf: Added production rules to record block
        begin/end pairs.
        * bnf/m2-3.bnf (ProgramModule): Call BuildScaffold.
        (ImplementationModule) Call BuildScaffold.
        * gm2-compiler/M2Base.mod: Reformatted.
        * gm2-compiler/M2GCCDeclare.mod (DeclareProcedureToGcc):
        Re-implemented.  (DeclareModuleInit) re-implemented.
        * gm2-compiler/M2GenGCC.mod (IsExportedGcc): Check IsPublic.
        (CallInnerInit) get init function using GetModuleCtors
        and build call to init.  (CallInnerFinally) get fini
        function using GetModuleCtors and build call to fini.
        (CodeInitEnd) call GetModuleCtors and finish call to init.
        (CodeFinallyStart) call GetModuleCtors and start function fini.
        (CodeFinallyEnd) call GetModuleCtors and finish function fini.
        Call DeclareM2linkGlobals to set the ScaffoldStatic and
        ForcedModuleInitOrder variables in the main program.
        (CodeKillLocalVar) test the procedure is a ctor if so call
        DeclareModuleCtor and BuildModuleCtor.
        (ConvertForComparison) Removed.  (DetermineFieldOf) Removed.
        * gm2-compiler/M2MetaError.mod: Added import of Storage.
        * gm2-compiler/M2Options.def (ScaffoldDynamic): New procedure.
        (ScaffoldStatic) New procedure. (SetScaffoldDynamic) New procedure.
        (SetScaffoldStatic) New procedure. (SetScaffoldMain) New
        procedure.  (ScaffoldMain) New procedure.
        (SetRuntimeModuleOverride) New procedure.
        (GetRuntimeModuleOverride) New procedure.
        * gm2-compiler/M2Options.mod: (ScaffoldDynamic): New procedure
        implemented.  (ScaffoldStatic) New procedure implemented.
        (SetScaffoldDynamic) New procedure implemented.
        (SetScaffoldStatic) New procedure implemented.
        (SetScaffoldMain) New procedure implemented.
        (ScaffoldMain) New procedure implemented.
        (SetRuntimeModuleOverride) New procedure implemented.
        (GetRuntimeModuleOverride) New procedure implemented.
        * gm2-compiler/M2Quads.def (BuildScaffold) New procedure defined.
        * gm2-compiler/M2Quads.mod (BuildScaffold) New procedure
        implemented.  (callRequestDependant) New procedure.
        (ForeachImportedModuleDo) New procedure.  (BuildM2DepFunction)
        New procedure.  (BuildM2MainFunction) New procedure.
        (BuildM2InitFunction) New procedure.  (BuildM2FiniFunction)
        New procedure.  (BuildM2CtorFunction) New procedure.
        (BuildScaffold) New procedure.  (GetQualidentImport) use %1a
        rather than %Ea.
        * gm2-compiler/P1SymBuild.def (BuildImportStatement): New
        procedure definition.  (AddImportToImportStatement) New
        procedure definition.
        * gm2-compiler/P1SymBuild.mod: (BuildImportStatement): New
        procedure implementation.  (AddImportToImportStatement) New
        procedure implementation.
        * gm2-compiler/P2SymBuild.def (BlockStart): New procedure
        definition.  (BlockEnd) New procedure definition.
        (BlockBegin) New procedure definition.  (BlockFinally)
        New procedure definition.
        * gm2-compiler/P2SymBuild.mod (BlockStart): New procedure
        implementation.  (BlockEnd) New procedure implementation.
        (BlockBegin) New procedure implementation.  (BlockFinally)
        New procedure implementation.
        * gm2-compiler/SymbolTable.def (MakeModuleCtor):
        New procedure definition.  (PutPublic) New procedure.
        (IsPublic) New procedure.  (PutCtor) New procedure.
        (IsCtor) New procedure.  (GetModuleCtors) New procedure.
        (MakeModuleCtor) New procedure.  (MakeImport) New procedure.
        (MakeImportStatement) New procedure.  (IsImport) New procedure.
        (IsImportStatement) New procedure.  (GetImportModule) New
        procedure.  (GetImportDeclared) New procedure.
        (GetImportStatementList) New procedure.
        (GetModuleDefImportStatementList) New procedure.
        (GetModuleModImportStatementList) New procedure.
        (AppendModuleImportStatement) New procedure.
        (AppendModuleOnImportStatement) New procedure.
        * gm2-compiler/SymbolTable.mod (MakeModuleCtor):
        New procedure definition.  (PutPublic) New procedure.
        (IsPublic) New procedure.  (PutCtor) New procedure.
        (IsCtor) New procedure.  (GetModuleCtors) New procedure.
        (MakeModuleCtor) New procedure.  (MakeImport) New procedure.
        (MakeImportStatement) New procedure.  (IsImport) New procedure.
        (IsImportStatement) New procedure.  (GetImportModule) New
        procedure.  (GetImportDeclared) New procedure.
        (GetImportStatementList) New procedure.
        (GetModuleDefImportStatementList) New procedure.
        (GetModuleModImportStatementList) New procedure.
        (AppendModuleImportStatement) New procedure.
        (AppendModuleOnImportStatement) New procedure.
        * gm2-gcc/m2decl.cc (DeclareM2linkGlobals) New function
        implementation.
        (BuildModuleCtor) New function implementation.
        (DeclareModuleCtor) New function implementation.
        * gm2-gcc/m2decl.def (DeclareM2linkGlobals) New function.
        (BuildModuleCtor) New function.  (DeclareModuleCtor)
        New function.
        * gm2-gcc/m2decl.h (DeclareM2linkGlobals) New function.
        (BuildModuleCtor) New function.  (DeclareModuleCtor)
        New function.
        * gm2-gcc/m2options.h (SetScaffoldStatic) New function.
        (SetScaffoldDynamic) New function.  (SetScaffoldMain)
        New function.  (SetRuntimeModuleOverride) New function.
        * gm2-lang.cc (fscaffold_dynamic) Handle option.
        (fscaffold_static) Handle option.  (fscaffold_main)
        Handle option.  (fonlylink) Commented out.
        * gm2-libs-iso/M2RTS.def (ConstructModules) New procedure.
        (DeconstructModules) New procedure.  (RegisterModule)
        New procedure.  (RequestDependant) New procedure.
        * gm2-libs-iso/M2RTS.mod (ConstructModules) New procedure.
        (DeconstructModules) New procedure.  (RegisterModule)
        New procedure.  (RequestDependant) New procedure.
        Replace termination and initial procedures using a dynamic
        data structure.  Call upon M2Dependent to solve module
        dependencies.
        * gm2-libs/M2RTS.def (ConstructModules) New procedure.
        (DeconstructModules) New procedure.  (RegisterModule)
        New procedure.  (RequestDependant) New procedure.
        * gm2-libs/M2RTS.mod (ConstructModules) New procedure.
        (DeconstructModules) New procedure.  (RegisterModule)
        New procedure.  (RequestDependant) New procedure.
        Replace termination and initial procedures using a dynamic
        data structure.  Call upon M2Dependent to solve module
        dependencies.
        * gm2spec.cc (check_gm2_root): Commented out.
        (add_exec_prefix) Commented out.  (fonlylink) Commented out.
        (fmakeall) Commented out.  (fmakeall0) Commented out.
        (add_exec_prefix) Commented out.  (lang_register_spec_functions)
        body commented out.
        * lang-specs.h (m2-link-support.h) no longer included.
        (M2CPP) defined.
        * lang.opt (fuselist) New description.  (fmakelist)
        New description.  (fonlylink) removed.  (fscaffold-static)
        New option.  (fscaffold-dynamic) New option.  (ftarget-ranlib=)
        Removed.  (fscaffold-c) New option.  (fscaffold-c++) New option.
        (fscaffold-main) New option.
        * mc-boot-ch/GM2LINK.c: New file.
        * mc-boot/GAssertion.h: Rebuilt.
        * mc-boot/GDynamicStrings.c: Rebuilt.
        * mc-boot/GDynamicStrings.h: Rebuilt.
        * mc-boot/GEnvironment.h: Rebuilt.
        * mc-boot/GFIO.c: Rebuilt.
        * mc-boot/GFIO.h: Rebuilt.
        * mc-boot/GFormatStrings.h: Rebuilt.
        * mc-boot/GIndexing.c: Rebuilt.
        * mc-boot/GM2EXCEPTION.c: Rebuilt.
        * mc-boot/GM2RTS.c: Rebuilt.
        * mc-boot/GM2RTS.h: Rebuilt.
        * mc-boot/GPushBackInput.c: Rebuilt.
        * mc-boot/GRTExceptions.c: Rebuilt.
        * mc-boot/GRTint.c: Rebuilt.
        * mc-boot/GSYSTEM.h: Rebuilt.
        * mc-boot/GStdIO.c: Rebuilt.
        * mc-boot/GStringConvert.c: Rebuilt.
        * mc-boot/GSysStorage.c:
        * mc-boot/Gdecl.c: Rebuilt.
        * mc-boot/Gkeyc.c: Rebuilt.
        * mc-boot/GmcComment.c: Rebuilt.
        * mc-boot/GmcComp.c: Rebuilt.
        * mc-boot/GmcDebug.c: Rebuilt.
        * mc-boot/GmcMetaError.c: Rebuilt.
        * mc-boot/GmcStack.c: Rebuilt.
        * mc-boot/GnameKey.c: Rebuilt.
        * mc-boot/GsymbolKey.c: Rebuilt.
        * mc/decl.mod (isLastStatement) Check if n = NIL
        * mc/mcComp.mod: Change spelling to initialization.
        and return FALSE.
        * tools-src/makeSystem (MINIMAL): New variable.
        Use MINIMAL when invoking gm2 to generate the SYSTEM exports.

libgm2/Changelog:

        * libm2min/Makefile.am (libm2min_la_M2FLAGS):
        Added -fno-scaffold-dynamic -fno-scaffold-main.
        * libm2pim/Makefile.am (M2DEFS): Added M2LINK.def.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 15:58:02 +01:00
Gaius Mulley
bd2f92560f Remove m2 front end linking support.
2022-05-30  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

All m2 linking assistance by the Modula-2 front end is disabled.
cc1gm2 handles the -c option but currently does nothing with the option.
New gcc/testsuite/gm2/link/externalscaffold added to check the compiler
can link trivial application against a hand built scaffold.

gcc/testsuite/gm2/ChangeLog:

        * link/externalscaffold: (New regression test).  Manual linking
        test using external scaffold.

gcc/m2/ChangeLog:

        * gm2-compiler/M2Options.def (cflag): New boolean.
        (Setc) New procedure.  (Getc) New procedure function.
        * gm2-compiler/M2Options.mod (Setc): New procedure.
        (Getc) New procedure function.  Initialize cflag to
        FALSE.
        * gm2-gcc/m2options.h (Setc): New external function.
        (Getc) New external function.
        * gm2-lang.cc: Handle OPT_c and call M2Options_Setc.
        * lang-specs.h: Remove all link rules for m2.
        * lang.opt: Allow m2 to process the -c option.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-07 15:57:13 +01:00
Gaius Mulley
d0e4bdcd79 Merge branch 'master' into devel/modula-2.
Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-07-06 20:04:26 +01:00
Gaius Mulley
9109c9ebe2 Merge branch 'master' into devel/modula-2. 2022-06-10 12:25:34 +01:00
Gaius Mulley
568b62ce92 Merge branch 'master' into devel/modula-2. 2022-06-06 11:04:29 +01:00
Gaius Mulley
9409a75aa9 Merge branch 'master' into devel/modula-2. 2022-05-30 13:57:52 +01:00
Gaius Mulley
f17a10fdcf Merge branch 'master' into devel/modula-2. 2022-05-23 22:10:01 +01:00
Gaius Mulley
9f1a305893 gcc/m2/m2pp.cc renamed from m2pp.c and tidied comments.
2022-05-20   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* m2pp.cc: (Renamed from m2pp.c).  Comments tidied up.
	* Make-lang.in: m2pp.c changed to m2pp.cc.
	(m2rte.so) Added insn-flags.h as a dependent.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-20 02:39:14 +01:00
Gaius Mulley
2bbc95a9c0 Merge branch 'master' into devel/modula-2. 2022-05-19 19:40:55 +01:00
Gaius Mulley
3c46ace3d1 Corrected capitalization for start of comments in header files.
2022-05-19   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* gm2-gcc/gcc-consolidation.h: Comment capitalization.
	* gm2-gcc/m2color.h: Comment capitalization.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-19 14:26:58 +01:00
Gaius Mulley
4e4cd35644 Corrected capitalization for start of comments.
2022-05-19   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* gm2-gcc/m2assert.cc: Corrected comment formatting.
	* gm2-gcc/m2block.cc: Corrected comment formatting.
	* gm2-gcc/m2builtins.cc: Corrected comment formatting.
	* gm2-gcc/m2convert.cc: Corrected comment formatting.
	* gm2-gcc/m2decl.cc: Corrected comment formatting.
	* gm2-gcc/m2except.cc: Corrected comment formatting.
	* gm2-gcc/m2expr.cc: Corrected comment formatting.
	* gm2-gcc/m2linemap.cc: Corrected comment formatting.
	* gm2-gcc/m2statement.cc: Corrected comment formatting.
	* gm2-gcc/m2treelib.cc: Corrected comment formatting.
	* gm2-gcc/m2type.cc: Corrected comment formatting.
	* gm2-gcc/rtegraph.cc: Corrected comment formatting.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-19 13:39:03 +01:00
Gaius Mulley
efc2d06325 Removed unused debugging code and tidied up comments.
2022-05-19   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

	* gm2-gcc/m2statement.cc: Corrected comment formatting and
	removed usused debugging code.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-19 12:53:12 +01:00
Gaius Mulley
af714e8280 Reformatting of comments in plugin.
2022-05-19   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* plugin/m2rte.cc: Further reformatting of comments.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-19 12:04:05 +01:00
Gaius Mulley
e907dc7cea Comment reformatting and removal of gcc/m2/lang-options.h
2022-05-19   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* gm2-gcc/m2builtins.cc: Corrected comments (specifically
	those referring to .c files).
	* gm2-gcc/m2convert.cc: Corrected comments (specifically
	those referring to .c files).
	* gm2-gcc/m2expr.cc: Corrected comments (specifically
	those referring to .c files).
	* gm2-gcc/m2statement.cc: Corrected comments (specifically
	those referring to .c files).
	* gm2-gcc/m2treelib.cc: Corrected comments (specifically
	those referring to .c files).
	* gm2-gcc/m2type.cc: Corrected comments (specifically
	those referring to .c files).
	* gm2-gcc/rtegraph.cc: Corrected comments (specifically
	those referring to .c files).
	* gm2-lang.cc: Corrected comments (specifically
	those referring to .c files).
	* plugin/m2rte.cc: Reformatted comments and removal of
	test comment.
	* lang-options.h: (Removed).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-19 11:12:26 +01:00
Gaius Mulley
c7570ba482 gm2spec.cc and lang-options.h corrected/replaced comments and fixed a typo.
2022-05-19   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* gm2spec.cc: Reformatted multiline comments.
	* lang-options.h: Removed an erroneous ancient comment and
	replaced it with a new one.  Corrected typo in the description
	of -fcase.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-19 00:57:41 +01:00
Gaius Mulley
a762d9f0a6 gm2tools/ChangeLog corrected to use GNU formatting.
Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-18 21:34:42 +01:00
Gaius Mulley
6f1b137440 libgm2 corrected spelling and comment formatting standard.
libgm2/ChangeLog:

	* libm2pim/Selective.c: Use initialize spelling.
	* libm2pim/dtoa.c: Corrected comment formatting.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-18 20:03:58 +01:00
Gaius Mulley
2ac2256255 libgm2/libm2pim/termios.c changed comments to GNU coding standard.
libgm2/ChangeLog:

	* libm2pim/termios.c changed comments to GNU coding
	standard within an enum declaration.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-18 19:53:59 +01:00
Gaius Mulley
bd048913f0 Changed spacing to comply with GCC Coding Standards.
Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-18 19:42:26 +01:00
Gaius Mulley
bf9e93834c libgm2/libm2pim use GNU coding standard comment style.
Correct style of comments in all source files.

libgm2/ChangeLog:

	* libm2pim/Selective.c: Reformatted comments.
	* libm2pim/SysExceptions.c: Reformatted comments.
	* libm2pim/dtoa.c: Reformatted comments.
	* libm2pim/ldtoa.c: Reformatted comments.
	* libm2pim/sckt.c: Reformatted comments.
	* libm2pim/termios.c: Reformatted comments.
	* libm2pim/wrapc.c: Reformatted comments.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-18 17:49:03 +01:00
Gaius Mulley
31ab57c82f gm2tools/m2color.c reformatted to use GNU coding standards.
Reformatted gm2tools/m2color.c to use GNU coding standards.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-18 16:15:44 +01:00
Gaius Mulley
4476710042 * gm2l.1: Corrected default implementation/program module.
Corrected default implementation/program module extension statement to
.mod.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-18 16:12:33 +01:00
Gaius Mulley
a6dce3480f Tidy up dates and correct spelling in documentation.
gcc/ChangeLog:

	* doc/gm2.texi: Corrected spelling and spaces between sentances.

gm2tools/ChangeLog:

	* Corrected dates on all source files.

libgm2/ChangeLog:

	* Corrected dates on all source files.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-18 13:01:24 +01:00
Gaius Mulley
bec4c840b3 Updated gcc/m2/ChangeLog.
Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-16 12:28:16 +01:00
Gaius Mulley
67ce904a2e m2rte.cc reduce include headers and correct build dependencies.
2022-05-16   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

This patch corrects the dependencies to build m2rte.so in
Make-lang.in.  It also reduces the number of headers used in
m2rte.cc.

gcc/m2/ChangeLog:

	* plugin/m2rte.cc (alias.h, predict.h, tm.h,
	stringpool.h, toplev.h, basic-block.h, hash-table.h,
	vec.h, ggc.h, basic-block.h, tree-ssa-alias.h,
	internal-fn.h, gimple-fold.h, tree-eh.h, gimple-expr.h,
	is-a.h):  Header file includes removed.
	(plugin/m2rte$(exeext).so) Make dependent upon
	$(GCC_HEADER_DEPENDENCIES_FOR_M2) and insn-addr-common.h.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-16 12:20:15 +01:00
Gaius Mulley
f5a02fa669 Merge branch 'master' into devel/modula-2. 2022-05-15 23:44:16 +01:00
Gaius Mulley
22ba1fbcce Refactored some rules in Make-lang.in and portfix calcpath.
Removed the -e option to realpath in the calcpath tool so
that gm2 builds on FreeBSD.  Also refactored some of the
rules in Make-lang.in and added and tidied up some of the
comments.

gcc/m2/ChangeLog:

	* m2/Make-lang.in (GCC_HEADER_DEPENDENCIES_FOR_M2): New define.
	m2/gm2-gcc/%.o: Add GCC_HEADER_DEPENDENCIES_FOR_M2 as a dependent.
	m2/gm2-lang.o: Add GCC_HEADER_DEPENDENCIES_FOR_M2 as a dependent.
	m2/stor-layout.o: Add GCC_HEADER_DEPENDENCIES_FOR_M2 as a
	dependent.
	m2/m2pp.o: Add GCC_HEADER_DEPENDENCIES_FOR_M2 as a
	dependent.
	m2/gm2-gcc/rtegraph.o: Add GCC_HEADER_DEPENDENCIES_FOR_M2 as a
	dependent.
	c-family/m2pp.o: Add GCC_HEADER_DEPENDENCIES_FOR_M2 as a
	dependent.  Added new comments.
	* m2/tools-src/calcpath: Remove -e option to realpath
	to help the build on FreeBSD.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-15 13:06:05 +01:00
Gaius Mulley
db1ed08b56 Improvements to documentation.
Specifically reducing many of the overful box errors which occur
when generating the pdf documentation.  Also correcting the
manual scaffold link examples now that the compiler uses a
different scaffold naming scheme.

2022-05-13   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/ChangeLog:

	* doc/gm2.texi: Tidied up many overful lines and corrected
	scaffold link examples.  Updated dates.

gcc/m2/ChangeLog:

	* gm2-compiler/ppg.mod: Reduced the line wrap marker
	to ensure texi pretty print rules do not cause overful box errors
	in gm2 pdf documentation.
	* gm2-libs-iso/SYSTEM.def: Shorten the comment lines
	and parameter lists per line to avoid overful box errors.
	* gm2-libs/Assertion.def: Shorten the comment lines
	and parameter lists per line to avoid overful box errors.
	* gm2-libs/Builtins.def: Shorten the comment lines
	and parameter lists per line to avoid overful box errors.
	* gm2-libs/Builtins.mod: Name change n to nbytes for memcpy,
	memset and memmove.
	* gm2-libs/DynamicStrings.def: Shorten the comment lines
	and parameter lists per line to avoid overful box errors.
	* gm2-libs/Environment.def: Shorten the comment lines
	and parameter lists per line to avoid overful box errors.
	* gm2-libs/FIO.def: Shorten the comment lines
	and parameter lists per line to avoid overful box errors.
	* gm2-libs/FIO.mod: Shorten the comment lines
	and parameter lists per line to avoid overful box errors.
	* gm2-libs/FormatStrings.def: Shorten the comment lines
	and parameter lists per line to avoid overful box errors.
	* gm2-libs/FpuIO.def: Shorten the comment lines
	and parameter lists per line to avoid overful box errors.
	* gm2-libs/GetOpt.def: Shorten the comment lines
	and parameter lists per line to avoid overful box errors.
	* gm2-libs/SYSTEM.def: Shorten the comment lines
	and parameter lists per line to avoid overful box errors.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-13 23:24:39 +01:00
Gaius Mulley
b69680044c Merge branch 'master' into devel/modula-2. 2022-05-12 09:17:53 +01:00
Gaius Mulley
519791ac80 Updated ChangeLog entries.
Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-10 17:42:50 +01:00
Gaius Mulley
70fe0035c0 Merge branch 'master' into devel/modula-2. 2022-05-09 16:58:40 +01:00
Gaius Mulley
beb9098be0 Merge branch 'master' into devel/modula-2. 2022-05-06 10:57:03 +01:00
Gaius Mulley
b387a11618 Merge branch 'master' into devel/modula-2. 2022-05-05 17:50:27 +01:00
Gaius Mulley
ae56a3ce25 PR-105409 Bugfix add CC1_SPEC to the cc1/cc1plus invocation.
Introducing patch devised by Rainer Orth <ro@CeBiTec.Uni-Bielefeld.de>.
The lack of CC1_SPEC options to cc1plus can cause an ICE.

gcc/m2/ChangeLog:

	* m2-link-support.h (GM2CC): Add CC1_SPEC to the cc1/cc1plus
	invocation.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-05 17:23:03 +01:00
Gaius Mulley
b94876d89d PR-105410 Bugfix implement save-temps across every temporary file.
2022-05-04   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* m2/m2-link-support.h (RM_IF_NOSAVETEMP) New macro.
	(GM2CC) Use RM_IF_NOSAVETEMP on the assembler intermediate file.
	(GM2LCC) Use RM_IF_NOSAVETEMP when creating an archive of the
	application.  (GEN_SCAFFOLD_SRC) Use RM_IF_NOSAVETEMP when
	creating the scaffold source program.  (M2LINK) Use
	RM_IF_NOSAVETEMP when creating the assembler source name and use
	RM_IF_NOSAVETEMP when creating the main program object.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-04 15:24:18 +01:00
Gaius Mulley
85de466e31 PR-101392 BugFix replace uses of sh with $(SHELL).
2022-05-03   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* Make-lang.in:  Replaced sh with $(SHELL).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-03 19:39:05 +01:00
Gaius Mulley
f39c518e3d PR-101392 BugFix assign main_input_filename prior to compilation.
2022-05-03   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* gm2-lang.cc (gm2_langhook_post_options): Assign
	main_input_filename.  (gm2_parse_input_files) Assign
	main_input_filename before every source filename is compiled.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-05-03 14:55:16 +01:00
Gaius Mulley
b8c70285c3 Merge branch 'master' into devel/modula-2. 2022-05-03 12:12:33 +01:00
Gaius Mulley
b624e1e9dc Merge branch 'master' into devel/modula-2. 2022-04-29 18:33:47 +01:00
Gaius Mulley
f043f7346c PR-105411 BugFix gm2 testsuite now uses TEST_ALWAYS_FLAGS.
2022-04-29   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/testsuite/ChangeLog:

	* gcc/testsuite/lib/gm2.exp (gm2_target_compile_default):
	Add TEST_ALWAYS_FLAGS to allow individual tests to override
	options.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-04-29 18:07:26 +01:00
Gaius Mulley
955517d6fe Merge branch 'master' into devel/modula-2. 2022-04-29 11:23:12 +01:00
Gaius Mulley
cf78131316 PR-105390 BugFix - change handbuilt SysExceptions to avoid the name sigfpe.
2022-04-29   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* m2/gm2-libs-ch/SysExceptions.c: Replace sigfpe with sigfpe_ to
	avoid name clash with C signal infastructure.
	* m2/mc-boot-ch/GSysExceptions.c: Replace sigfpe with sigfpe_ to
	avoid name clash with C signal infastructure.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-04-29 11:03:08 +01:00
Gaius Mulley
f3673984ea PR-105388 Fix mc to avoid the name sigfpe.
2022-04-28   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* mc-boot/Gkeyc.c: Rebuilt.
	* mc/keyc.mod (initMacros): Add sigfpe to the list of names to be
	avoided.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-04-28 22:09:12 +01:00
Gaius Mulley
9348eb1ddb PR-105388 Fix mc to avoid library name trunc.
2022-04-28   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* m2/mc-boot/GEnvironment.c: Rebuilt.
	* mc-boot/GEnvironment.h: Rebuilt.
	* mc-boot/Gdecl.c: Rebuilt.
	* mc-boot/Gkeyc.c: Rebuilt.
	* mc-boot/Glibc.h: Rebuilt.
	* mc/keyc.mod (initMacros): Add trunc to the list of functions to
	be avoided.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-04-28 18:37:47 +01:00
Gaius Mulley
979ad601ea Updated gcc/m2/ChangeLog.
Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-04-28 17:37:36 +01:00
Gaius Mulley
e684d1aa61 Merge branch 'master' into devel/modula-2. 2022-04-28 15:02:23 +01:00
Gaius Mulley
9506c9f1ab PR-105391 Makefile.in fixes to allow --with-gmp.
If configured to with --with-gmp the Modula-2 front end build does not
find the gmp.h header files or gmp libraries.  The bug is that
gcc/m2/Make-lang.in doesn't heed GMPINC/GMPLIB.

gcc/m2/ChangeLog:

	* Make-lang.in: Added $(INCLUDES) to all %.o rules requiring gmp.h.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-04-28 14:34:35 +01:00
Gaius Mulley
98e435df7b Merge branch 'master' into devel/modula-2. 2022-04-27 12:17:04 +01:00
Gaius Mulley
c55d3d27ad Merge branch 'master' into devel/modula-2. 2022-04-26 18:23:24 +01:00
Gaius Mulley
f828bee467 Merge branch 'master' into devel/modula-2. 2022-04-25 16:33:57 +01:00
Gaius Mulley
6ac8c270ed PR-102342 - fixes to allow gm2 testsuite to work with multilib and extra gcc objects.
2022-04-23  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

[Applying a patch provided by Rainer Orth  <ro@gcc.gnu.org> from PR-102342]

When running the gm2 testsuite for non-default multilibs (e.g. x86_64-pc-linux-gnu
for the default (-m64) and -m32, or i386-pc-solaris2.11 for the default -m32 and
-m64), many tests for the non-default multilib FAIL.

This patch ensures that the gcc invocation to generate additional objects
are also generated using the correct multilib options.

gcc/testsuite/gm2/ChangeLog:

	* calling-c/datatypes/unbounded/run/pass/calling-c-datatypes-unbounded-run-pass.exp:
	Remove XGCC and XGCC invocations and handbuilt tidyups.  Use
	target_compile instead.
	* examples/callingC/run/pass/examples-callingC-run-pass.exp:
	Remove XGCC and XGCC invocations and handbuilt tidyups.  Use
	target_compile instead.
	* exceptions/run/pass/exceptions-run-pass.exp: Remove XGCC and
	XGCC invocations and handbuilt tidyups.  Use target_compile
	instead.
	* extensions/run/pass/extensions-run-pass.exp: Remove XGCC and
	XGCC invocations and handbuilt tidyups.  Use target_compile
	instead.
	* imports/run/pass/imports-run-pass.exp: Remove XGCC and XGCC
	invocations and handbuilt tidyups.  Use target_compile instead.
	* linking/libarchive/pass/linking-libarchive-pass.exp: Remove XGCC
	and XGCC invocations and handbuilt tidyups.  Use target_compile
	instead.
	* gm2/pim/run/pass/pim-run-pass.exp: Remove XGCC and XGCC
	invocations and handbuilt tidyups.  Use target_compile instead.
	* pimcoroutines/run/pass/pimcoroutines-run-pass.exp: Remove XGCC
	and XGCC invocations and handbuilt tidyups.  Use target_compile
	instead.
	* types/run/pass/types-run-pass.exp: Remove XGCC and XGCC
	invocations and handbuilt tidyups.  Use target_compile instead.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-04-23 12:43:18 +01:00
Gaius Mulley
0d22cf81a2 Merge branch 'master' into devel/modula-2. 2022-04-22 09:06:06 +01:00
Gaius Mulley
cc2a7dabd1 Merge branch 'master' into devel/modula-2. 2022-04-20 12:34:58 +01:00
Gaius Mulley
8685e718a2 Replaced sprintf with calls to snprintf.
2022-04-20   Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* m2/tools-src/mklink.c (FindObject): Replace calls to sprintf
	with calls to snprintf.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-04-20 12:22:35 +01:00
Gaius Mulley
eae2c45ec9 Merge branch 'master' into devel/modula-2. 2022-04-01 20:20:02 +01:00
Gaius Mulley
2412370904 Merge branch 'master' into devel/modula-2. 2022-03-24 17:17:16 +00:00
Gaius Mulley
5e1d6d85ef Merge branch 'master' into devel/modula-2. 2022-03-16 20:32:32 +00:00
Gaius Mulley
cecd72c6eb Corrected documentation concerning scaffold file name (-fmakeinit).
2022-03-08  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/ChangeLog:

	* doc/gm2.texi (Building a shared library): Corrected
	scaffold filename automatically	generated via -fmakeinit
	in the libtool example.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-03-08 22:01:47 +00:00
q
c684b7809e M2Quads.mod allow TSIZE and TBITSIZE to calculate size of pointers.
This patch allows TSIZE (ptr^) irrespective of the value of ptr.
It also allows TBITSIZE (ptr^).  It extends the solution in the
implementation of SIZE for both TBITSIZE and TSIZE.

gcc/m2/ChangeLog:

	* gm2-compiler/M2Quads.mod (BuildSizeCheckEnd): Extended to
	include TSize and TBitSize.  (BuildTSizeFunction) Call
	BuildSizeCheckEnd.  (BuildTBitSizeFunction) Call BuildSizeCheckEnd.

gcc/testsuite/gm2/ChangeLog:

	* pim/run/pass/testsize4.mod:  (New file).
	* pim/run/pass/testtbitsize.mod:  (New file).

Signed-off-by: <gaius.mulley@southwales.ac.uk>
2022-03-04 18:27:11 +00:00
q
11470d2c21 Added gcc/m2/configure.ac tests for Python3 and realpath.
gcc/m2/ChangeLog:

      * m2/configure.ac: Added rule to test for Python3.  Added
      rule to detect realpath.

Signed-off-by: <gaius.mulley@southwales.ac.uk>
2022-03-02 22:27:45 +00:00
q
8df4f2c9f5 Bugfix ensure that the scaffold source is kept if -fmakeinit present.
gcc/ChangeLog:

	* m2/m2-link-support.h (GEN_SCAFFOLD_SRC): New definition.
	(M2LINK) use GEN_SCAFFOLD_SRC to generate the scaffold name.

Signed-off-by: <gaius.mulley@southwales.ac.uk>
2022-03-02 18:46:13 +00:00
q
7714b511fc Merge branch 'master' into devel/modula-2. 2022-03-02 17:31:45 +00:00
Gaius Mulley
80fe93e644 Corrected month dates for the latest commit.
gcc/m2/ChangeLog:

	* ChangeLog: Correct month for last commit.

libgm2/Changelog:

	* ChangeLog: Correct month for last commit.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-03-02 15:27:21 +00:00
Gaius Mulley
e20252827b Added change entries to the gcc/m2/ChangeLog and libgm2/ChangeLog.
Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-03-02 14:28:43 +00:00
Gaius Mulley
961f687cb2 Added gcc/m2/ChangeLog-2021 generated via git log.
gcc/m2/ChangeLog:

	* ChangeLog-2021: (New file).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-03-02 14:23:33 +00:00
Gaius Mulley
e51baa548c Provide putenv, fix incorrect scaffold deletion and update all ChangeLogs.
Putenv, execv introduced into libc, Environment and SEnvironment.
Fixed bug which deleted the scaffold if -fmakeinit was specified.

gcc/m2/ChangeLog:

	* gm2-libs/Args.def (GetArg): Corrected formatting.
	* gm2-libs/Environment.def (GetEnvironment): Renamed parameter
	a to dest.  (PutEnvironment) New procedure function.
	* gm2-libs/Environment.mod (GetEnvironment): Renamed parameter
	a to dest.  (PutEnvironment) New procedure function.
	* gm2-libs/SEnvironment.def (GetEnvironment): Renamed parameter
	a to dest.  (PutEnvironment) New procedure function.
	* gm2-libs/SEnvironment.mod  (GetEnvironment): Renamed parameter
	a to dest.  (PutEnvironment) New procedure function.
	* gm2-libs/libc.def: Export list introduced identifiers putenv,
	execv.
	* m2/m2-link-support.h: Ensure that the scaffold program
	is not deleted if the user specified -fmakeinit.
	* mc-boot-ch/Glibc.c (libc_putenv): New function.

libgm2/ChangeLog:

	* libm2pim/sckt.c (tcpServerEstablishPort): Corrected spelling.
	(tcpServerEstablish) Corrected spelling.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-03-02 14:07:32 +00:00
Gaius Mulley
4a83a112c2 Merge branch 'master' into devel/modula-2. 2022-02-14 16:59:10 +00:00
Gaius Mulley
a211188aea Merge branch 'master' into devel/modula-2. 2022-02-05 12:52:12 +00:00
Gaius Mulley
7cbd60d58f Merge branch 'master' into devel/modula-2. 2022-01-29 11:10:52 +00:00
Gaius Mulley
5f6e0d8f3a PR-101391 gm2 testsuite now contains basic link to C symbol tests.
This patch provides basic link tests to the C modules used by the pim
library which must exist in the Modula-2 symbol universe if pimlib is used.

libgm2/ChangeLog:

	* libgm2/libm2pim/Selective.c (_M2_Selective_finish): Added
	newline prior to function start.

gcc/testsuite/gm2/ChangeLog:

	* pimc/pass/README: (New file).
	* pimc/pass/link-pimc-pass.exp: (New file).
	* pimc/pass/testdtoa.mod: (New file).
	* pimc/pass/testerrno.mod: (New file).
	* pimc/pass/testgetopt.mod: (New file).
	* pimc/pass/testldtoa.mod: (New file).
	* pimc/pass/testlibc.mod: (New file).
	* pimc/pass/testlibc2.mod: (New file).
	* pimc/pass/testsckt.mod: (New file).
	* pimc/pass/testselective.mod: (New file).
	* pimc/pass/testsysexceptions.mod: (New file).
	* pimc/pass/testtermios.mod: (New file).
	* pimc/pass/testunixargs.mod: (New file).
	* pimc/pass/testwrapc.mod: (New file).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-01-28 16:02:07 +00:00
Gaius Mulley
faff2e5af1 cgetopt.c correct symbol names to reflect module stem.
This patch corrects the symbol names within cgetopt which mimics
a Modula-2 module.  The external symbols must be named in the same
way module_variablename, module_functionname or module_typename as gm2.

libgm2/ChangeLog:

	* libm2pim/cgetopt.c (getopt_Options_s): Renamed to
	getopt_Options_s.  (getopt_Options) Renamed as cgetopt_Options.
	(getopt_InitOptions) Renamed as cgetopt_InitOptions.
	(getopt_KillOptions) Renamed as cgetopt_KillOptions.
	(getopt_SetOption) Renamed as cgetopt_SetOption.
	(getopt_GetLongOptionArray) Renamed as cgetopt_GetLongOptionArray.
	(_M2_getopt_init) Renamed as c_M2_getopt_init.
	(_M2_getopt_finish) Renamed as c_M2_getopt_finish.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-01-26 17:23:49 +00:00
Gaius Mulley
07395a6e22 Merge branch 'master' into devel/modula-2. 2022-01-25 18:57:32 +00:00
Gaius Mulley
183c123117 gcc.cc externs used by front ends prefixed by fe.
This patch converts external symbols provided by gcc.cc to
front end drivers to be prefixed by fe_.  It is largely cosmetic
but provides clarify over which symbols are required by front
end drivers.

gcc/ChangeLog:

	* gcc/gcc.cc: (xputenv) Reinstated static declaration.
	Capitalized comment start.  (xgetenv) Reinstated static
	declaration.  (fe_putenv) New function.  (fe_getenv) New function.
	(save_switch) Reinstated static declaration.
	(fe_save_switch) New function.
	(fe_add_linker_option) Added header comment.
	(handle_OPT_B) Renamed to handle_opt_b.  (fe_handle_opt_b)
	New function.
	* gcc/gcc.h: (save_switch) Replaced by fe_save_switch.
	(handle_OPT_B) Replaced by fe_handle_opt_b.  (xputenv)
	Replaced by fe_putenv.  (xgetenv) Replaced by fe_getenv.

gcc/m2/ChangeLog:

	* gm2spec.cc: Replaced save_switch by fe_save_switch.
	Replaced xputenv by fe_putenv.  Replaced xgetenv by fe_getenv.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-01-25 18:13:06 +00:00
Gaius Mulley
d08981bfd0 Modula-2 bootstrap parameter passing type equivalence bugfix.
This patch removes the unnecesary casts when pointers are passed
as parameters, when pointers are assigned and when constants are
assigned to designators.

gcc/m2/ChangeLog:

	* mc/decl.mod: (isZtypeEquivalent) New procedure function.
	(isEquivalentType) New procedure function.  (doExprCastC)
	Added header comment and check for type equivalence.
	(needsCast) Added header comment and skip types for
	the formal and actual parameters before comparison.
	Add check for actual = nil parameter. (checkSystemCast)
	check for actual = nil being passed to a pointer parameter.
	* mc-boot/GArgs.c: Rebuilt.
	* mc-boot/GCmdArgs.c: Rebuilt.
	* mc-boot/GDebug.c: Rebuilt.
	* mc-boot/GDynamicStrings.c: Rebuilt.
	* mc-boot/GEnvironment.c: Rebuilt.
	* mc-boot/GFIO.c: Rebuilt.
	* mc-boot/GFormatStrings.c: Rebuilt.
	* mc-boot/GIO.c: Rebuilt.
	* mc-boot/GIndexing.c: Rebuilt.
	* mc-boot/GM2RTS.c: Rebuilt.
	* mc-boot/GNumberIO.c: Rebuilt.
	* mc-boot/GPushBackInput.c: Rebuilt.
	* mc-boot/GRTExceptions.c: Rebuilt.
	* mc-boot/GRTint.c: Rebuilt.
	* mc-boot/GStdIO.c: Rebuilt.
	* mc-boot/GStrCase.c: Rebuilt.
	* mc-boot/GStrIO.c: Rebuilt.
	* mc-boot/GStrLib.c: Rebuilt.
	* mc-boot/GStringConvert.c: Rebuilt.
	* mc-boot/GSysStorage.c: Rebuilt.
	* mc-boot/GTimeString.c: Rebuilt.
	* mc-boot/Galists.c: Rebuilt.
	* mc-boot/Gdecl.c: Rebuilt.
	* mc-boot/Gkeyc.c: Rebuilt.
	* mc-boot/Glists.c: Rebuilt.
	* mc-boot/GmcComment.c: Rebuilt.
	* mc-boot/GmcError.c: Rebuilt.
	* mc-boot/GmcLexBuf.c: Rebuilt.
	* mc-boot/GmcMetaError.c: Rebuilt.
	* mc-boot/GmcOptions.c: Rebuilt.
	* mc-boot/GmcPretty.c: Rebuilt.
	* mc-boot/GmcPrintf.c: Rebuilt.
	* mc-boot/GmcSearch.c: Rebuilt.
	* mc-boot/GmcStack.c: Rebuilt.
	* mc-boot/Gmcp1.c: Rebuilt.
	* mc-boot/Gmcp2.c: Rebuilt.
	* mc-boot/Gmcp3.c: Rebuilt.
	* mc-boot/Gmcp4.c: Rebuilt.
	* mc-boot/Gmcp5.c: Rebuilt.
	* mc-boot/GnameKey.c: Rebuilt.
	* mc-boot/GsymbolKey.c: Rebuilt.
	* mc-boot/Gvarargs.c: Rebuilt.
	* mc-boot/Gwlists.c: Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-01-23 15:47:41 +00:00
Gaius Mulley
dce2ffd510 Modula-2 bootstrap type equivalence shortcircuit bugfix.
Use getExprType rather than getType in decl.mod (doReturnC) to avoid
the generation of unnecessary type casts.

gcc/m2/ChangeLog:

	* mc/decl.mod: (doReturnC) Use getExprType rather than getType.
	(getExprType) Added header comment.
	* mc-boot/GCmdArgs.c: Rebuilt.
	* mc-boot/GDynamicStrings.c: Rebuilt.
	* mc-boot/GFIO.c: Rebuilt.
	* mc-boot/GFormatStrings.c: Rebuilt.
	* mc-boot/GFpuIO.c: Rebuilt.
	* mc-boot/GIO.c: Rebuilt.
	* mc-boot/GIndexing.c: Rebuilt.
	* mc-boot/GM2EXCEPTION.c: Rebuilt.
	* mc-boot/GM2RTS.c: Rebuilt.
	* mc-boot/GNumberIO.c: Rebuilt.
	* mc-boot/GPushBackInput.c: Rebuilt.
	* mc-boot/GRTExceptions.c: Rebuilt.
	* mc-boot/GRTint.c: Rebuilt.
	* mc-boot/GSArgs.c: Rebuilt.
	* mc-boot/GSFIO.c: Rebuilt.
	* mc-boot/GStorage.c: Rebuilt.
	* mc-boot/GStrCase.c: Rebuilt.
	* mc-boot/GStrIO.c: Rebuilt.
	* mc-boot/GStrLib.c: Rebuilt.
	* mc-boot/GStringConvert.c: Rebuilt.
	* mc-boot/GSysStorage.c: Rebuilt.
	* mc-boot/Galists.c: Rebuilt.
	* mc-boot/Gdecl.c: Rebuilt.
	* mc-boot/Gkeyc.c: Rebuilt.
	* mc-boot/Glists.c: Rebuilt.
	* mc-boot/GmcComment.c: Rebuilt.
	* mc-boot/GmcComp.c: Rebuilt.
	* mc-boot/GmcError.c: Rebuilt.
	* mc-boot/GmcFileName.c: Rebuilt.
	* mc-boot/GmcLexBuf.c: Rebuilt.
	* mc-boot/GmcMetaError.c: Rebuilt.
	* mc-boot/GmcOptions.c: Rebuilt.
	* mc-boot/GmcPreprocess.c: Rebuilt.
	* mc-boot/GmcPretty.c: Rebuilt.
	* mc-boot/GmcPrintf.c: Rebuilt.
	* mc-boot/GmcSearch.c: Rebuilt.
	* mc-boot/GmcStack.c: Rebuilt.
	* mc-boot/GmcStream.c: Rebuilt.
	* mc-boot/Gmcp1.c: Rebuilt.
	* mc-boot/Gmcp2.c: Rebuilt.
	* mc-boot/Gmcp3.c: Rebuilt.
	* mc-boot/Gmcp4.c: Rebuilt.
	* mc-boot/Gmcp5.c: Rebuilt.
	* mc-boot/GnameKey.c: Rebuilt.
	* mc-boot/GsymbolKey.c: Rebuilt.
	* mc-boot/Gvarargs.c: Rebuilt.
	* mc-boot/Gwlists.c: Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-01-22 16:33:05 +00:00
Gaius Mulley
51bc4b8156 PR-104065 Modula-2 front end changes to build with CXX.
gcc/m2/ChangeLog:

	* mc-boot-ch/Gabort.c: (New file).
	* Make-lang.in: Use $(CXX) rather than $(CC).  Use $(CC) rather
	than $(HOSTCC) when compiling mcflex.c.  Invoke $(M2LINK) with
	--langc++ rather than --g++.  (MCC_ARGS) changed to use
	--olang=c++.  (m2/ppg$(exeext)) link with Gabort.o and make
	dependant upon Gabort.o.  (m2/pg$(exeext)) link with Gabort.o
	and make dependant upon Gabort.o.  (m2/pge$(exeext)) link with
	Gabort.o and make dependant upon Gabort.o.  (gm2-check-examples)
	Removed.
	* gm2-ici/m2linemap.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/README: Reformatted.
	* gm2-libs-ch/RTcodummy.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/RTintdummy.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/Selective.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/SysExceptions.c: Introduce extern C for complete
	source file.
	* gm2-libs-ch/UnixArgs.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/UnixArgs.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/cgetopt.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/choosetemp.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/dtoa.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/errno.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/host.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/ldtoa.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/termios.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/tools.c: Reformatted source.
	* gm2-libs-ch/wrapc.c: Introduce extern C for complete source
	file.
	* gm2-libs-ch/xlibc.c: Introduce extern C for complete source
	file.
	* mc-boot-ch/GBuiltins.c: Introduce extern C for complete source
	file.
	* mc-boot-ch/GRTco.c: Introduce extern C for complete source
	file.
	* mc-boot-ch/GSYSTEM.c: Introduce extern C for complete source
	file.
	* mc-boot-ch/GSelective.c: Introduce extern C for complete source
	file.
	* mc-boot-ch/GSysExceptions.c: Introduce extern C for complete
	source file.
	* mc-boot-ch/GUnixArgs.c: Introduce extern C for complete source
	file.
	* mc-boot-ch/Gdtoa.c: Introduce extern C for complete source
	file.
	* mc-boot-ch/Gerrno.c: Introduce extern C for complete source
	file.
	* mc-boot-ch/Gldtoa.c: Introduce extern C for complete source
	file.
	* mc-boot-ch/Glibc.c: Introduce extern C for complete source
	file.
	* mc-boot-ch/Gmcrts.c: Removed fancy_abort. Introduce extern C for
	complete source file.
	* mc-boot-ch/Gtermios.c: Introduce extern C for complete source
	file.
	* mc-boot-ch/Gwrapc.c: Introduce extern C for complete source
	file.
	* mc-boot/GASCII.c: Rebuilt.
	* mc-boot/GASCII.h: Rebuilt.
	* mc-boot/GArgs.c: Rebuilt.
	* mc-boot/GArgs.h: Rebuilt.
	* mc-boot/GAssertion.c: Rebuilt.
	* mc-boot/GAssertion.h: Rebuilt.
	* mc-boot/GBreak.c: Rebuilt.
	* mc-boot/GBreak.h: Rebuilt.
	* mc-boot/GCOROUTINES.h: Rebuilt.
	* mc-boot/GCmdArgs.c: Rebuilt.
	* mc-boot/GCmdArgs.h: Rebuilt.
	* mc-boot/GDebug.c: Rebuilt.
	* mc-boot/GDebug.h: Rebuilt.
	* mc-boot/GDynamicStrings.c: Rebuilt.
	* mc-boot/GDynamicStrings.h: Rebuilt.
	* mc-boot/GEnvironment.c: Rebuilt.
	* mc-boot/GEnvironment.h: Rebuilt.
	* mc-boot/GFIO.c: Rebuilt.
	* mc-boot/GFIO.h: Rebuilt.
	* mc-boot/GFormatStrings.c Rebuilt.:
	* mc-boot/GFormatStrings.h: Rebuilt.
	* mc-boot/GFpuIO.c: Rebuilt.
	* mc-boot/GFpuIO.h: Rebuilt.
	* mc-boot/GIO.c: Rebuilt.
	* mc-boot/GIO.h: Rebuilt.
	* mc-boot/GIndexing.c: Rebuilt.
	* mc-boot/GIndexing.h: Rebuilt.
	* mc-boot/GM2EXCEPTION.c: Rebuilt.
	* mc-boot/GM2EXCEPTION.h: Rebuilt.
	* mc-boot/GM2RTS.c: Rebuilt.
	* mc-boot/GM2RTS.h: Rebuilt.
	* mc-boot/GMemUtils.c: Rebuilt.
	* mc-boot/GMemUtils.h: Rebuilt.
	* mc-boot/GNumberIO.c: Rebuilt.
	* mc-boot/GNumberIO.h: Rebuilt.
	* mc-boot/GPushBackInput.c: Rebuilt.
	* mc-boot/GPushBackInput.h: Rebuilt.
	* mc-boot/GRTExceptions.c: Rebuilt.
	* mc-boot/GRTExceptions.h: Rebuilt.
	* mc-boot/GRTco.h: Rebuilt.
	* mc-boot/GRTint.c: Rebuilt.
	* mc-boot/GRTint.h: Rebuilt.
	* mc-boot/GSArgs.c: Rebuilt.
	* mc-boot/GSArgs.h: Rebuilt.
	* mc-boot/GSFIO.c: Rebuilt.
	* mc-boot/GSFIO.h: Rebuilt.
	* mc-boot/GSYSTEM.h: Rebuilt.
	* mc-boot/GSelective.h: Rebuilt.
	* mc-boot/GStdIO.c: Rebuilt.
	* mc-boot/GStdIO.h: Rebuilt.
	* mc-boot/GStorage.c: Rebuilt.
	* mc-boot/GStorage.h: Rebuilt.
	* mc-boot/GStrCase.c: Rebuilt.
	* mc-boot/GStrCase.h: Rebuilt.
	* mc-boot/GStrIO.c: Rebuilt.
	* mc-boot/GStrIO.h: Rebuilt.
	* mc-boot/GStrLib.c: Rebuilt.
	* mc-boot/GStrLib.h: Rebuilt.
	* mc-boot/GStringConvert.c: Rebuilt.
	* mc-boot/GStringConvert.h: Rebuilt.
	* mc-boot/GSysExceptions.h: Rebuilt.
	* mc-boot/GSysStorage.c: Rebuilt.
	* mc-boot/GSysStorage.h: Rebuilt.
	* mc-boot/GTimeString.c: Rebuilt.
	* mc-boot/GTimeString.h: Rebuilt.
	* mc-boot/GUnixArgs.h: Rebuilt.
	* mc-boot/Galists.c: Rebuilt.
	* mc-boot/Galists.h: Rebuilt.
	* mc-boot/Gdecl.c: Rebuilt.
	* mc-boot/Gdecl.h: Rebuilt.
	* mc-boot/Gdtoa.h: Rebuilt.
	* mc-boot/Gerrno.h: Rebuilt.
	* mc-boot/Gkeyc.c: Rebuilt.
	* mc-boot/Gkeyc.h: Rebuilt.
	* mc-boot/Gldtoa.h: Rebuilt.
	* mc-boot/Glibc.h: Rebuilt.
	* mc-boot/Glibm.h: Rebuilt.
	* mc-boot/Glists.c: Rebuilt.
	* mc-boot/Glists.h: Rebuilt.
	* mc-boot/GmcComment.c: Rebuilt.
	* mc-boot/GmcComment.h: Rebuilt.
	* mc-boot/GmcComp.c: Rebuilt.
	* mc-boot/GmcComp.h: Rebuilt.
	* mc-boot/GmcDebug.c: Rebuilt.
	* mc-boot/GmcDebug.h: Rebuilt.
	* mc-boot/GmcError.c: Rebuilt.
	* mc-boot/GmcError.h: Rebuilt.
	* mc-boot/GmcFileName.c: Rebuilt.
	* mc-boot/GmcFileName.h: Rebuilt.
	* mc-boot/GmcLexBuf.c: Rebuilt.
	* mc-boot/GmcLexBuf.h: Rebuilt.
	* mc-boot/GmcMetaError.c: Rebuilt.
	* mc-boot/GmcMetaError.h: Rebuilt.
	* mc-boot/GmcOptions.c: Rebuilt.
	* mc-boot/GmcOptions.h: Rebuilt.
	* mc-boot/GmcPreprocess.c: Rebuilt.
	* mc-boot/GmcPreprocess.h: Rebuilt.
	* mc-boot/GmcPretty.c: Rebuilt.
	* mc-boot/GmcPretty.h: Rebuilt.
	* mc-boot/GmcPrintf.c: Rebuilt.
	* mc-boot/GmcPrintf.h: Rebuilt.
	* mc-boot/GmcQuiet.c: Rebuilt.
	* mc-boot/GmcQuiet.h: Rebuilt.
	* mc-boot/GmcReserved.c: Rebuilt.
	* mc-boot/GmcReserved.h: Rebuilt.
	* mc-boot/GmcSearch.c: Rebuilt.
	* mc-boot/GmcSearch.h: Rebuilt.
	* mc-boot/GmcStack.c: Rebuilt.
	* mc-boot/GmcStack.h: Rebuilt.
	* mc-boot/GmcStream.c: Rebuilt.
	* mc-boot/GmcStream.h: Rebuilt.
	* mc-boot/Gmcflex.h: Rebuilt.
	* mc-boot/Gmcp1.c: Rebuilt.
	* mc-boot/Gmcp1.h: Rebuilt.
	* mc-boot/Gmcp2.c: Rebuilt.
	* mc-boot/Gmcp2.h: Rebuilt.
	* mc-boot/Gmcp3.c: Rebuilt.
	* mc-boot/Gmcp3.h: Rebuilt.
	* mc-boot/Gmcp4.c: Rebuilt.
	* mc-boot/Gmcp4.h: Rebuilt.
	* mc-boot/Gmcp5.c: Rebuilt.
	* mc-boot/Gmcp5.h: Rebuilt.
	* mc-boot/GnameKey.c: Rebuilt.
	* mc-boot/GnameKey.h: Rebuilt.
	* mc-boot/GsymbolKey.c: Rebuilt.
	* mc-boot/GsymbolKey.h: Rebuilt.
	* mc-boot/Gtermios.h: Rebuilt.
	* mc-boot/Gtop.c: Rebuilt.
	* mc-boot/Gvarargs.c: Rebuilt.
	* mc-boot/Gvarargs.h: Rebuilt.
	* mc-boot/Gwlists.c: Rebuilt.
	* mc-boot/Gwlists.h: Rebuilt.
	* mc-boot/Gwrapc.h: Rebuilt.
	* mc/decl.mod: (returnT) scope field added.  (makeReturn)
	initialize scope field.  (doReturnC) check scope field and
	generate error if expression exists and no return type specified.
	Call doExprCastC to cast the return expression.
	(outDefC) Call keyc.genConfigSystem before entering extern C
	block.  (outImpC) Call keyc.genConfigSystem prior to keyc.genDefs.
	(outModuleC) Call keyc.genConfigSystem prior to keyc.genDefs.
	* mc/keyc.def: (genConfigSystem) exported.
	* mc/varargs.mod: (copy) Rewritten pointer arithmetic to allow for
	Modula-2 and translated C++ versions to compile cleanly.
	* tools-src/mklink.c: Replace option --gcc with --langc.  Replace
	option --g++ with --langc++.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-01-22 00:30:08 +00:00
Gaius Mulley
77bed20166 Missing patch for hwint.h, removal of the __cplusplus guard.
gcc/ChangeLog:

	* gcc/hwint.h: Missing patch applied.
	Removal of the __cplusplus guard.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-01-21 20:46:56 +00:00
Gaius Mulley
027bcf0b7f Merge branch 'master' into devel/modula-2. 2022-01-21 20:38:21 +00:00
Gaius Mulley
2525979b7b Correct module name component in global symbols.
2022-20-20  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

libgm2/ChangeLog:

	* cgetopt.c: Replace all occurrences of getopt_ with
	cgetopt_ to conform to the Modula-2 naming scheme.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-01-20 16:53:04 +00:00
Gaius Mulley
c4d5b401d1 Merge branch 'master' into devel/modula-2. 2022-01-20 12:42:15 +00:00
Gaius Mulley
6d7456f841 Renamed .c files into .cc.
gcc/m2/ChangeLog:

	* m2/Make-lang.in: (gm2spec.o) Use gm2spec.cc source
	file.
	(plugin/m2rte$(exeext).so) Use m2/plugin/m2rte.cc
	source file.
	(m2/gm2-gcc/%.o) Use .cc rather than .c source files.
	(m2/stor-layout.o) Build from stor-layout.cc rather than
	stor-layout.c.
	* m2/config-lang.in: Renamed all .c files to .cc files.
	* m2/gm2-gcc/init.cc: Remamed from m2/gm2-gcc/init.c.
	* m2/gm2-gcc/init.h: Summary name change.
	* m2/gm2-gcc/m2assert.cc: Remamed from
	m2/gm2-gcc/m2assert.c.
	* gm2-gcc/m2assert.h: Summary name change.
	* m2/gm2-gcc/m2block.cc: Renamed from
	m2/gm2-gcc/m2block.c.
	* m2/gm2-gcc/m2block.def: Summary name change.
	* gcc/m2/gm2-gcc/m2block.h: Summary name change.
	* m2/gm2-gcc/m2builtins.cc: Renamed from
	m2/gm2-gcc/m2builtins.c.
	* m2/gm2-gcc/m2builtins.def: Summary name change.
	* m2/gm2-gcc/m2builtins.h: Summary name change.
	* m2/gm2-gcc/m2color.cc: Renamed from
	m2/gm2-gcc/m2color.c.
	* m2/gm2-gcc/m2convert.cc: Renamed from
	m2/gm2-gcc/m2convert.c.
	* m2/gm2-gcc/m2convert.def: Summary name change.
	* m2/gm2-gcc/m2convert.h: Summary name change.
	* m2/gm2-gcc/m2decl.cc: Renamed from m2/gm2-gcc/m2decl.c.
	* m2/gm2-gcc/m2decl.def: Summary name change.
	* m2/gm2-gcc/m2decl.h: Summary name change.
	* m2/gm2-gcc/m2except.cc: Renamed from
	m2/gm2-gcc/m2except.c.
	* m2/gm2-gcc/m2except.h: Summary name change.
	* m2/gm2-gcc/m2expr.cc: Renamed from m2/gm2-gcc/m2expr.c.
	* m2/gm2-gcc/m2expr.def: Summary name change.
	* m2/gm2-gcc/m2expr.h: Summary name change.
	* m2/gm2-gcc/m2linemap.cc: Renamed from
	m2/gm2-gcc/m2linemap.c.
	* m2/gm2-gcc/m2linemap.h: Summary name change.
	* m2/gm2-gcc/m2misc.cc: Renamed from m2/gm2-gcc/m2misc.c.
	* m2/gm2-gcc/m2misc.def: Summary name change.
	* m2/gm2-gcc/m2misc.h: Summary name change.
	* m2/gm2-gcc/m2statement.cc: Renamed from
	m2/gm2-gcc/m2statement.c.
	* m2/gm2-gcc/m2statement.def: Summary name change.
	* m2/gm2-gcc/m2statement.h: Summary name change.
	* m2/gm2-gcc/m2top.cc: Renamed from m2/gm2-gcc/m2top.c.
	* m2/gm2-gcc/m2top.def: Summary name change.
	* m2/gm2-gcc/m2top.h: Summary name change.
	* m2/gm2-gcc/m2tree.cc: Renamed from m2/gm2-gcc/m2tree.c.
	* m2/gm2-gcc/m2tree.def: Summary name change.
	* m2/gm2-gcc/m2tree.h: Summary name change.
	* m2/gm2-gcc/m2treelib.cc: Renamed from
	m2/gm2-gcc/m2treelib.c.
	* m2/gm2-gcc/m2treelib.def: Summary name change.
	* m2/gm2-gcc/m2treelib.h: Summary name change.
	* m2/gm2-gcc/m2type.cc: Renamed from m2/gm2-gcc/m2type.c.
	* m2/gm2-gcc/m2type.def: Summary name change.
	* m2/gm2-gcc/m2type.h: Summary name change.
	* m2/gm2-gcc/rtegraph.cc: Renamed from
	m2/gm2-gcc/rtegraph.c.
	* m2/gm2-lang.cc: Renamed from m2/gm2-lang.c.
	* m2/gm2spec.cc: Renamed from m2/gm2spec.c.
	* m2/plugin/m2rte.cc: Renamed from m2/plugin/m2rte.c.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-01-18 13:51:58 +00:00
Gaius Mulley
252a99461a Merge branch 'master' into devel/modula-2. 2022-01-18 13:47:47 +00:00
Gaius Mulley
3d864fce4b Year date changes for Modula-2 source tree.
gcc/m2/ChangeLog:

	* m2/COPYING.FDL: Update copyright notice dates.
	* m2/COPYING.RUNTIME: Update copyright notice dates.
	* m2/Make-lang.in: Update copyright notice dates.
	* m2/bnf/gm2l.bnf: Update copyright notice dates.
	* m2/bnf/gm2m.bnf: Update copyright notice dates.
	* m2/bnf/m2-1.bnf: Update copyright notice dates.
	* m2/bnf/m2-2.bnf: Update copyright notice dates.
	* m2/bnf/m2-3.bnf: Update copyright notice dates.
	* m2/bnf/m2-c.bnf: Update copyright notice dates.
	* m2/bnf/m2-h.bnf: Update copyright notice dates.
	* m2/bnf/m2.bnf: Update copyright notice dates.
	* m2/bnf/mc-1.bnf: Update copyright notice dates.
	* m2/bnf/mc-2.bnf: Update copyright notice dates.
	* m2/bnf/mc-3.bnf: Update copyright notice dates.
	* m2/bnf/mc-4.bnf: Update copyright notice dates.
	* m2/bnf/mc-5.bnf: Update copyright notice dates.
	* m2/config-lang.in: Update copyright notice dates.
	* m2/configure.ac: Update copyright notice dates.
	* m2/gm2-compiler/CLexBuf.def: Update copyright notice dates.
	* m2/gm2-compiler/CLexBuf.mod: Update copyright notice dates.
	* m2/gm2-compiler/FifoQueue.def: Update copyright notice dates.
	* m2/gm2-compiler/FifoQueue.mod: Update copyright notice dates.
	* m2/gm2-compiler/Lists.def: Update copyright notice dates.
	* m2/gm2-compiler/Lists.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2ALU.def: Update copyright notice dates.
	* m2/gm2-compiler/M2ALU.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2AsmUtil.def: Update copyright notice dates.
	* m2/gm2-compiler/M2AsmUtil.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Base.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Base.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2BasicBlock.def: Update copyright notice dates.
	* m2/gm2-compiler/M2BasicBlock.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Batch.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Batch.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Bitset.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Bitset.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2CaseList.def: Update copyright notice dates.
	* m2/gm2-compiler/M2CaseList.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Check.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Check.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Code.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Code.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2ColorString.def: Update copyright notice dates.
	* m2/gm2-compiler/M2ColorString.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Comp.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Comp.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Configure.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Configure.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Const.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Const.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Debug.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Debug.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2DebugStack.def: Update copyright notice dates.
	* m2/gm2-compiler/M2DebugStack.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Defaults.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Defaults.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Depth.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Depth.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2DriverOptions.def: Update copyright notice dates.
	* m2/gm2-compiler/M2DriverOptions.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Emit.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Emit.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Error.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Error.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2EvalSym.def: Update copyright notice dates.
	* m2/gm2-compiler/M2FileName.def: Update copyright notice dates.
	* m2/gm2-compiler/M2FileName.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2GCCDeclare.def: Update copyright notice dates.
	* m2/gm2-compiler/M2GCCDeclare.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2GenGCC.def: Update copyright notice dates.
	* m2/gm2-compiler/M2GenGCC.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Lex.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Lex.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2LexBuf.def: Update copyright notice dates.
	* m2/gm2-compiler/M2LexBuf.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2MetaError.def: Update copyright notice dates.
	* m2/gm2-compiler/M2MetaError.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Optimize.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Optimize.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Options.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Options.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Pass.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Pass.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Preprocess.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Preprocess.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Printf.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Printf.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Quads.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Quads.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Quiet.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Quiet.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Range.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Range.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Reserved.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Reserved.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2SSA.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Scope.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Scope.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Search.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Search.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Size.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Size.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2StackAddress.def: Update copyright notice dates.
	* m2/gm2-compiler/M2StackAddress.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2StackWord.def: Update copyright notice dates.
	* m2/gm2-compiler/M2StackWord.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Students.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Students.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Swig.def: Update copyright notice dates.
	* m2/gm2-compiler/M2Swig.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2System.def: Update copyright notice dates.
	* m2/gm2-compiler/M2System.mod: Update copyright notice dates.
	* m2/gm2-compiler/M2Version.def: Update copyright notice dates.
	* m2/gm2-compiler/NameKey.def: Update copyright notice dates.
	* m2/gm2-compiler/NameKey.mod: Update copyright notice dates.
	* m2/gm2-compiler/ObjectFiles.def: Update copyright notice dates.
	* m2/gm2-compiler/ObjectFiles.mod: Update copyright notice dates.
	* m2/gm2-compiler/Output.def: Update copyright notice dates.
	* m2/gm2-compiler/Output.mod: Update copyright notice dates.
	* m2/gm2-compiler/P0SymBuild.def: Update copyright notice dates.
	* m2/gm2-compiler/P0SymBuild.mod: Update copyright notice dates.
	* m2/gm2-compiler/P0SyntaxCheck.def: Update copyright notice dates.
	* m2/gm2-compiler/P1Build.def: Update copyright notice dates.
	* m2/gm2-compiler/P1SymBuild.def: Update copyright notice dates.
	* m2/gm2-compiler/P1SymBuild.mod: Update copyright notice dates.
	* m2/gm2-compiler/P2Build.def: Update copyright notice dates.
	* m2/gm2-compiler/P2SymBuild.def: Update copyright notice dates.
	* m2/gm2-compiler/P2SymBuild.mod: Update copyright notice dates.
	* m2/gm2-compiler/P3Build.def: Update copyright notice dates.
	* m2/gm2-compiler/P3SymBuild.def: Update copyright notice dates.
	* m2/gm2-compiler/P3SymBuild.mod: Update copyright notice dates.
	* m2/gm2-compiler/PCBuild.def: Update copyright notice dates.
	* m2/gm2-compiler/PCSymBuild.def: Update copyright notice dates.
	* m2/gm2-compiler/PCSymBuild.mod: Update copyright notice dates.
	* m2/gm2-compiler/PHBuild.def: Update copyright notice dates.
	* m2/gm2-compiler/Sets.def: Update copyright notice dates.
	* m2/gm2-compiler/Sets.mod: Update copyright notice dates.
	* m2/gm2-compiler/SymbolConversion.def: Update copyright notice dates.
	* m2/gm2-compiler/SymbolConversion.mod: Update copyright notice dates.
	* m2/gm2-compiler/SymbolKey.def: Update copyright notice dates.
	* m2/gm2-compiler/SymbolKey.mod: Update copyright notice dates.
	* m2/gm2-compiler/SymbolTable.def: Update copyright notice dates.
	* m2/gm2-compiler/SymbolTable.mod: Update copyright notice dates.
	* m2/gm2-compiler/bnflex.def: Update copyright notice dates.
	* m2/gm2-compiler/bnflex.mod: Update copyright notice dates.
	* m2/gm2-compiler/cflex.def: Update copyright notice dates.
	* m2/gm2-compiler/gm2.mod: Update copyright notice dates.
	* m2/gm2-compiler/gm2lcc.mod: Update copyright notice dates.
	* m2/gm2-compiler/gm2lgen.mod: Update copyright notice dates.
	* m2/gm2-compiler/gm2lorder.mod: Update copyright notice dates.
	* m2/gm2-compiler/m2flex.def: Update copyright notice dates.
	* m2/gm2-compiler/ppg.mod: Update copyright notice dates.
	* m2/gm2-gcc/dynamicstrings.h: Update copyright notice dates.
	* m2/gm2-gcc/gcc-consolidation.h: Update copyright notice dates.
	* m2/gm2-gcc/init.c: Update copyright notice dates.
	* m2/gm2-gcc/init.def: Update copyright notice dates.
	* m2/gm2-gcc/init.h: Update copyright notice dates.
	* m2/gm2-gcc/m2assert.c: Update copyright notice dates.
	* m2/gm2-gcc/m2assert.h: Update copyright notice dates.
	* m2/gm2-gcc/m2block.c: Update copyright notice dates.
	* m2/gm2-gcc/m2block.def: Update copyright notice dates.
	* m2/gm2-gcc/m2block.h: Update copyright notice dates.
	* m2/gm2-gcc/m2builtins.c: Update copyright notice dates.
	* m2/gm2-gcc/m2builtins.def: Update copyright notice dates.
	* m2/gm2-gcc/m2builtins.h: Update copyright notice dates.
	* m2/gm2-gcc/m2color.c: Update copyright notice dates.
	* m2/gm2-gcc/m2color.def: Update copyright notice dates.
	* m2/gm2-gcc/m2color.h: Update copyright notice dates.
	* m2/gm2-gcc/m2convert.c: Update copyright notice dates.
	* m2/gm2-gcc/m2convert.def: Update copyright notice dates.
	* m2/gm2-gcc/m2convert.h: Update copyright notice dates.
	* m2/gm2-gcc/m2decl.c: Update copyright notice dates.
	* m2/gm2-gcc/m2decl.def: Update copyright notice dates.
	* m2/gm2-gcc/m2decl.h: Update copyright notice dates.
	* m2/gm2-gcc/m2except.c: Update copyright notice dates.
	* m2/gm2-gcc/m2except.def: Update copyright notice dates.
	* m2/gm2-gcc/m2except.h: Update copyright notice dates.
	* m2/gm2-gcc/m2expr.c: Update copyright notice dates.
	* m2/gm2-gcc/m2expr.def: Update copyright notice dates.
	* m2/gm2-gcc/m2expr.h: Update copyright notice dates.
	* m2/gm2-gcc/m2linemap.c: Update copyright notice dates.
	* m2/gm2-gcc/m2linemap.def: Update copyright notice dates.
	* m2/gm2-gcc/m2linemap.h: Update copyright notice dates.
	* m2/gm2-gcc/m2misc.c: Update copyright notice dates.
	* m2/gm2-gcc/m2misc.def: Update copyright notice dates.
	* m2/gm2-gcc/m2misc.h: Update copyright notice dates.
	* m2/gm2-gcc/m2options.h: Update copyright notice dates.
	* m2/gm2-gcc/m2range.h: Update copyright notice dates.
	* m2/gm2-gcc/m2search.h: Update copyright notice dates.
	* m2/gm2-gcc/m2statement.c: Update copyright notice dates.
	* m2/gm2-gcc/m2statement.def: Update copyright notice dates.
	* m2/gm2-gcc/m2statement.h: Update copyright notice dates.
	* m2/gm2-gcc/m2top.c: Update copyright notice dates.
	* m2/gm2-gcc/m2top.def: Update copyright notice dates.
	* m2/gm2-gcc/m2top.h: Update copyright notice dates.
	* m2/gm2-gcc/m2tree.c: Update copyright notice dates.
	* m2/gm2-gcc/m2tree.def: Update copyright notice dates.
	* m2/gm2-gcc/m2tree.h: Update copyright notice dates.
	* m2/gm2-gcc/m2treelib.c: Update copyright notice dates.
	* m2/gm2-gcc/m2treelib.def: Update copyright notice dates.
	* m2/gm2-gcc/m2treelib.h: Update copyright notice dates.
	* m2/gm2-gcc/m2type.c: Update copyright notice dates.
	* m2/gm2-gcc/m2type.def: Update copyright notice dates.
	* m2/gm2-gcc/m2type.h: Update copyright notice dates.
	* m2/gm2-gcc/rtegraph.c: Update copyright notice dates.
	* m2/gm2-gcc/rtegraph.h: Update copyright notice dates.
	* m2/gm2-internals.texi: Update copyright notice dates.
	* m2/gm2-lang.c: Update copyright notice dates.
	* m2/gm2-lang.h: Update copyright notice dates.
	* m2/gm2-libs-ch/RTcodummy.c: Update copyright notice dates.
	* m2/gm2-libs-ch/RTintdummy.c: Update copyright notice dates.
	* m2/gm2-libs-ch/Selective.c: Update copyright notice dates.
	* m2/gm2-libs-ch/SysExceptions.c: Update copyright notice dates.
	* m2/gm2-libs-ch/UnixArgs.c: Update copyright notice dates.
	* m2/gm2-libs-ch/cgetopt.c: Update copyright notice dates.
	* m2/gm2-libs-ch/choosetemp.c: Update copyright notice dates.
	* m2/gm2-libs-ch/dtoa.c: Update copyright notice dates.
	* m2/gm2-libs-ch/errno.c: Update copyright notice dates.
	* m2/gm2-libs-ch/host.c: Update copyright notice dates.
	* m2/gm2-libs-ch/ldtoa.c: Update copyright notice dates.
	* m2/gm2-libs-ch/pthdummy.c: Update copyright notice dates.
	* m2/gm2-libs-ch/termios.c: Update copyright notice dates.
	* m2/gm2-libs-ch/tools.c: Update copyright notice dates.
	* m2/gm2-libs-ch/wrapc.c: Update copyright notice dates.
	* m2/gm2-libs-ch/xlibc.c: Update copyright notice dates.
	* m2/gm2-libs-coroutines/Debug.def: Update copyright notice dates.
	* m2/gm2-libs-coroutines/Debug.mod: Update copyright notice dates.
	* m2/gm2-libs-coroutines/Executive.def: Update copyright notice dates.
	* m2/gm2-libs-coroutines/Executive.mod: Update copyright notice dates.
	* m2/gm2-libs-coroutines/KeyBoardLEDs.def: Update copyright notice dates.
	* m2/gm2-libs-coroutines/README.texi: Update copyright notice dates.
	* m2/gm2-libs-coroutines/SYSTEM.def: Update copyright notice dates.
	* m2/gm2-libs-coroutines/SYSTEM.mod: Update copyright notice dates.
	* m2/gm2-libs-coroutines/TimerHandler.def: Update copyright notice dates.
	* m2/gm2-libs-coroutines/TimerHandler.mod: Update copyright notice dates.
	* m2/gm2config.h.in: Update copyright notice dates.
	* m2/gm2spec.c: Update copyright notice dates.
	* m2/gm2version.h: Update copyright notice dates.
	* m2/lang-options.h: Update copyright notice dates.
	* m2/lang-specs.h: Update copyright notice dates.
	* m2/lang.opt: Update copyright notice dates.
	* m2/m2-link-support.h: Update copyright notice dates.
	* m2/m2-tree.def: Update copyright notice dates.
	* m2/m2-tree.h: Update copyright notice dates.
	* m2/m2.flex: Update copyright notice dates.
	* m2/m2pp.c: Update copyright notice dates.
	* m2/m2pp.h: Update copyright notice dates.
	* m2/mc-boot-ch/GBuiltins.c: Update copyright notice dates.
	* m2/mc-boot-ch/GRTco.c: Update copyright notice dates.
	* m2/mc-boot-ch/GSYSTEM.c: Update copyright notice dates.
	* m2/mc-boot-ch/GSelective.c: Update copyright notice dates.
	* m2/mc-boot-ch/GSysExceptions.c: Update copyright notice dates.
	* m2/mc-boot-ch/GUnixArgs.c: Update copyright notice dates.
	* m2/mc-boot-ch/Gcbuiltin.c: Update copyright notice dates.
	* m2/mc-boot-ch/Gdtoa.c: Update copyright notice dates.
	* m2/mc-boot-ch/Gerrno.c: Update copyright notice dates.
	* m2/mc-boot-ch/Gldtoa.c: Update copyright notice dates.
	* m2/mc-boot-ch/Glibc.c: Update copyright notice dates.
	* m2/mc-boot-ch/Glibm.c: Update copyright notice dates.
	* m2/mc-boot-ch/Gmcrts.c: Update copyright notice dates.
	* m2/mc-boot-ch/Gmcrts.h: Update copyright notice dates.
	* m2/mc-boot-ch/Gnetwork.h: Update copyright notice dates.
	* m2/mc-boot-ch/Gpth.c: Update copyright notice dates.
	* m2/mc-boot-ch/Gtermios.c: Update copyright notice dates.
	* m2/mc-boot-ch/Gwrapc.c: Update copyright notice dates.
	* m2/mc-boot-ch/network.c: Update copyright notice dates.
	* m2/mc/Indexing.def: Update copyright notice dates.
	* m2/mc/Indexing.mod: Update copyright notice dates.
	* m2/mc/alists.def: Update copyright notice dates.
	* m2/mc/alists.mod: Update copyright notice dates.
	* m2/mc/decl.def: Update copyright notice dates.
	* m2/mc/decl.mod: Update copyright notice dates.
	* m2/mc/keyc.def: Update copyright notice dates.
	* m2/mc/keyc.mod: Update copyright notice dates.
	* m2/mc/lists.def: Update copyright notice dates.
	* m2/mc/lists.mod: Update copyright notice dates.
	* m2/mc/m2flex.def: Update copyright notice dates.
	* m2/mc/mc.flex: Update copyright notice dates.
	* m2/mc/mcComment.def: Update copyright notice dates.
	* m2/mc/mcComment.h: Update copyright notice dates.
	* m2/mc/mcComment.mod: Update copyright notice dates.
	* m2/mc/mcComp.def: Update copyright notice dates.
	* m2/mc/mcComp.mod: Update copyright notice dates.
	* m2/mc/mcDebug.def: Update copyright notice dates.
	* m2/mc/mcDebug.mod: Update copyright notice dates.
	* m2/mc/mcError.def: Update copyright notice dates.
	* m2/mc/mcError.mod: Update copyright notice dates.
	* m2/mc/mcFileName.def: Update copyright notice dates.
	* m2/mc/mcFileName.mod: Update copyright notice dates.
	* m2/mc/mcLexBuf.def: Update copyright notice dates.
	* m2/mc/mcLexBuf.h: Update copyright notice dates.
	* m2/mc/mcLexBuf.mod: Update copyright notice dates.
	* m2/mc/mcMetaError.def: Update copyright notice dates.
	* m2/mc/mcMetaError.mod: Update copyright notice dates.
	* m2/mc/mcOptions.def: Update copyright notice dates.
	* m2/mc/mcOptions.mod: Update copyright notice dates.
	* m2/mc/mcPreprocess.def: Update copyright notice dates.
	* m2/mc/mcPreprocess.mod: Update copyright notice dates.
	* m2/mc/mcPretty.def: Update copyright notice dates.
	* m2/mc/mcPretty.mod: Update copyright notice dates.
	* m2/mc/mcPrintf.def: Update copyright notice dates.
	* m2/mc/mcPrintf.mod: Update copyright notice dates.
	* m2/mc/mcQuiet.def: Update copyright notice dates.
	* m2/mc/mcQuiet.mod: Update copyright notice dates.
	* m2/mc/mcReserved.def: Update copyright notice dates.
	* m2/mc/mcReserved.h: Update copyright notice dates.
	* m2/mc/mcReserved.mod: Update copyright notice dates.
	* m2/mc/mcSearch.def: Update copyright notice dates.
	* m2/mc/mcSearch.mod: Update copyright notice dates.
	* m2/mc/mcStack.def: Update copyright notice dates.
	* m2/mc/mcStack.mod: Update copyright notice dates.
	* m2/mc/mcStream.def: Update copyright notice dates.
	* m2/mc/mcStream.mod: Update copyright notice dates.
	* m2/mc/mcflex.def: Update copyright notice dates.
	* m2/mc/mcp1.def: Update copyright notice dates.
	* m2/mc/mcp2.def: Update copyright notice dates.
	* m2/mc/mcp3.def: Update copyright notice dates.
	* m2/mc/mcp4.def: Update copyright notice dates.
	* m2/mc/mcp5.def: Update copyright notice dates.
	* m2/mc/nameKey.def: Update copyright notice dates.
	* m2/mc/nameKey.mod: Update copyright notice dates.
	* m2/mc/symbolKey.def: Update copyright notice dates.
	* m2/mc/symbolKey.mod: Update copyright notice dates.
	* m2/mc/top.mod: Update copyright notice dates.
	* m2/mc/varargs.def: Update copyright notice dates.
	* m2/mc/varargs.mod: Update copyright notice dates.
	* m2/mc/wlists.def: Update copyright notice dates.
	* m2/mc/wlists.mod: Update copyright notice dates.
	* m2/tools-src/array2index.py: Update copyright notice dates.
	* m2/tools-src/boilerplate.py: Update copyright notice dates.
	* m2/tools-src/buildpg: Update copyright notice dates.
	* m2/tools-src/buildsyntax: Update copyright notice dates.
	* m2/tools-src/calcpath: Update copyright notice dates.
	* m2/tools-src/createUlmSys: Update copyright notice dates.
	* m2/tools-src/def2texi.py: Update copyright notice dates.
	* m2/tools-src/gensum.py: Update copyright notice dates.
	* m2/tools-src/incfile: Update copyright notice dates.
	* m2/tools-src/makeSystem: Update copyright notice dates.
	* m2/tools-src/makeconfigure: Update copyright notice dates.
	* m2/tools-src/makeversion: Update copyright notice dates.
	* m2/tools-src/mklink.c: Update copyright notice dates.
	* m2/tools-src/tidydates.py: Update copyright notice dates.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-01-18 12:43:14 +00:00
Gaius Mulley
e6e2c18a77 Merge branch 'master' into devel/modula-2. 2022-01-13 17:57:29 +00:00
Gaius Mulley
c6cdf493ee Fix to parallel builds by adding dependencies to gcc/m2/Make-lang.in.
gcc/m2/ChangeLog:

	* Make-lang.in (m2/gm2spec.o): Added $(LIBS) to the dependants.
	(stage1/m2/gm2l): Added $(LIBS) to the dependants.
	(stage1/m2/gm2lcc): Added $(LIBS) to the dependants.
	(stage1/m2/gm2lgen): Added $(LIBS) to the dependants.
	(stage1/m2/gm2lorder): Added $(LIBS) to the dependants.
	(stage1/m2/gm2m): Added $(LIBS) to the dependants.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2022-01-11 19:21:06 +00:00
Gaius Mulley
a126471588 Merge branch 'master' into devel/modula-2. 2022-01-06 20:49:48 +00:00
Gaius Mulley
b34dbb71fb m2/mc/decl.mod: Added missing comments and a bugfix for doMakeEnumField.
This patch fixes a bug in doMakeEnumField and implements
	some missing code resulting in two --fixme--'s being removed.
	It also contains comments prior to procedure declarations.

gcc/m2/ChangeLog:

	* mc/decl.mod: Added missing comments to many procedures.
	(getStringContents) Completed missing code removing a --fixme--.
	(getLiteralStringContents) New procedure function.
	(doMakeEnumField) Return f even if an error should occur.
	* m2/mc-boot/Gdecl.c: Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2022-01-04 13:12:04 +00:00
Gaius Mulley
b917f555c3 Merge branch 'master' into devel/modula-2. 2021-12-31 08:54:21 +00:00
Gaius Mulley
3431b882d9 Fixes to bootstrap resulting in m2 lto building/passing regression tests [PR93575].
These changes fix indirect procedure calls in the bootstrap tool
	mc which were exposed by lto.  The result is that gm2 can be built
	using profiled lto and all regression tests pass on the amd64
	platform.

gcc/m2/ChangeLog:

	* gm2-gcc/m2expr.def: Use FOR "C" keyword and ident.
	* mc-boot/GRTExceptions.c: Rebuilt.
	* mc-boot/GSArgs.c: Rebuilt.
	* mc-boot/Gdecl.c: Rebuilt.
	* mc-boot/Glibc.h: Rebuilt.
	* mc/decl.mod (varparamT): isForC new field.  (paramT) isForC new
	field.  (varargsT) isForC new field.  (putDefForC) Implemented.
	(makeNonVarParameter) assign isForC.  (makeVarParameter) Assign
	isForC. (getParameterVariable) ignore isDefForC.
	(doParamTypeEmit) New procedure.  (doParamC) Call doParamTypeEmit.
	(doVarParamC) call doParamTypeEmit.  (doCompletePartialProcType)
	Emit a C named type which differs from the m2 proctype.
	(doPrototypeC) Ignore isDefForC and extended opaque option.
	(doFuncUnbounded) Disable C string parameters.
	(doProcedureParamC) Handle isForC for a formal parameter.
	(isForC) New procedure function.  (isDefForCNode) New procedure
	function.  (doFuncParamC) Detect var param for a definition
	module for "C" proc type parameter and emit error message.
	Detect param for a definition module for "C" and reference the
	.proc field.  (outputPartialRecordArrayProcType) New procedure.
	(outputPartial) Rewritten.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-12-30 20:43:52 +00:00
Gaius Mulley
7f1006fd39 Bugfix assign currentScope during M2Error FlushAll.
gcc/m2/ChangeLog:

	* gm2-compiler/M2Error.mod (EnterProcedureScope): Corrected
	indentation.  (EnterModuleScope): Corrected
	indentation.  (EnterProgramScope): Corrected indentation.
	(EnterImplementationScope) Corrected indentation.
	(FlushAll) Assign currentScope to the error scope.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-12-25 21:10:48 +00:00
Gaius Mulley
7f91bb254c Bugfix to include spaces around error message and no scope active message.
gcc/m2/ChangeLog:

	* gm2-compiler/M2Error.mod (GetAnnounceScope): Issue
        "no scope active" message.  (AnnounceScope) Add ": "
	after the no scope active message.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-12-25 15:21:33 +00:00
Gaius Mulley
fa4a4a2ee5 Merge branch 'master' into devel/modula-2. 2021-12-25 12:50:01 +00:00
Gaius Mulley
966f05c85e Bugfixes for default scope, tidying up of code and neater error messages.
gcc/m2/ChangeLog:

	* m2/Make-lang.in (m2/gm2-compiler-boot/M2Error.o): New rule
	to build M2Error.o using the --entended-opaque option since
	M2Error.mod aggressively uses opaque data types.
	* bnf/m2-1.bnf (DefProcedureHeading) ensure DefaultProcedure
	scope is created before any further tokens are consumed.
	Call LeaveErrorScope at the end of the rule.
	* bnf/m2-2.bnf (DefProcedureHeading): Call LeaveErrorScope
	at the end of the rule.
	* bnf/m2-3.bnf (DefProcedureHeading): Call LeaveErrorScope
	at the end of the rule.
	* bnf/m2-c.bnf (DefProcedureHeading): Call LeaveErrorScope
	at the end of the rule.
	* bnf/m2-h.bnf (DefProcedureHeading): Call DefaultProcedure
	and the beginning and LeaveErrorScope at the end of the rule.
	* bnf/m2.bnf (DefProcedureHeading): Call DefaultProcedure
	and the beginning of the rule.
	* gm2-compiler/M2Comp.mod (M2Error): Import list replaced
	identifiers ParsingComplete; and ResetErrorScope;.
	* gm2-compiler/M2Error.def (NameKey): Renamed ParsingComplete to
	ResetErrorScope.  Call ResetErrorScope before each pass commenses.
	Import list replaced identifiers LeaveScope,
	ParsingComplete by EnterErrorScope, ErrorScope,
	GetCurrentErrorScope,
	(LeaveErrorScope): New procedure.  (ResetErrorScope): New
	procedure.  (LeaveScope) Removed.
	* gm2-compiler/M2Error.mod (M2Options): Import StackOfAddress.
	(printf2) Imported. (printf3) Imported.
	(IsErrorScopeNul): New procedure function.
	(GetAnnounceScope): Re-implementation.
	(IsSameScope): New procedure function.
	(AnnounceScope): Detect no scope.
	(newErrorScope): Use scopeArray to push a new scope.
	(DefaultProgramModule):  New implementation.
	(DefaultImplementationModule): New implementation.
	(DefaultDefinitionModule): New implementation.
	(DefaultInnerModule): New implementation.
	(GetCurrentErrorScope): New procedure function.
	* gm2-compiler/M2MetaError.def: Extend the specifiers to
	allow error contents to be pushed to a string stack;
	string stack contents to be popped onto the output string;
	replace dictionary string by the current output string and
	remove all contents in the dictionary.
	* gm2-compiler/M2MetaError.mod (addEntry) New procedure.
	(killEntry) New procedure function.
	(lookupDefine) New procedure function.
	(lookupString) New procedure function.
	(newEntry) New procedure function.
	(popOutput) New procedure function.
	(processDefine) New procedure.
	(pushOutput) New procedure function.
	(readWord) New procedure function.
	(resetDictionary) New procedure.
	(doErrorScopeMod) Enter error scope before
	generate an error.
	(doErrorScopeDef) Enter error scope before
	generate an error.
	(op): Handle 'Q', 'X', 'Y', 'Z' format directives.
	* gm2-compiler/M2Scope.mod (SymbolTable): Import list includes
	identifier GetErrorScope.
	(enter): Re-implemented.
	* gm2-compiler/M2StackWord.mod: Renamed data types so
	they are easier to debug during bootstrap (avoid name clashes
	with the M2StackAddress module).
	* gm2-compiler/P0SymBuild.mod (EndProcedure): Call
	LeaseErrorScope instead of LeaveScope at the end of the procedure.
	* gm2-compiler/P2SymBuild.mod (P2EndBuildDefModule): Call
	LeaseErrorScope instead of LeaveScope at the end of the procedure.
	(P2EndBuildImplementationModule): Call
	LeaseErrorScope instead of LeaveScope at the end of the procedure.
	(P2EndBuildProgramModule): Call
	LeaseErrorScope instead of LeaveScope at the end of the procedure.
	(EndBuildInnerModule): Call
	LeaseErrorScope instead of LeaveScope at the end of the procedure.
	(P3EndBuildImpModule): Call
	LeaseErrorScope instead of LeaveScope at the end of the procedure.
	(P3EndBuildProgModule): Call
	LeaseErrorScope instead of LeaveScope at the end of the procedure.
	(EndBuildInnerModule): Call
	LeaseErrorScope instead of LeaveScope at the end of the procedure.
	* gm2-compiler/PCSymBuild.mod (PCEndBuildDefModule): Call
	LeaseErrorScope instead of
	LeaveScope at the end of the procedure.
	(PCEndBuildImpModule): Call LeaseErrorScope instead of
	LeaveScope at the end of the procedure.
	(PCEndBuildProgModule): Call LeaseErrorScope instead of
	LeaveScope at the end of the procedure.
	(PCEndBuildInnerModule): Call LeaseErrorScope instead of
	LeaveScope at the end of the procedure.
	* gm2-compiler/SymbolKey.def (NoOfNodes): New procedure
	function.
	(ForeachNodeConditionDo) New procedure.
	* gm2-compiler/SymbolKey.mod (NoOfNodes): New procedure
	function.
	(ContainsSymKey): Call FindNodeParentInTree instead of
	FindNodeAndParentInTree.
	(GetSymKey): Call FindNodeParentInTree instead of
	FindNodeAndParentInTree.
	(DelSymKey): Call FindNodeParentInTree instead of
	FindNodeAndParentInTree.
	(FindNodeParentInTree): Renamed from FindNodeAndParentInTree.
	(IsEmptyTree): Reformatted.  (DoesTreeContainAny): Reformatted.
	(SearchForAny): Reformatted.  (ForeachNodeConditionDo) New
	procedure.  (SearchConditional) New procedure.
	* gm2-compiler/SymbolTable.def (GetErrorScope): New procedure
	function.  (PutErrorScope) New procedure.
	* gm2-compiler/SymbolTable.def (GetErrorScope): New procedure
	function implemented.  (PutErrorScope) New procedure implemented.
	(AddListify) New procedure.  (Listify) New procedure.
	(errorScope) field added to procedure, module, defimp
	symbols and initialized	during their construction.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-12-25 11:22:00 +00:00
Gaius Mulley
c9afa63c3b Merge branch 'master' into devel/modula-2. 2021-12-19 01:03:26 +00:00
Gaius Mulley
fd948137c5 Bug fixes for error scope announcement and error recovery.
2021-12-17  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* bnf/m2-1.bnf (ProgramModule): Set up DefaultProgramModule scope.
	(ImplementationModule) Set up DefaultImplementationModule scope.
	(ProcedureHeading) Set up DefaultProcedureScope.
	(ModuleDeclaration) Set up DefaultInnerModule scope.
	* bnf/m2-2.bnf (ProgramModule): Set up DefaultProgramModule scope.
	(ImplementationModule) Set up DefaultImplementationModule scope.
	(ProcedureHeading) Set up DefaultProcedureScope.
	(ModuleDeclaration) Set up DefaultInnerModule scope.
	* bnf/m2-3.bnf (ProgramModule): Set up DefaultProgramModule scope.
	(ImplementationModule) Set up DefaultImplementationModule scope.
	(ProcedureHeading) Set up DefaultProcedureScope.
	(ModuleDeclaration) Set up DefaultInnerModule scope.
	* bnf/m2-c.bnf (ProgramModule): Set up DefaultProgramModule scope.
	(ImplementationModule) Set up DefaultImplementationModule scope.
	(ProcedureHeading) Set up DefaultProcedureScope.
	(ModuleDeclaration) Set up DefaultInnerModule scope.
	* bnf/m2-h.bnf (ProgramModule): Set up DefaultProgramModule scope.
	(ImplementationModule) Set up DefaultImplementationModule scope.
	(ProcedureHeading) Set up DefaultProcedureScope.
	(ModuleDeclaration) Set up DefaultInnerModule scope.
	* bnf/m2.bnf (ProgramModule): Set up DefaultProgramModule scope.
	(ImplementationModule) Set up DefaultImplementationModule scope.
	(ProcedureHeading) Set up DefaultProcedureScope.
	(ModuleDeclaration) Set up DefaultInnerModule scope.  (WasNoError)
	replaced by seenError.  (Expect) reformatted.
	(CheckInsertCandiate) New procedure which replaces CheckAndInsert.
	(PeepToken) use CheckInsertCandiate.  (WarnMissingToken) generate
	a warning using %W.
	* gm2-compiler/M2Comp.mod (DefaultProgramModule): New procedure.
	(DefaultImplementationModule) New procedure.
	(DefaultDefinitionModule) New procedure.  (DefaultInnerModule)
	New procedure.  (DefaultProcedure) New procedure.
	(EnterImplementationScope) call LeaveScope if parsing.
	(EnterProgramScope) call LeaveScope if parsing.
	(EnterDefinitionScope) call LeaveScope if parsing.
	(EnterModuleScope) call LeaveScope if parsing.
	(EnterProcedureScope) call LeaveScope if parsing.
	(ParsingComplete) New procedure.
	* gm2-compiler/M2Comp.def (DefaultProgramModule): New procedure.
	(DefaultImplementationModule) New procedure.
	(DefaultDefinitionModule) New procedure.  (DefaultInnerModule)
	New procedure.  (DefaultProcedure) New procedure.
	(ParsingComplete) New procedure.
	* gm2-compiler/M2Error.def (DefaultProgramModule) New procedure.
	(DefaultImplementationModule) New procedure.
        (DefaultDefinitionModule) New procedure.  (DefaultInnerModule) New
	procedure.  (DefaultProcedure) New procedure.  (ParsingComplete)
	New procedure.
	* gm2-compiler/M2Error.mod (DefaultProgramModule) New procedure.
	(DefaultImplementationModule) New procedure.
        (DefaultDefinitionModule) New procedure.  (DefaultInnerModule) New
	procedure.  (DefaultProcedure) New procedure.  (ParsingComplete)
	New procedure.  (GetAnnounceScope) check to see scopeName is non
	null before using name.
	* gm2-compiler/M2LexBuf.def (NameKey): Import list replaced identifiers
	DisplayToken and DumpTokens.
	* gm2-compiler/M2LexBuf.mod (InsertToken)  Reimplemented.
	(InsertTokenAndRewind) Reimplemented.
	* gm2-compiler/M2MetaError.mod (doErrorScopeMod): setup
	DefaultScope before calling EnterScope.
	(doErrorScopeMod) (doErrorScopeDef): setup
	DefaultScope before calling EnterScope.
	* gm2-compiler/P0SymBuild.mod (RegisterProgramModule):
	Reformatted.  (RegisterImplementationModule) Reformatted.
	(RegisterDefinitionModule) Reformatted.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-12-17 12:35:08 +00:00
Gaius Mulley
d270aab6ff Merge branch 'master' into devel/modula-2.
Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-12-09 21:58:10 +00:00
Gaius Mulley
d9973d8e0b Merge branch 'master' into devel/modula-2. 2021-11-27 05:00:35 +00:00
Gaius Mulley
740db39124 Merge branch 'master' into devel/modula-2. 2021-11-19 18:29:13 +00:00
Gaius Mulley
016519cc0e Bug fix for error scope announcement and update git info in doc/gm2.texi.
2021-11-19  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/ChangeLog:

	* doc/gm2.texi: Updated the git url and git instructions.
	* gdbinit.in: Revert all Modula-2 debugging configuration.

gcc/m2/ChangeLog:

	* gm2-compiler/M2Error.mod (ChainError): Initialize scopeKind and
	scopeName.
	* gm2-compiler/M2Range.mod (CodeErrorCheckLoc): Added comment.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-11-19 15:14:18 +00:00
Gaius Mulley
c62f597484 Runtime errors emit errors using GCC scope heading and message style.
2021-11-18  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* gm2-compiler/M2Error.def (GetAnnounceScope): Exported.
	(AnnounceScope) changed to use an extra parameter message.
	* gm2-compiler/M2Error.mod (GetAnnounceScope): New procedure function.
	(AnnounceScope) Rewritten to use GetAnnounceScope.
	* gm2-compiler/M2Range.mod (M2Error): Added GetAnnounceScope to
	import list.  (CodeErrorCheckLoc) Rewritten to use GetAnnounceScope.
	* gm2-gcc/rtegraph.c (generate_report): Emit error message using
	the GCC	scope heading and message house style.
	* gm2-libs/RTExceptions.mod (Raise): Emit the message using the GCC
	scope heading and message house style.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-11-18 10:07:14 +00:00
Gaius Mulley
e61ec3e273 Generate scope headings prior to emitting error messages.
2021-11-16  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

ChangeLog:

	* Makefile.in : Rebuilt.
	* configure : Rebuilt.

gcc/m2/ChangeLog:

	* gm2-compiler/M2Error.def (NameKey): Imported identifier Name.
	(AnnounceScope) defined and exported.  (EnterDefinitionScope)
	defined and exported.  (EnterImplementationScope) defined and
	exported.  (EnterProcedureScope) defined and exported.
	(EnterProgramScope) defined and exported.  (EnterModuleScope)
	defined exported.  (LeaveScope) defined and exported.
	(DepthScope) defined and exported.
	* gm2-compiler/M2Error.mod (M2Debug): Import Assert.
	(M2StackWord) Import StackOfWord, InitStackWord, InitStackWord,
	NoOfItemsInStackWord, PopWord, and PushWord.
	(M2ColorString) Import quoteOpen and quoteClose.
	(M2Error) Added scopeKind.
	(ScopeBlock) Added scopeName and kindScope.
	(New) Reformatted.  (SetScope) New procedure.
	(AddToRange) call InitScopeBlock.  (GetGlobalQuads) Rewritten
	to call SetScope whether a new error scope occurs.  Ensure that
	scope starts when a new file starts and ends.
	(GetProcQuads) Rewritten to start and end error scope when procedure
	or module starts or ends.  (DisplayScope) rewritten to display the
	error scope.  (InitScopeBlock) initialize kindScope to unsetscope.
	(KillScopeBlock) Reformatted.  (ForeachScopeBlockDo) call enter
	and leave for every scope.  (enter) New procedure.  (leave)
	New procedure.
	* gm2-compiler/Output.mod (WriteKey) assign buffer to result
	of ConCat.  (StartBuffer) fixbug call InitString with an empty string.
	gm2-compiler/P0SymBuild.mod (M2Error): Imported.
	(RegisterProgramModule) call EnterProgramModule.
	(RegisterImplementationModule) call EnterImplementationScope.
	(RegisterInnerModule) call EnterModuleScope.  (RegisterProcedure)
	call EnterProcedureScope.  (EndModule) call LeaveScope.
	* gm2-compiler/P2SymBuild.mod (P2StartBuildDefModule) call
	EnterDefinitionScope.  (P2EndBuildDefModule) call LeaveScope.
	(P2StartBuildImplementationModule) call EnterImplementationScope.
	(P2StartBuildProgramModule) call EnterProgramScope.
	(P2EndBuildProgramModule) call LeaveScope.
	(StartBuildInnerModule) call EnterModuleScope.
	(EndBuildInnerModule) call LeaveScope.  (StartBuildProcedure)
	call EnterProcedureScope.  (EndBuildProcedure) call LeaveScope.
	* gm2-compiler/P3SymBuild.mod (P3StartBuildDefModule) call
	EnterDefinitionScope.  (P3EndBuildDefModule) call LeaveScope.
	(P3EndBuildImpModule) call LeaveScope.  (P3StartBuildProgModule)
	call EnterProgramScope.  (P3EndBuildProgModule) call LeaveScope.
	(StartBuildInnerModule) call EnterModuleScope.
	(EndBuildInnerModule) call LeaveScope.  (StartBuildProcedure)
	call EnterProcedureScope.  (EndBuildProcedure) call LeaveScope.
	(PCStartBuildDefModule) call EnterDefinitionScope.
	(PCEndBuildDefModule) call LeaveScope.  (PCStartBuildImpModule)
	call EnterImplementationScope.  (PCEndBuildImpModule) call
	LeaveScope.  (PCStartBuildProgModule) call EnterProgramScope.
	(PCEndBuildProgModule) call LeaveScope.  (PCStartBuildInnerModule)
	call EnterModuleScope.  (PCEndBuildInnerModule) call LeaveScope.
	(PCStartBuildProcedure) call EnterProcedureScope.
	(PCEndBuildProcedure) call LeaveScope.
	* gm2-compiler/SymbolTable.def (GetDeclaredDefinition) exported.
	(GetDeclaredModule) exported.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-11-16 23:19:23 +00:00
Gaius Mulley
416ca65d27 Merge branch 'master' into devel/modula-2. 2021-11-07 15:21:30 +00:00
Gaius Mulley
4f37535124 Merge branch 'master' into devel/modula-2. 2021-10-27 09:44:18 +01:00
Gaius Mulley
507c189745 Implement -save-temps.
gcc/m2/ChangeLog:

	* gm2-compiler/M2Options.def (m2linemap): Import list replaced
	identifiers SaveTemps, SetSaveTemps and SetSaveTempsDir.
	* gm2-compiler/M2Options.mod (SetSaveTemps): New procedure.
	Sets SaveTemps to value.
	(MakeSaveTempsFileName) New procedure which appends ".i" to
	filename.
	(PreprocessModule) Check SaveTemps to determine whether the
	temporary file should be deleted upon exit.
	(SetSaveTempsDir) Stub added.
	* gm2-gcc/m2options.h (SetSaveTemps): Prototype added.
	(SetSaveTempsDir) Prototype added.
	* gm2-lang.c (gm2_langhook_handle_option): Extended to
	include OP_save_temps and OP_save_temps_.
	* lang-options.h: Add -fsave-temps and -fsave-temps=.
	* lang-specs.h: Pass %{save-temps*} to cc1gm2.
	* lang.opt: Add -save-temps as an alias to save-temps.
	Add save-temps, add save-temps=.

ChangeLog:

	* m2tools/Makefile.in : Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-10-26 21:42:07 +01:00
Gaius Mulley
386e7057d7 Merge branch 'master' into devel/modula-2. 2021-10-19 23:57:06 +01:00
Gaius Mulley
595922b25a termios.c fix macro test for __MAX_BAUD.
gcc/m2/ChangeLog:

	* gm2-libs-ch/termios.c (GetFlag): Corrected macro test
	against absence of __MAX_BAUD.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-10-13 17:57:49 +01:00
Gaius Mulley
f737a5994d Bugfix for 102323 gm2 testsuite is now parallelized.
2021-10-13  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* m2/Make-lang.in (lang_checks_parallelized): Include check-gm2.
	(check_gm2_parallelize) Set to 10000.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-10-13 17:16:10 +01:00
Gaius Mulley
9513dbcb39 Bugfix for 102340 remove executable bits from source file permissions.
gcc/testsuite/gm2/ChangeLog:

	* All *.{def,mod,exp} files have any executable bit removed
	in their permissions bitset.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-10-13 14:27:54 +01:00
Gaius Mulley
d914a14e24 Bugfix for 102339 remove scaffold files after successful compilation.
gcc/m2/ChangeLog:

	* m2/m2-link-support.h (SCAFFOLDNAME): Add %d so scaffold files
	are removed when gcc finishes without error.

gm2tools/ChangeLog:

	* gm2tools/Makefile.in: Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-10-13 13:59:23 +01:00
Gaius Mulley
fafe664110 Renamed all gm2.exp testsuite driver scripts to use distinct names.
2021-10-12  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/testsuite/gm2/ChangeLog:

	* calling-c/datatypes/unbounded/run/pass/gm2.exp: Renamed to
	calling-c-datatypes-unbounded-run-pass.exp.
	* case/pass/gm2.exp: Renamed to case-pass.exp.
	* complex/pass/gm2.exp: Renamed as complex-pass.exp.
	* complex/run/pass/gm2.exp: Renamed as complex-run-pass.exp.
	* coroutines/pim/run/pass/gm2.exp: Remamed as
	coroutines-pim-run-pass.exp.
	* cpp/pass/gm2.exp: Renamed as cpp/pass/cpp-pass.exp.
	* cse/fail/gm2.exp: Renamed as cse/fail/cse-fail.exp.
	* cse/pass/gm2.exp: Renamed as cse/pass/cse-pass.exp.
	* dynamic/pass/gm2.exp: Renamed as
	dynamic/pass/dynamic-pass.exp.
	* embedded/pass/gm2.exp: Renamed as
	embedded/pass/embedded-pass.exp.
	* errors/fail/gm2.exp: Renamed as errors/fail/errors-fail.exp.
	* examples/callingC/pass/gm2.exp: Renamed as
	examples/callingC/pass/examples-callingC-pass.exp.
	* examples/callingC/run/pass/gm2.exp: Renamed as
	examples/callingC/run/pass/examples-callingC-run-pass.exp.
	* examples/cpp/pass/gm2.exp: Renamed as
	examples/cpp/pass/examples-cpp-pass.exp.
	* examples/cppDef/pass/gm2.exp: Renamed as
	examples/cppDef/pass/examples-cppDef-pass.exp.
	* examples/hello/pass/gm2.exp: Renamed as
	examples/hello/pass/examples-hello-pass.exp.
	* examples/map/pass/gm2.exp: Renamed as
	examples/map/pass/examples-map-pass.exp.
	* exceptions/run/pass/gm2.exp: Renamed as
	exceptions/run/pass/exceptions-run-pass.exp.
	* extensions/pass/gm2.exp: Renamed as
	extensions/pass/extensions-pass.exp.
	* extensions/run/fail/gm2.exp: Renamed as
	extensions/run/fail/extensions-run-fail.exp.
	* extensions/run/pass/gm2.exp: Renamed as
	extensions/run/pass/extensions-run-pass.exp.
	* fpu/pass/gm2.exp: Renamed as
	fpu/pass/fpu-pass.exp.
	* imports/run/pass/gm2.exp: Renamed as
	imports/run/pass/imports-run-pass.exp.
	* iso/analysis/fail/gm2.exp: Renamed as
	iso/analysis/fail/iso-analysis-fail.exp.
	* iso/check/fail/gm2.exp: Renamed as
	iso/check/fail/iso-check-fail.exp.
	* iso/fail/gm2.exp: Renamed as iso/fail/iso-fail.exp.
	* iso/pass/gm2.exp: Renamed as iso/pass/iso-pass.exp.
	* iso/run/pass/gm2.exp: Renamed as
	iso/run/pass/iso-run-pass.exp.
	* isocoroutines/run/pass/gm2.exp: Renamed as
	isocoroutines/run/pass/isocoroutines-run-pass.exp.
	* isolib/run/pass/gm2.exp: Renamed as
	isolib/run/pass/isolib-run-pass.exp.
	* link/pim/fail/gm2.exp: Renamed as
	link/pim/fail/link-pim-fail.exp.
	* link/pim/pass/gm2.exp: Renamed as
	link/pim/pass/link-pim-pass.exp.
	* linking/libarchive/pass/gm2.exp: Renamed as
	linking/libarchive/pass/linking-libarchive-pass.exp.
	* linking/verbose/pass/gm2.exp: Renamed as
	linking/verbose/pass/linking-verbose-pass.exp.
	* pim/fail/gm2.exp: Renamed as pim/fail/pim-fail.exp.
	* pim/no-options/run/pass/gm2.exp: Renamed as
	pim/no-options/run/pass/pim-no-options-run-pass.exp.
	* pim/options/bounds/fail/gm2.exp: Renamed as
	pim/options/bounds/fail/pim-options-bounds-fail.exp.
	* pim/options/optimize/run/pass/gm2.exp: Renamed as
	pim/options/optimize/run/pass/pim-options-optimize-run-pass.exp.
	* pim/pass/gm2.exp: Renamed as pim/pass/pim-pass.exp.
	* pim/run/fail/gm2.exp: Renamed as pim/run/fail/pim-run-fail.exp.
	* pim/run/pass/gm2.exp: Renamed as pim/run/pass/pim-run-pass.exp.
	* pimcoroutines/pass/gm2.exp: Renamed as
	pimcoroutines/pass/pimcoroutines-pass.exp.
	* pimcoroutines/run/pass/gm2.exp: Renamed as
	pimcoroutines/run/pass/pimcoroutines-run-pass.exp.
	* pimlib/base/run/pass/gm2.exp: Renamed as
	pimlib/base/run/pass/pimlib-base-run-pass.exp.
	* pimlib/coroutines/pass/gm2.exp: Renamed as
	pimlib/coroutines/pass/pimlib-coroutines-pass.exp.
	* pimlib/logitech/pass/gm2.exp: Renamed as
	pimlib/logitech/pass/pimlib-logitech-pass.exp.
	* pimlib/logitech/run/pass/gm2.exp: Renamed as
	pimlib/logitech/run/pass/pimlib-logitech-run-pass.exp.
	* pimlib/pass/gm2.exp: Renamed as pimlib/pass/pimlib-pass.exp.
	* pimlib/run/pass/gm2.exp: Renamed as
	pimlib/run/pass/pimlib-run-pass.exp.
	* quads/run/pass/gm2.exp: Renamed as
	quads/run/pass/quads-run-pass.exp.
	* sets/run/pass/gm2.exp: Renamed as
	sets/run/pass/sets-run-pass.exp.
	* switches/auto-init/fail/gm2.exp: Renamed as
	switches/auto-init/fail/switches-auto-init-fail.exp.
	* switches/check-all/pim2/fail/gm2.exp: Renamed as
	switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp.
	* switches/check-all/plugin/iso/fail/gm2.exp: Renamed as
	switches/check-all/plugin/iso/fail/switches-check-all-plugin-iso-fail.exp.
	* switches/check-all/plugin/pim2/fail/gm2.exp: Renamed as
	switches/check-all/plugin/pim2/fail/switches-check-all-plugin-pim2-fail.exp.
	* switches/check-all/run/fail/gm2.exp: Renamed as
	switches/check-all/run/fail/switches-check-all-run-fail.exp.
	* switches/check-all/run/pass/gm2.exp: Renamed as
	switches/check-all/run/pass/switches-check-all-run-pass.exp.
	* switches/extended-opaque/fail/gm2.exp: Renamed as
	switches/extended-opaque/fail/switches-extended-opaque-fail.exp.
	* switches/extended-opaque/pass/gm2.exp: Renamed as
	switches/extended-opaque/pass/switches-extended-opaque-pass.exp.
	* switches/iso/run/pass/gm2.exp: Renamed as
	switches/iso/run/pass/switches-iso-run-pass.exp.
	* switches/makeall/fail/gm2.exp: Renamed as
	switches/makeall/fail/switches-makeall-fail.exp.
	* switches/makeall/pass/gm2.exp: Renamed as
	switches/makeall/pass/switches-makeall-pass.exp.
	* switches/optimization/run/pass/gm2.exp: Renamed as
	switches/optimization/run/pass/switches-optimization-run-pass.exp.
	* switches/pedantic-params/fail/gm2.exp: Renamed as
	switches/pedantic-params/fail/switches-pedantic-params-fail.exp.
	* switches/pedantic-params/pass/gm2.exp: Renamed as
	switches/pedantic-params/pass/switches-pedantic-params-pass.exp.
	* switches/pic/run/pass/gm2.exp: Renamed as
	switches/pic/run/pass/switches-pic-run-pass.exp.
	* switches/pim2/run/pass/gm2.exp: Renamed as
	switches/pim2/run/pass/switches-pim2-run-pass.exp.
	* switches/pim3/run/pass/gm2.exp: Renamed as
	switches/pim3/run/pass/switches-pim3-run-pass.exp.
	* switches/pim4/run/pass/gm2.exp: Renamed as
	switches/pim4/run/pass/switches-pim4-run-pass.exp.
	* switches/whole-program/pass/run/gm2.exp: Renamed as
	switches/whole-program/pass/run/switches-whole-program-pass-run.exp.
	* types/run/pass/gm2.exp: Renamed as
	types/run/pass/types-run-pass.exp.
	* ulmlib/pass/gm2.exp: Renamed as
	ulmlib/pass/ulmlib-pass.exp.
	* ulmlib/std/pass/gm2.exp: Renamed as
	ulmlib/std/pass/ulmlib-std-pass.exp.
	* ulmlib/sys/pass/gm2.exp: Renamed as
	ulmlib/sys/pass/ulmlib-sys-pass.exp.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-10-12 23:41:29 +01:00
Gaius Mulley
d23f74ee5d M2GCCDeclare.mod, M2GenGCC.mod and M2Range.mod removal of unused parameters and variables.
2021-10-11  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* gm2-compiler/M2GCCDeclare.mod (mystop): Removed.
	(DebugSets): Commented out.
	(TryFindSymbol): Commented out.
	(DeclareTypePartially): Delete variable t and use Assert to test
	return values.
	(NotAllDependantsPartiallyOrFullyDeclared): Commented out.
	(DeclareTypeFromPartial): Commented out.
	(DeclarePointerTypeFully): Commented out.
	(ForeachTryDeclare): Remove unused parameters start and end.
	(DeclaredOutstandingTypes): Alter all calls to ForeachTryDeclare.
	(DeclareType): Alter all calls to ForeachTryDeclare.
	(DeclareStringConstant): Commented out.
	(PromoteToString): Use tokenno to derive location.
	(DeclareConstructor): Add location to a call to BuildStringConstant.
	(TryDeclareConstant): Delete variable tok introduce parameter tokenno.
	(DeclareConst):  Change all calls to BuildConvert to pass the
	location.
	(WalkFamilyOfUnbounded):  Add location to the calls of
	DeclareStringConstant.
	(WalkDependants): Reformatted.
	(PopBinding): Remove start, end quadruple values from
	ResolveConstantExpressions.
	(AssertAllTypesDeclared): delete variable  and use Assert to check
	return result.
	(DoVariableDeclaration): delete variables s and t.
	(DeclareImportedVariables): Remove call to AlignDeclarationWithSource.
	(DeclareLocalVariable): Remove call to AlignDeclarationWithSource.
	(DeclareEnumeration): Remove call to AlignDeclarationWithSource.
	(IncludeGetNth): Remove call to AlignDeclarationWithSource.
	(DeclarePackedSubrange): Reformatted.
	(WalkVarientDependants): Commented out.
	(BuildTreeFromInterface): replace variable location.
	* gm2-compiler/M2GenGCC.mod: (CodeInline):  Add tokenno to calls
	to BuildTreeFromInterface.
	(CodeAddr): Change call to BuildStringConstant to use location
	parameter.
	* gm2-compiler/M2MetaError.mod (InternalFormat): Generate error
	message using line number.
	(OutColorS): Commented out.
	(doGetType): Introduce safely check using HIGH.
	(doGetSkipType): Introduce safely check using HIGH.
	(ConCatWord): Commented out.
	(copySym): Commented out.
	* gm2-compiler/M2Quads.mod: Remove CheckRangeAddVariableRead and
	CheckRangeRemoveVariableRead from the import list.
	* gm2-compiler/M2Range.def (DynamicStrings): Import list commented
	out identifiers CheckRangeAddVariableRead, CheckRangeRemoveVariableRead.
	(CheckRangeAddVariableRead): Commented out.
	* gm2-compiler/M2Range.mod (InitAssignmentRangeCheck): Delete variable
	p and use Assert to check the return result.
	(InitReturnRangeCheck): Delete variable
	p and use Assert to check the return result.
	(InitSubrangeRangeCheck): Delete variable
	p and use Assert to check the return result.
	(InitStaticArraySubscriptRangeCheck): Delete variable
	p and use Assert to check the return result.
	(InitDynamicArraySubscriptRangeCheck): Delete variable
	p and use Assert to check the return result.
	(InitIncRangeCheck): Delete variable
	p and use Assert to check the return result.
	(InitDecRangeCheck): Delete variable
	p and use Assert to check the return result.
	(InitInclCheck): Delete variable
	p and use Assert to check the return result.
	(InitExclCheck): Delete variable
	p and use Assert to check the return result.
	(InitShiftCheck): Delete variable
	p and use Assert to check the return result.
	(InitRotateCheck): Delete variable
	p and use Assert to check the return result.
	(InitTypesAssignmentCheck): Delete variable
	p and use Assert to check the return result.
	(InitTypesParameterCheck): Delete variable
	p and use Assert to check the return result.
	(InitTypesExpressionCheck): Delete variable
	p and use Assert to check the return result.
	(InitForLoopBeginRangeCheck): Delete variable
	p and use Assert to check the return result.
	(InitForLoopToRangeCheck): Delete variable
	p and use Assert to check the return result.
	(InitForLoopEndRangeCheck): Delete variable
	p and use Assert to check the return result.
	(InitPointerRangeCheck): Delete variable
	p and use Assert to check the return result.
	(InitNoReturnRangeCheck): Delete variable
	p and use Assert to check the return result.
	(InitNoElseRangeCheck): Delete variable
	p and use Assert to check the return result.
	(InitWholeNonPosDivCheck): Delete variable
	p and use Assert to check the return result.
	(InitWholeNonPosModCheck): Delete variable
	p and use Assert to check the return result.
	(InitWholeZeroDivisionCheck): Delete variable
	p and use Assert to check the return result.
	(FoldNil): Delete variable
	p and use Assert to check the return result.
	(FoldTypeExpr): Delete variable
	p and use Assert to check the return result.
	(CodeTypeExpr): Delete variable
	p and use Assert to check the return result.
	(FoldForLoopBegin): Delete variable
	p and use Assert to check the return result.
	(MakeAndDeclareConstLit): Delete variable
	p and use Assert to check the return result.
	(FoldNonPosMod): Delete variable
	p and use Assert to check the return result.
	(FoldZeroDiv): Delete variable
	p and use Assert to check the return result.
	(FoldZeroRem): Delete variable
	p and use Assert to check the return result.
	(FoldRangeCheck): Delete variable
	p and use Assert to check the return result.
	(CodeErrorCheck): Delete variable
	p and use Assert to check the return result.
	(CodeInclExcl): Delete variable
	p and use Assert to check the return result.
	(DiffTypesCodeForLoopEnd): Delete variable
	p and use Assert to check the return result.
	(DiffTypesCodeForLoopEnd): Delete variable
	p and use Assert to check the return result.
	(CodeNil): Delete variable
	p and use Assert to check the return result.
	(CodeWholeZero): Delete variable
	p and use Assert to check the return result.
	(InitCaseBounds): Delete variable
	p and use Assert to check the return result.
	(AddVarRead): Delete variable
	p and use Assert to check the return result.
	(SubVarRead): Delete variable
	p and use Assert to check the return result.
	(CheckRangeAddVariableRead): Delete variable
	p and use Assert to check the return result.
	(CheckRangeRemoveVariableRead): Delete variable
	p and use Assert to check the return result.
	(WriteRangeCheck): Delete variable
	p and use Assert to check the return result.
	* gm2-gcc/m2decl.c: (BuildStringConstant) add location parameter.
	* gm2-gcc/m2decl.def: (BuildStringConstant) add location parameter.
	* gm2-gcc/m2decl.h: (BuildStringConstant) add location parameter.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-10-11 20:12:19 +01:00
Gaius Mulley
8bb70f83e3 Merge branch 'devel/modula-2' of git+ssh://gcc.gnu.org/git/gcc into devel/modula-2 2021-10-08 15:01:48 +01:00
Gaius Mulley
65c5a20d6e Merge branch 'master' into devel/modula-2. 2021-10-08 15:00:53 +01:00
Gaius Mulley
5e2c046e06 M2GenGCC.mod huge tidyup and removal of unused parameters and variables.
2021-09-26  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

ChangeLog:

	* Makefile.in: Regenerated.

gcc/m2/ChangeLog:

	* gm2-compiler/M2GenGCC.mod (m2statement): Import list inserted
	identifier BuildFunctionCallTree.
	(ConvertQuadsToTree): Delete variable Prev.  Reformatted.
	(IsCompilingMainModule):  Reformatted.
	(CodeStatement): Remove unused parameters for many of the Code
	procedures.
	(ResolveConstantExpressions): Remove unused parameters for many of
	the Fold procedures.
	(CodeSaveException): replace variables exceptionCall and functValue.
	Use BuildFunctionCallTree to avoid an unused return result.
	(CodeRestoreException): Replace variables exceptionCall and
	functValue.  Use BuildFunctionCallTree to avoid an unused return result.
	(PopScope): Check return result.
	(CodeRange): Remove unused parameters.
	(CodeError): Remove unused parameters.
	(CodeStartModFile): Remove unused parameters.
	(CodeStartDefFile): Remove unused parameters and renamed existing
	parameters.
	(CodeEndFile): Remove unused parameters.
	(CodeInitStart): Remove unused parameters.
	(CodeInitStart): Reformatted.
	(CodeInitEnd): replace variables t and moduleTree.
	(CodeInitEnd): Reformatted.
	(CodeFinallyStart): Rewritten to remove unused parameters and
	renamed remaining parameters.
	(CodeFinallyEnd): replace variables t and moduleTree.
	(CodeFinallyEnd): Rewritten to remove unused parameters and
	renamed remaining parameters.
	(GetHighFromUnbounded): Commented out unused variable remainingDim.
	(MakeCopyUse): Insert variables Type and NewArray.  Reformatted.
	(BuildCascadedIfThenElsif): Reformatted.
	(CheckUnboundedNonVarParameter): Reformatted.
	(IsParameterWritten): Removed usused variable i.
	(AutoInitVariable): Removed usused variable i.
	(CodeNewLocalVar): Reformatted.
	(CodeKillLocalVar): Reformatted.
	(CodeProcedureScope): Reformatted.
	(CodeCall): Reformatted.
	(FoldBuiltin): Renamed parameter.
	(CodeFunctValue): Removed unused parameter.
	(CodeAddr): Removed unused parameter.
	(FoldBecomes): Delete variable t.  Removed unused parameter.
	(CodeTry): Removed all parameters.
	(CodeThrow): Removed unused parameters.
	(CodeCatchBegin): Reformatted.
	(checkDeclare): Reformatted and renamed parameters.  Removed
	unused parameters.
	(LValueToGenericPtr): Removed unused parameter and reformatted.
	(CodeAddCheck): Renamed parameters.
	(FoldSub): Renamed parameters.
	(CodeAddCheck): Renamed parameters.
	(CodeSubCheck): Renamed parameters.
	(FoldMult): Renamed parameters.
	(CodeSub): Renamed parameters.
	(CodeMultCheck): Rewritten and reformatted.
	(CodeDivM2Checked): Rewritten and reformatted.
	(CodeDivM2Check): Rewritten and reformatted.
	(CodeModM2Checked): Rewritten and reformatted.
	(CodeModM2Check): Rewritten and reformatted.
	(FoldDivM2): Rewritten and reformatted.
	(CodeDivM2): Rewritten and reformatted.
	(FoldModM2): Rewritten and reformatted.
	(FoldDivTrunc): Rewritten and reformatted.
	(FoldDivCeil): Rewritten and reformatted.
	(FoldDivFloor): Rewritten and reformatted.
	(FoldBuiltinConst): Rewritten and reformatted.
	(FoldBuiltinTypeInfo): Rewritten and reformatted.
	(CodeStandardFunction): Rewritten and reformatted.
	(CodeSavePriority): Rewritten and reformatted.
	(CodeRestorePriority): Rewritten and reformatted.
	(CodeUnarySet): Rewritten and reformatted.
	(FoldIfIn): Rewritten and reformatted.
	(GetSetLimits): Rewritten and reformatted.
	(CodeIncl): Rewritten and reformatted.
	(CodeExcl): Rewritten and reformatted.
	(FoldUnary): Rewritten and reformatted.
	(FoldUnarySet): Rewritten and reformatted.
	(CodeUnaryCheck): Rewritten and reformatted.
	(CodeUnary): Rewritten and reformatted.
	(CodeNegateChecked): Rewritten and reformatted.
	(CodeSize): Rewritten and reformatted.
	(FoldRecordField): Delete variables location and t.
	(BuildHighFromArray): Rewritten and reformatted.
	(BuildHighFromStaticArray): Rewritten and reformatted.
	(ResolveHigh): Rewritten and reformatted.
	(FoldHigh): Rewritten and reformatted.
	(CodeArray): Rewritten and reformatted.
	(FoldElementSizeForArray): Rewritten and reformatted.
	(FoldElementSizeForUnbounded): Rewritten and reformatted.
	(FoldConvert): Rewritten and reformatted.
	(CodeIfNotEqu): Rewritten and reformatted.
	(MixTypes3): Rewritten and reformatted.
	(AddQuadInformation): Rewritten and reformatted.
	(UndoReadWriteInfo): Rewritten and reformatted.
	(WriteQuad): Rewritten and reformatted.
	* gm2-gcc/m2statement.c (BuildFunctionCallTree): New function.
	* gm2-gcc/m2statement.def (BuildFunctionCallTree): New function.
	* gm2-gcc/m2statement.h (BuildFunctionCallTree): New function.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-10-08 15:00:36 +01:00
Gaius Mulley
8559a6cdfa M2GenGCC.mod huge tidyup and removal of unused parameters and variables.
2021-09-26  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

ChangeLog:

	* Makefile.in: Regenerated.

gcc/m2/ ChangeLog:

	* gm2-compiler/M2GenGCC.mod (m2statement): Import list inserted
	identifier BuildFunctionCallTree.
	(ConvertQuadsToTree): Delete variable Prev.  Reformatted.
	(IsCompilingMainModule):  Reformatted.
	(CodeStatement): Remove unused parameters for many of the Code
	procedures.
	(ResolveConstantExpressions): Remove unused parameters for many of
	the Fold procedures.
	(CodeSaveException): replace variables exceptionCall and functValue.
	Use BuildFunctionCallTree to avoid an unused return result.
	(CodeRestoreException): Replace variables exceptionCall and
	functValue.  Use BuildFunctionCallTree to avoid an unused return result.
	(PopScope): Check return result.
	(CodeRange): Remove unused parameters.
	(CodeError): Remove unused parameters.
	(CodeStartModFile): Remove unused parameters.
	(CodeStartDefFile): Remove unused parameters and renamed existing
	parameters.
	(CodeEndFile): Remove unused parameters.
	(CodeInitStart): Remove unused parameters.
	(CodeInitStart): Reformatted.
	(CodeInitEnd): replace variables t and moduleTree.
	(CodeInitEnd): Reformatted.
	(CodeFinallyStart): Rewritten to remove unused parameters and
	renamed remaining parameters.
	(CodeFinallyEnd): replace variables t and moduleTree.
	(CodeFinallyEnd): Rewritten to remove unused parameters and
	renamed remaining parameters.
	(GetHighFromUnbounded): Commented out unused variable remainingDim.
	(MakeCopyUse): Insert variables Type and NewArray.  Reformatted.
	(BuildCascadedIfThenElsif): Reformatted.
	(CheckUnboundedNonVarParameter): Reformatted.
	(IsParameterWritten): Removed usused variable i.
	(AutoInitVariable): Removed usused variable i.
	(CodeNewLocalVar): Reformatted.
	(CodeKillLocalVar): Reformatted.
	(CodeProcedureScope): Reformatted.
	(CodeCall): Reformatted.
	(FoldBuiltin): Renamed parameter.
	(CodeFunctValue): Removed unused parameter.
	(CodeAddr): Removed unused parameter.
	(FoldBecomes): Delete variable t.  Removed unused parameter.
	(CodeTry): Removed all parameters.
	(CodeThrow): Removed unused parameters.
	(CodeCatchBegin): Reformatted.
	(checkDeclare): Reformatted and renamed parameters.  Removed
	unused parameters.
	(LValueToGenericPtr): Removed unused parameter and reformatted.
	(CodeAddCheck): Renamed parameters.
	(FoldSub): Renamed parameters.
	(CodeAddCheck): Renamed parameters.
	(CodeSubCheck): Renamed parameters.
	(FoldMult): Renamed parameters.
	(CodeSub): Renamed parameters.
	(CodeMultCheck): Rewritten and reformatted.
	(CodeDivM2Checked): Rewritten and reformatted.
	(CodeDivM2Check): Rewritten and reformatted.
	(CodeModM2Checked): Rewritten and reformatted.
	(CodeModM2Check): Rewritten and reformatted.
	(FoldDivM2): Rewritten and reformatted.
	(CodeDivM2): Rewritten and reformatted.
	(FoldModM2): Rewritten and reformatted.
	(FoldDivTrunc): Rewritten and reformatted.
	(FoldDivCeil): Rewritten and reformatted.
	(FoldDivFloor): Rewritten and reformatted.
	(FoldBuiltinConst): Rewritten and reformatted.
	(FoldBuiltinTypeInfo): Rewritten and reformatted.
	(CodeStandardFunction): Rewritten and reformatted.
	(CodeSavePriority): Rewritten and reformatted.
	(CodeRestorePriority): Rewritten and reformatted.
	(CodeUnarySet): Rewritten and reformatted.
	(FoldIfIn): Rewritten and reformatted.
	(GetSetLimits): Rewritten and reformatted.
	(CodeIncl): Rewritten and reformatted.
	(CodeExcl): Rewritten and reformatted.
	(FoldUnary): Rewritten and reformatted.
	(FoldUnarySet): Rewritten and reformatted.
	(CodeUnaryCheck): Rewritten and reformatted.
	(CodeUnary): Rewritten and reformatted.
	(CodeNegateChecked): Rewritten and reformatted.
	(CodeSize): Rewritten and reformatted.
	(FoldRecordField): Delete variables location and t.
	(BuildHighFromArray): Rewritten and reformatted.
	(BuildHighFromStaticArray): Rewritten and reformatted.
	(ResolveHigh): Rewritten and reformatted.
	(FoldHigh): Rewritten and reformatted.
	(CodeArray): Rewritten and reformatted.
	(FoldElementSizeForArray): Rewritten and reformatted.
	(FoldElementSizeForUnbounded): Rewritten and reformatted.
	(FoldConvert): Rewritten and reformatted.
	(CodeIfNotEqu): Rewritten and reformatted.
	(MixTypes3): Rewritten and reformatted.
	(AddQuadInformation): Rewritten and reformatted.
	(UndoReadWriteInfo): Rewritten and reformatted.
	(WriteQuad): Rewritten and reformatted.
	* gm2-gcc/m2statement.c (BuildFunctionCallTree): New function.
	* gm2-gcc/m2statement.def (BuildFunctionCallTree): New function.
	* gm2-gcc/m2statement.h (BuildFunctionCallTree): New function.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-10-08 11:52:48 +01:00
Gaius Mulley
12ab545439 Moved TestLong4.mod into the pass directory.
2021-10-04  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/testsuite/gm2/ChangeLog:

	* pim/fail/TestLong4.mod: Moved into pim/pass/TestLong4.mod.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-10-04 07:44:50 +01:00
Gaius Mulley
933e82ea6a Merge branch 'master' into devel/modula-2. 2021-09-22 21:08:22 +01:00
Gaius Mulley
37529f1a0a Manually merged Makefile.in.
2021-09-22  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

ChangeLog:
	* Makefile.in:  Manual merge.
2021-09-22 15:48:17 +01:00
Gaius Mulley
85251cc0b1 M2GenGCC.mod tidyup and removal of unused parameters and variables.
2021-09-15  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* gm2-compiler/M2GenGCC.def (DoCopyString): Renamed parameter t
	to length.
	* gm2-compiler/M2GenGCC.mod (CodeStatement): Call
	FoldStatementNote with one parameter.  Call CodeGoto with
	one parameter.  Call CodeReturnValue without op2.  Call
	CodeInline without q, op1 and op2.  Call CodeStatement with a
	single parameter.  Call CodeSaveException a single parameter op3.
	Call CodeRestoreException with op1 and op3.
	(ResolveConstantExpressions) Call FoldStatementNote with one
	parameter.  Call FoldRange without op1 and op2.  Call
	FoldStatementNote with only op3.  (CodeInline) Reformatted.
	(FoldStatementNote) changed to use a single parameter.
	(FoldRange) Renamed parameter q to quad, commented out p
	and removed op1, op2.  (CodeSaveException) Rewritten using
	descriptive variable names.  (CodeRestoreException) Rewritten
	using descriptive variable names.  (MakeCopyAndUse) Use
	BuildAssignmentStatement and remove variable t.
	(AutoInitVariable) Use BuildAssignmentStatement and remove
	variable t.  (CodeMakeAdr) Use BuildAssignmentStatement.
	(CodeAddr) Use BuildAssignmentStatement and remove
	variable t.  (DoCopyString) Renamed parameter t to length.
	(CodeInitAddress) Use BuildAssignmentStatement and remove
	variable t.  (CodeBecomes) Use BuildAssignmentStatement and remove
	variable t.  (CodeBinaryCheck) Use BuildAssignmentStatement and
	remove variable t.  (CodeBinary) Use BuildAssignmentStatement and
	remove variable t.  (CodeStandardFunction) Use
	BuildAssignmentStatement and remove variable t.
	(CodeUnaryCheck) Use BuildAssignmentStatement and remove
	variable t.  (CodeUnary) Use BuildAssignmentStatement and remove
	variable t.  (CodeSize) Use BuildAssignmentStatement and remove
	variable t.  (CodeOffset) Use BuildAssignmentStatement and remove
	variable t.  (CodeHigh) Use BuildAssignmentStatement and remove
	variable t.  (CodeUnbounded) Use BuildAssignmentStatement and remove
	variable t.  (CodeArray) Use BuildAssignmentStatement and remove
	variable t.  (FoldRecordField) renamed local variable t to ptr.
	(CodeOffset) renamed local variable t to offset.
	* m2/gm2-gcc/m2statement.def (BuildAssignmentStatement): New
	procedure.
	* m2/gm2-gcc/m2statement.h (BuildAssignmentStatement): New
	function declaration.
	* m2/gm2-gcc/m2statement.c: (BuildAssignmentStatement): New
	function.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-09-16 13:02:14 +01:00
Gaius Mulley
447e74e402 Merge branch 'master' into devel/modula-2. 2021-09-14 15:38:55 +01:00
Gaius Mulley
e9e0d6237e Merge branch 'master' into devel/modula-2. 2021-09-14 12:38:49 +01:00
Gaius Mulley
58352eb716 Removed unused procedures, parameters and variables.
2021-09-13  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* gm2-compiler/M2ALU.mod (WatchedValue):  Removed.  (stop)
	Removed.  (AddElement) Removed.  (SetNegate) Removed variable j.
	(DisplayElements) Removed variable t.  (WalkConstructorDependants)
	Removed variable r.  (PerformSetIn) Removed variable v.
	(BuildStructBitset) Removed GccField.  (ConstructRecordConstant)
	Removed variables GccFieldType, gccsym, high, low and location.
	(InitialiseArrayOfCharWithString) Removed parameter v.
	(CheckElementString) Remove parameter baseType.  Call
	InitialiseArrayOfCharWithString without the NIL third parameter.
	(InitialiseArrayWith) Remove parameter baseType.  Call
	CheckElementString without baseType.  (InitialiseArrayOfCharWith)
	Remove parameter baseType.  Remove variables Subrange, Subscript
	and seenString.
	* gm2-compiler/M2CaseList.def (OverlappingCaseBounds):  Remove
	unused tokenno parameter.  (MissingCaseBounds) use MetaErrorT2 and
	position the error at tokenno.  (WriteCase) Simplistic
	implmentation.
	* gm2-compiler/M2Range.mod:  (FoldCaseBounds) call
	OverlappingCaseBounds without tokenno parameter.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-09-13 14:46:25 +01:00
Gaius Mulley
d838b5f228 Fixed libm2iso cross compiler for bare metal by using CC and CFLAGS.
2021-09-06  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

libgm2/ChangeLog:

	* libgm2/configure: Rebuilt.
	* libgm2/configure.ac (AM_INIT_AUTOMAKE): Added no-define.
	* libm2iso/Makefile.am (C_INCLUDES): Added.  (libm2iso_la_CFLAGS)
	added C_INCLUDES.  (.c.lo) Use $(CC) and $(CFLAGS) instead of
	CC_FOR_TARGET and CFLAGS_FOR_TARGET.
	* libm2iso/Makefile.in: Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-09-06 01:59:55 +01:00
Gaius Mulley
c31cb58bc7 Merge branch 'master' into devel/modula-2. 2021-09-02 16:46:45 +01:00
Gaius Mulley
74896c9b8f Replaced include header <foo.h> with "foo.h".
2021-09-02  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

libgm2/ChangeLog:

	* libm2iso/ErrnoCategory.c: Replaced include <errno.h> with
	include "errno.h" and <sys/errno.h> with "sys/errno.h".
	* libm2iso/wrapsock.c: Replaced include <sys/types.h> with
	include "sys/types.h", <sys/socket.h> with "sys/socket.h",
	<netinet/in.h> with "netinet/in.h", <netdb.h> with "netdb.h",
	<unistd.h> with "unistd.h", <signal.h> with "signal.h",
	<sys/errno.h> with "sys/errno.h", <errno.h> with "errno.h",
	<malloc.h> with "malloc.h", <string.h> with "string.h",
	<stdlib.h> with "stdlib.h".
	* libm2iso/wraptime.c: Replaced include <sys/types.h> with
	"sys/types.h", <sys/time.h> with "sys/time.h", <time.h> with
	"time.h", <malloc.h> with "malloc.h", <limits.h> with "limits.h".

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-09-02 16:25:01 +01:00
Gaius Mulley
8cd66d28b1 Merge branch 'master' into devel/modula-2. 2021-08-27 01:42:41 +01:00
Gaius Mulley
ddde4597e7 Merge branch 'devel/modula-2' of git+ssh://gcc.gnu.org/git/gcc into devel/modula-2 2021-08-26 20:31:12 +01:00
Gaius Mulley
257e9cdaa8 Remove unused variables, parameters and procedures.
2021-08-26  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog

	* Make-lang.in (GM2-COMP-BOOT-DEFS): Remove cflex.def from list.
	(GM2-COMP-BOOT-MODS) Remove cflex.mod from list.
	* gm2-compiler/CLexBuf.mod (GetToken):
	Remove unused local variable a.  Use AdvanceToken
	instead of GetToken.  (AddTokToList) Remove unused variable b.
	(IsLastTokenEof) Remove unused variable t.
	* gm2-compiler/M2ALU.mod (Reduce): New procedure.
	(PrintValue) Use Reduce rather than PopIntegerTree.
	* gm2-compiler/M2Base.mod (Param): Remove unused
	global variable.  (IsVarientSame) Initialize ga at the procedure
	start. 	Initialize gb at the procedure start.
	* gm2-compiler/M2CaseList.def (CaseBoundsResolved): tokenno
	parameter removed.
	* gm2-compiler/M2CaseList.mod (RangePair): Data type
	simplified.  (ConflictingPair) Data type simplified.  (CaseList)
	Data type simplified.  (SetRange) Data type simplified.
	(Overlaps) Reformatted.  (OverlappingCaseBound) Remove tokenno
	parameter.
	* gm2-compiler/M2GenGCC.mod (ConvertForComparison):
	Commented out.  (IsWord) Removed.  (HaveDifferentTypes) Removed.
	(FoldSetLogicalDifference) Commented out.  (DetermineFieldOf)
	Commented out.  (CodeMath) Commented out.
	* gm2-compiler/M2Range.mod  (FoldCaseBounds): Remove
	first parameter to TypeCaseBounds.  (CodeCaseBounds) Remove
	first parameter to TypeCaseBounds.
	* gm2-compiler/M2Search.mod (Assert): Imported.
	(GarbageDebugging) Declared.  (doDSdbEnter) Commented out.
	(doDSdbExit) Commented out.  (DSdbEnter) Commented out.
	(DSdbExit) Commented out.  (DSdbExit) Assert s # NIL.
	* gm2-compiler/M2Swig.mod (Doresolveorder): Remove
	parameter main.  (DetermineParameter) Remove annotate parameter.
	* gm2-compiler/ObjectFiles.mod (RegisterModuleObject):
	Remove local variable r as libc.close and libc.read procedure
	functions have an optional return result.  (IsRegistered)
	Remove local variable r as libc.close and libc.read procedure
	functions have an optional return result.
	* gm2-compiler/PCSymBuild.mod (WalkConst): Commented out.
	* gm2-compiler/Sets.mod (checkRange): Remove unused
	variable a.  Use Assert to check memset and memcpy results instead
	of assigning to a.  (DuplicateSet) Remove unused variable a.
	Use Assert to check return value of memset and memcpy instead of
	assigning to a.
	* gm2-compiler/SymbolTable.mod (MetaErrorT2): Imported.
	(AlreadyImportedError) Commented out.  (DisplayScopes) Commented
	out.  (GetConstFromTypeTree) Commented out.
	(PutConstIntoTypeTree) Commented out.  (SkipHiddenType) Commented
	out.  (GetLastMainScopeId) Commented out.
	(PutExportUnImplemented) Commented out.  (DumpSymbols) Commented out.
	* gm2-compiler/cflex.def (AdvanceToken): New procedure.
	* gm2-libs-min/libc.c (abort): Add infinite loop.
	(exit) Add infinite loop.
	* gm2-libs/libc.def (read): Define return value as
	optional.  (write) Define return value as optional.
	(close) Define return value as optional.
	(system) Define return value as optional.
	(readv) Define return value as optional.
	(writev) Define return value as optional.
	(chown) Define return value as optional.
	(strcpy) Define return value as optional.
	(strncpy) Define return value as optional.
	(unlink) Define return value as optional.
	(memcpy) Define return value as optional.
	(memset) Define return value as optional.
	(memmove) Define return value as optional.
	(setenv) Define return value as optional.
	(ftime) Define return value as optional.
	(shutdown) Define return value as optional.
	(rename) Define return value as optional.
	(atexit) Sefine return value as optional.
	* Makefile.in: Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-08-26 20:20:06 +01:00
Gaius Mulley
f9d489dbbe Remove unused variables, parameters and procedures.
2021-08-26  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/
	* gcc/m2/Make-lang.in (cflex.def): Removed from
	GM2-COMP-BOOT-DEFS.  (cflex.mod) Removed from
	GM2-COMP-BOOT-MODS.
	* gcc/m2/gm2-compiler/CLexBuf.mod (GetToken):
	Remove unused local variable a.  Use AdvanceToken
	instead of GetToken.  (AddTokToList) Remove unused variable b.
	(IsLastTokenEof) Remove unused variable t.
	* gcc/m2/gm2-compiler/M2ALU.mod (Reduce): New procedure.
	(PrintValue) Use Reduce rather than PopIntegerTree.
	* gcc/m2/gm2-compiler/M2Base.mod (Param): Remove unused
	global variable.  (IsVarientSame) Initialize ga at the procedure
	start. 	Initialize gb at the procedure start.
	* gcc/m2/gm2-compiler/M2CaseList.def (CaseBoundsResolved) tokenno
	parameter removed.
	* gcc/m2/gm2-compiler/M2CaseList.mod (RangePair) Data type
	simplified.  (ConflictingPair) Data type simplified.  (CaseList)
	Data type simplified.  (SetRange) Data type simplified.
	(Overlaps) Reformatted.  (OverlappingCaseBound) Remove tokenno
	parameter.
	* gcc/m2/gm2-compiler/M2GenGCC.mod:  (ConvertForComparison)
	Commented out.  (IsWord) Removed.  (HaveDifferentTypes) Removed.
	(FoldSetLogicalDifference) Commented out.  (DetermineFieldOf)
	Commented out.  (CodeMath) Commented out.
	* gcc/m2/gm2-compiler/M2Range.mod  (FoldCaseBounds) remove
	first parameter to TypeCaseBounds.  (CodeCaseBounds) remove
	first parameter to TypeCaseBounds.
	* gcc/m2/gm2-compiler/M2Search.mod (Assert) Imported.
	(GarbageDebugging) Declared.  (doDSdbEnter) Commented out.
	(doDSdbExit) Commented out.  (DSdbEnter) Commented out.
	(DSdbExit) Commented out.  (DSdbExit) Assert s # NIL.
	* gcc/m2/gm2-compiler/M2Swig.mod (Doresolveorder) Remove
	parameter main.  (DetermineParameter) Remove annotate parameter.
	* gcc/m2/gm2-compiler/ObjectFiles.mod (RegisterModuleObject)
	Remove local variable r as libc.close and libc.read procedure
	functions have an optional return result.  (IsRegistered)
	Remove local variable r as libc.close and libc.read procedure
	functions have an optional return result.
	* gcc/m2/gm2-compiler/PCSymBuild.mod (WalkConst): Commented out.
	* gcc/m2/gm2-compiler/Sets.mod (checkRange): Remove unused
	variable a.  Use Assert to check memset and memcpy results instead
	of assigning to a.  (DuplicateSet): Remove unused variable a.
	Use Assert to check return value of memset and memcpy instead of
	assigning to a.
	* gcc/m2/gm2-compiler/SymbolTable.mod (MetaErrorT2): Imported.
	(AlreadyImportedError) Commented out.  (DisplayScopes) Commented
	out.  (GetConstFromTypeTree) Commented out.
	(PutConstIntoTypeTree) Commented out.  (SkipHiddenType) Commented
	out.  (GetLastMainScopeId) Commented out.
	(PutExportUnImplemented) Commented out.  (DumpSymbols) Commented out.
	* gcc/m2/gm2-compiler/cflex.def (AdvanceToken): New procedure.
	* gcc/m2/gm2-libs-min/libc.c (abort):  Add infinite loop.
	(exit):  Add infinite loop.
	* gcc/m2/gm2-libs/libc.def (read): define return value as
	optional.  (write) define return value as optional.
	(close) define return value as optional.
	(system) define return value as optional.
	(readv) define return value as optional.
	(writev) define return value as optional.
	(chown) define return value as optional.
	(strcpy) define return value as optional.
	(strncpy) define return value as optional.
	(unlink) define return value as optional.
	(memcpy) define return value as optional.
	(memset) define return value as optional.
	(memmove) define return value as optional.
	(setenv) define return value as optional.
	(ftime) define return value as optional.
	(shutdown) define return value as optional.
	(rename) define return value as optional.
	(atexit) define return value as optional.
	(Makefile.in): Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-08-26 20:15:19 +01:00
Gaius Mulley
7e20439cde Merge branch 'master' into devel/modula-2. 2021-08-18 15:18:46 +01:00
Gaius Mulley
b4d74a80f3 Remove unused procedures, parameters and warnings about casts.
2021-08-18  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* gm2-compiler/M2Options.def (SetMakeall): Commented out.
	(SetMakeall0) Commented out.  (SetIncludePath) Commented out.
	* gm2-compiler/M2Options.mod: (SetMakeall): Commented out.
	(SetMakeall0) Commented out.  (SetIncludePath) Commented out.
	* gm2-libs/SArgs.mod (GetArg): Cast ArgV to PtrToChar before
	adding the offset.  Removes a warning from the resultant C/C++ code.

gm2tools/ChangeLog:

	* Makefile.in: (Rebuilt).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-08-18 14:44:02 +01:00
Gaius Mulley
bc56488abd Bugfix 101389: add missing dependancies to enable parallel builds.
2021-08-18  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* Make-lang.in: Add $(generated_files) to the list
	of dependanies for all .o files.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-08-18 00:55:29 +01:00
Gaius Mulley
867acc2e2e Bugfix 101389/modula2 add missing dependancies to enable parallel builds.
2021-08-17  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* Make-lang.in (m2/gm2-gcc/%.o): Add $(generated_files) to the list
	of dependanies.

gm2tools/ChangeLog:

	* Makefile.in: (Rebuilt).

libgm2/ChangeLog:

	* libm2cor/Makefile.am (libm2cor_la_DEPENDENCIES): Added all .lo
	objects.
	* libm2cor/Makefile.in: (Rebuilt).
	* libm2iso/Makefile.am (libm2iso_la_DEPENDENCIES): Added all .lo
	objects.
	* libm2iso/Makefile.in: (Rebuilt).
	* libm2log/Makefile.am (libm2log_la_DEPENDENCIES): Added all .lo
	objects.
	* libm2log/Makefile.in: (Rebuilt).
	* libm2min/Makefile.am (libm2min_la_DEPENDENCIES): Added all .lo
	objects.
	* libm2min/Makefile.in: (Rebuilt).
	* libm2pim/Makefile.am (libm2pim_la_DEPENDENCIES): Added all .lo
	objects.
	* libm2pim/Makefile.in: (Rebuilt).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-08-17 22:58:42 +01:00
Gaius Mulley
75db6b4f11 Bugfix modula2/101392 correct preprocessor defined guard.
2021-08-15  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* m2-boot-ch/Gtermios.c (GetFlag): Correct guard using
	defined(__MAX_BAUD).  (SetFlag): Correct guard using
	defined(__MAX_BAUD).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-08-15 13:49:30 +01:00
Gaius Mulley
f33123de65 Rebuilt Makefile.in's using automake-1.15.1 and configure using autoconf-2.69.
2021-08-14  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

ChangeLog:

	* configure (compare_exclusions): Rebuilt.

gm2tools/ChangeLog:

	* gm2tools/Makefile.in: Rebuilt.
	* gm2tools/configure: Rebuilt.
	* gm2tools/aclocal.m4: New file.

libgm2/ChangeLog:

	* libgm2/Makefile.in: Rebuilt.
	* libgm2/aclocal.m4: New file.
	* libgm2/configure: Rebuilt.
	* libgm2/libm2cor/Makefile.in: Rebuilt.
	* libgm2/libm2iso/Makefile.in: Rebuilt.
	* libgm2/libm2log/Makefile.in: Rebuilt.
	* libgm2/libm2min/Makefile.in: Rebuilt.
	* libgm2/libm2pim/Makefile.in: Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-08-14 09:21:52 +01:00
Gaius Mulley
0593d8a669 Change all source file references of the module getopt to cgetopt.
2021-08-12  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/ChangeLog:

	* m2/gm2-libs/GetOpt.mod:  Rename the getopt module with cgetopt
	to avoid a clash of source filenames in the gcc tree.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-08-12 18:07:34 +01:00
Gaius Mulley
c9fba1bc6c Remove unused variables, parameters, procedures and add throw prototype.
Continue removing compiler warnings by removing unnecessary variables
and parameters.  Also rebuilt the bootstrap tool mc after adding the
throw prototype to be emitted if not compiled by a cpluscplus compiler.

2021-08-12  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

ChangeLog:

	configure.ac (compare_exclusions): Add gcc/m2/gm2version to this
	list.

gcc/m2/ChangeLog:

	* Make-lang.in (PGE):  bootstrap binary location changed.
	Use gcc-12 version of the gm2 libraries when regenerating
	mc.  All automatically generated parser files for mc are now
	built by PGE using the -o option.
	* gm2-compiler/M2Base.def (NegateType): Remove NearTok
	parameter.
	* gm2-compiler/M2Base.mod (NegateType): Remove NearTok
	parameter.  (IsEnumerationSame) Remove error parameter.
	* gm2-compiler/M2GenGCC.mod: Caller to NegateType removes
	token position parameter.
	* gm2-compiler/M2Quads.mod: Caller to NegateType removes
	token position parameter.
	* gm2-compiler/M2System.mod (Assert) Imported.
	(AttemptToCreateType) renamed to CreateType.
	(AttemptToCreateSetType) renamed to CreateSetType.
	(AttemptToCreateSetType) reimplemented.  (AttemptToCreateType)
	reimplemented.  (MakeFixedSizedTypes) reimplemented.
	(InitPIMTypes) reimplemented.  (InitISOTypes) reimplemented.
	(MakeExtraSystemTypes) reimplemented.
	* gm2-compiler/PCSymBuild.mod (stackPtr) Removed.  (currentConst)
	removed.  (BuildVarAtAddress) Commented out.
	(BuildOptArgInitializer) Commented out.
	* m2/mc/keyc.mod:  Introduce prototype for throw.
	* m2/mc-boot/GDynamicStrings.c:  Rebuilt.
	* m2/mc-boot/GFIO.c:  Rebuilt.
	* m2/mc-boot/GIndexing.c:  Rebuilt.
	* m2/mc-boot/GM2EXCEPTION.c:  Rebuilt.
	* m2/mc-boot/GPushBackInput.c:  Rebuilt.
	* m2/mc-boot/GRTExceptions.c:  Rebuilt.
	* m2/mc-boot/GRTint.c:  Rebuilt.
	* m2/mc-boot/GStdIO.c:  Rebuilt.
	* m2/mc-boot/GStrLib.c:  Rebuilt.
	* m2/mc-boot/GStrLib.h:  Rebuilt.
	* m2/mc-boot/GStringConvert.c:  Rebuilt.
	* m2/mc-boot/GSysStorage.c:  Rebuilt.
	* m2/mc-boot/Gdecl.c:  Rebuilt.
	* m2/mc-boot/Gkeyc.c:  Rebuilt.
	* m2/mc-boot/GmcComment.c:  Rebuilt.
	* m2/mc-boot/GmcComp.c:  Rebuilt.
	* m2/mc-boot/GmcDebug.c:  Rebuilt.
	* m2/mc-boot/GmcMetaError.c:  Rebuilt.
	* m2/mc-boot/GmcStack.c:  Rebuilt.
	* m2/mc-boot/Gmcp1.c:  Rebuilt.
	* m2/mc-boot/Gmcp2.c:  Rebuilt.
	* m2/mc-boot/Gmcp3.c:  Rebuilt.
	* m2/mc-boot/Gmcp4.c:  Rebuilt.
	* m2/mc-boot/Gmcp5.c:  Rebuilt.
	* m2/mc-boot/GnameKey.c:  Rebuilt.
	* m2/mc-boot/GsymbolKey.c:  Rebuilt.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-08-12 18:07:04 +01:00
Gaius Mulley
20db8b340b Merge branch 'master' into devel/modula-2. 2021-08-10 12:15:14 +01:00
Gaius Mulley
4b3d4810cf Remove unused variables, parameters and procedures.
2021-08-09  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/

	* gm2-compiler/M2Quads.mod (doDSdbEnter): Commented out.
	(DSdbExit) Remove parameter.  (GetQF) Cast procedure
	function return result.  (CheckAddVariableReadLeftValue)
	Commented out.  (CheckRemoveVariableReadLeftValue) Commented
	out.  (CheckParameterOrdinals) Remove parameter.
	(CheckProcTypeAndProcedure) Remove tokpos and TypeList parameters.
	(BuildCapFunction) Use local optok instead of erroneous global
	vartok.  (BuildProcedureEnd) Use RemoveTop rather than PopWord.
	(CheckReadBeforeInitialized) Call CheckReadBeforeInitialized
	without Start parameter.  (CheckForLogicalOperator) Renamed
	CheckLogicalOperator.  (CheckGenericNulSet) Renamed
	doCheckGenericNulSet and commented out.  (CheckForGenericNulSet)
	Renamed CheckGenericNulSet and commented out.  (ds) Commented out.
	(DSdbExit) called without a parameter.  (BuildStmtNote)
	Reformatted and INTEGER i is cast to a CARDINAL prior to
	comparison.  (IncOperandD) Commented out.  (PushTrw) Commented
	out.  (StressStack) Commented out.
	* gm2-compiler/M2StackWord.def (RemoveTop): Definition added.
	* gm2-compiler/M2StackWord.mod (RemoveTop): Implementation added.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-08-10 11:47:24 +01:00
Gaius Mulley
7098eb60a3 Remove unused variables, parameters and procedures.
2021-08-02  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

gcc/m2/

	* gm2-compiler/M2BasicBlock.mod (ConvertQuads2BasicBlock): Assign
	CurrentBB to NIL.  (Sub): Commented out.  (DisplayBasicBlocks):
	Commented out.  (DisplayBlock): Commented out.
	* gm2-compiler/M2Code.mod (PrintModule): Commented out.
	(DisplayQuadsInScope): Commented out.  (DisplayQuadNumbers):
	Commented out.
	* gm2-compiler/M2Error.mod: Import NulName. (DoFormat1) initialize
	n.  (DoFormat2) initialize n.
	* gm2-compiler/M2Optimize.mod (DeleteUnReachableProcedures):
	Commented out.
	* gm2-compiler/M2Options.mod:  Commented out string garbage
	debugging procedures.  (SetDebugging) Commented out.
	* gm2-compiler/M2Printf.mod (IsDigit): Commented out.
	* gm2-compiler/P1SymBuild.mod (CheckProcedure): Removed.
	(CheckFileName) Commented out.  (BuildHiddenType) Remove Sym.
	Use Assert to check return value.
	* gm2-compiler/P2SymBuild.def (SeenBoolean): Remove sym parameter.
	(SeenZType): Remove sym parameter.  (SeenRType): Remove sym
	parameter.  (SeenCType): Remove sym parameter.
	* gm2-compiler/P2SymBuild.mod (SeenBoolean): Remove sym parameter.
	(SeenZType): Remove sym parameter.  (SeenRType): Remove sym
	parameter.  (SeenCType): Remove sym parameter.
	(StartBuildEnumeration): Remove name.  (FailParameter) Use default
	ELSE and Assert.  (BuildNulParam) Removed.  (BuildFieldRecord)
	Remove name.  Assign Field to NulSym.  (BuildVarientSelector)
	Remove Parent.
	* gm2-compiler/SymbolTable.def (GCFieldVarient): Removed.
	(FillInUnboundedFields):  Remove field.
	* gm2-compiler/gm2lcc.mod (CollectObjects): remove s.
	(WriteModuleName) Removed.
	* gm2-compiler/gm2lorder.mod (InitRuntimeModules) Remove l.
	* gm2-gcc/m2expr.c (divFloorOverflowPosPos) Remove unused
	parameters.  (divFloorOverflowPosNeg) Remove unused parameters.
	(divFloorOverflowNegPos) Remove unused parameters.

libgm2/

	* libm2pim/Makefile.in: (Rebuilt).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-08-02 09:48:50 +01:00
Gaius Mulley
ab813f8b06 Merge branch 'devel/modula-2' adding missing changelog directory in commit. 2021-07-28 22:28:31 +01:00
Gaius Mulley
35e03669f2 Add Output.def, Output.mod to ppg and remove unused variables.
2021-07-28  Gaius Mulley   <gaius.mulley@southwales.ac.uk>

gcc/m2
        * Make-lang.in:  Added Output.mod to the list of ppg
	modules.
	* Make-lang.in:  Added Output.def to the list of ppg
	modules.
	* gm2-compiler/Output.def: (New file).
	* gm2-compiler/Output.mod: (New file).
	* bnf/gm2l.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/gm2m.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/m2-1.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/m2-2.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/m2-3.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/m2-c.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/m2-h.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/m2.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/mc-1.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/mc-2.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/mc-3.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/mc-4.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/mc-5.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* gm2-compiler/M2ALU.mod: (InitialiseArrayOfCharWithString)
	isChar set to FALSE.
	* gm2-compiler/M2ALU.def: (DisplayModules) exported.
	* gm2-compiler/M2Depth.def: (DisplayGraph) exported.
	* gm2-compiler/M2Depth.mod: (DisplayGraph) added comment.
	* gm2-compiler/M2Options.mod: (SetProfiling) commented out.
	* gm2-compiler/M2Quads.mod: (BuildAddAdrFunction) vartok removed.
	(BuildAbsFunction) combinedtok removed. (BuildRotateFunction)
	paramtok removed.
	* gm2-compiler/P0SymBuild.mod: (pc) commented out.
	(FlushImports) removed sym and reformatted.  (DeclareModules)
	reformatted.  (MoveNext) commented out.
	* gm2-compiler/SymbolKey.mod: (stop) commented out.
	* gm2-compiler/ppg.mod: (Output) imported.  (ArgName)
	declared.  (ParametersUsed) declared.  (PrettyFollow)
	use the Output module to delay emitting text.  (WriteCodeHunkList)
	use the Output module to delay emitting text.  (WriteIndent)
	use the Output module to delay emitting text.  (WriteIndent)
	(CheckWrite) use the Output module to delay emitting text.
	(WriteIndent) use the Output module to delay emitting text.
	(NewLine) use the Output module to delay emitting text.
	(IndentString) use the Output module to delay emitting text.
	(DescribeError) remove parameters.  (SyntaxError) call
	DescribeError without parameters.  (KeyWord) use the
	Output module to delay emitting text.  (PrettyPara)
	use the Output module to delay emitting text.  (WriteKeyTexinfo)
	use the Output module to delay emitting text.
	(PrettyCommentFactor) use the Output module to delay emitting
	text.  (PrettyCommentTerm) use the Output module to delay emitting
	text.  (PrettyCommentProduction) use the Output module to delay emitting
	text.  (PrettyPrintProduction) use the Output module to delay emitting
	text.  (EmitFileLineTag) use the Output module to delay emitting
	text.  (CodeThenDo) use the Output module to delay emitting
	text.  (CodeElseEnd) use the Output module to delay emitting
	text.  (EmitNonVarCode) use the Output module to delay emitting
	text.  (FlushCode) use the Output module to delay emitting
	text.  (CodeFactor) use the Output module to delay emitting
	text.  (CodeProduction) use the Output module to delay emitting
	text.  (WriteElement) use the Output module to delay emitting
	text.  (EmitIsInSet) use the Output module to delay emitting
	text.  (EmitIsInSubSet) use the Output module to delay emitting
	text.  (EmitIsInFirst) use the Output module to delay emitting
	text.  (RecoverFactor) use the Output module to delay emitting
	text.  (RecoverTerm) use the Output module to delay emitting
	text.  (EmitUsed) use the Output module to delay emitting
	text.  (EmitStopParameters) use the Output module to delay emitting
	text.  (EmitSet) use the Output module to delay emitting
	text.  (EmitSetName) use the Output module to delay emitting
	text.  (EmitStopParametersAndSet) use the Output module to delay emitting
	text.  (EmitSetAsParameters) use the Output module to delay emitting
	text.  (EmitStopParametersAndFollow) use the Output module to delay emitting
	text.  (RecoverProduction) use the Output module to delay emitting
	text.  (WriteUpto) use the Output module to delay emitting
	text.  (CheckForVar) use the Output module to delay emitting
	text.  (EmitFDLNotice) use the Output module to delay emitting
	text.  (DescribeElement) use the Output module to delay emitting
	text.  (EmitInTestStop) use the Output module to delay emitting
	text.  (DescribeStopElement) use the Output module to delay emitting
	text.  (EmitDescribeStop) use the Output module to delay emitting
	text.  (EmitDescribeError) use the Output module to delay emitting
	text.  (EmitSetTypes) use the Output module to delay emitting
	text.  (ParseArgs) open output filename.
	* gm2-gcc/m2decl.c: (m2decl_DeclareKnownVariable) change format
	specifier to generate quoted declaration.  Call internal_error
	and use quoted format specifier.
	* gm2-gcc/m2except.c:  (ASSERT) removed.  (ERROR) removed.
	(m2except_BuildThrow) rewritten.
	* gm2-gcc/m2expr.c: (m2expr_GetSizeOfInBits) use quoted format
	specifier for error.  (m2type_BuildSetTypeFromSubrange) add
	attribute unused for the name of the subrange and add comment
	about dwarf-5 set type.
	* gm2-libs/StrLib.def: (StrLen) renamed parameters.
	* gm2-libs/StrLib.mod: (StrLen) renamed parameters.
	* init/ppginit: Add SFIO and Output to the list of modules.
	* gm2-compiler/Output.def: (New file).
	* gm2-compiler/Output.mod: (New file).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-07-28 22:22:24 +01:00
Gaius Mulley
f7698b15ab Add Output.def, Output.mod to ppg and remove unused variables.
2021-07-28  Gaius Mulley   <gaius.mulley@southwales.ac.uk>

        * Make-lang.in:  Added Output.mod to the list of ppg
	modules.
	* Make-lang.in:  Added Output.def to the list of ppg
	modules.
	* gm2-compiler/Output.def: (New file).
	* gm2-compiler/Output.mod: (New file).
	* bnf/gm2l.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/gm2m.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/m2-1.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/m2-2.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/m2-3.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/m2-c.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/m2-h.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/m2.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/mc-1.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/mc-2.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/mc-3.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/mc-4.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* bnf/mc-5.bnf: (DescribeError) no longer has any parameters.
	Removed unused rules.
	* gm2-compiler/M2ALU.mod: (InitialiseArrayOfCharWithString)
	isChar set to FALSE.
	* gm2-compiler/M2ALU.def: (DisplayModules) exported.
	* gm2-compiler/M2Depth.def: (DisplayGraph) exported.
	* gm2-compiler/M2Depth.mod: (DisplayGraph) added comment.
	* gm2-compiler/M2Options.mod: (SetProfiling) commented out.
	* gm2-compiler/M2Quads.mod: (BuildAddAdrFunction) vartok removed.
	(BuildAbsFunction) combinedtok removed. (BuildRotateFunction)
	paramtok removed.
	* gm2-compiler/P0SymBuild.mod: (pc) commented out.
	(FlushImports) removed sym and reformatted.  (DeclareModules)
	reformatted.  (MoveNext) commented out.
	* gm2-compiler/SymbolKey.mod: (stop) commented out.
	* gm2-compiler/ppg.mod: (Output) imported.  (ArgName)
	declared.  (ParametersUsed) declared.  (PrettyFollow)
	use the Output module to delay emitting text.  (WriteCodeHunkList)
	use the Output module to delay emitting text.  (WriteIndent)
	use the Output module to delay emitting text.  (WriteIndent)
	(CheckWrite) use the Output module to delay emitting text.
	(WriteIndent) use the Output module to delay emitting text.
	(NewLine) use the Output module to delay emitting text.
	(IndentString) use the Output module to delay emitting text.
	(DescribeError) remove parameters.  (SyntaxError) call
	DescribeError without parameters.  (KeyWord) use the
	Output module to delay emitting text.  (PrettyPara)
	use the Output module to delay emitting text.  (WriteKeyTexinfo)
	use the Output module to delay emitting text.
	(PrettyCommentFactor) use the Output module to delay emitting
	text.  (PrettyCommentTerm) use the Output module to delay emitting
	text.  (PrettyCommentProduction) use the Output module to delay emitting
	text.  (PrettyPrintProduction) use the Output module to delay emitting
	text.  (EmitFileLineTag) use the Output module to delay emitting
	text.  (CodeThenDo) use the Output module to delay emitting
	text.  (CodeElseEnd) use the Output module to delay emitting
	text.  (EmitNonVarCode) use the Output module to delay emitting
	text.  (FlushCode) use the Output module to delay emitting
	text.  (CodeFactor) use the Output module to delay emitting
	text.  (CodeProduction) use the Output module to delay emitting
	text.  (WriteElement) use the Output module to delay emitting
	text.  (EmitIsInSet) use the Output module to delay emitting
	text.  (EmitIsInSubSet) use the Output module to delay emitting
	text.  (EmitIsInFirst) use the Output module to delay emitting
	text.  (RecoverFactor) use the Output module to delay emitting
	text.  (RecoverTerm) use the Output module to delay emitting
	text.  (EmitUsed) use the Output module to delay emitting
	text.  (EmitStopParameters) use the Output module to delay emitting
	text.  (EmitSet) use the Output module to delay emitting
	text.  (EmitSetName) use the Output module to delay emitting
	text.  (EmitStopParametersAndSet) use the Output module to delay emitting
	text.  (EmitSetAsParameters) use the Output module to delay emitting
	text.  (EmitStopParametersAndFollow) use the Output module to delay emitting
	text.  (RecoverProduction) use the Output module to delay emitting
	text.  (WriteUpto) use the Output module to delay emitting
	text.  (CheckForVar) use the Output module to delay emitting
	text.  (EmitFDLNotice) use the Output module to delay emitting
	text.  (DescribeElement) use the Output module to delay emitting
	text.  (EmitInTestStop) use the Output module to delay emitting
	text.  (DescribeStopElement) use the Output module to delay emitting
	text.  (EmitDescribeStop) use the Output module to delay emitting
	text.  (EmitDescribeError) use the Output module to delay emitting
	text.  (EmitSetTypes) use the Output module to delay emitting
	text.  (ParseArgs) open output filename.
	* gm2-gcc/m2decl.c: (m2decl_DeclareKnownVariable) change format
	specifier to generate quoted declaration.  Call internal_error
	and use quoted format specifier.
	* gm2-gcc/m2except.c:  (ASSERT) removed.  (ERROR) removed.
	(m2except_BuildThrow) rewritten.
	* gm2-gcc/m2expr.c: (m2expr_GetSizeOfInBits) use quoted format
	specifier for error.  (m2type_BuildSetTypeFromSubrange) add
	attribute unused for the name of the subrange and add comment
	about dwarf-5 set type.
	* gm2-libs/StrLib.def: (StrLen) renamed parameters.
	* gm2-libs/StrLib.mod: (StrLen) renamed parameters.
	* init/ppginit: Add SFIO and Output to the list of modules.
	* gm2-compiler/Output.def: (New file).
	* gm2-compiler/Output.mod: (New file).

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-07-28 20:07:11 +01:00
Gaius Mulley
e13aec77b9 Merge branch 'master' into devel/modula-2. 2021-07-28 19:58:17 +01:00
Gaius Mulley
7401123f97 Import GNU Modula-2 from GNU Savannah into GCC.
2021-07-07  Gaius Mulley   <gaius.mulley@southwales.ac.uk>

/
	* gm2tools: New directory.
	* gm2tools/ChangeLog: New file.
	* libgm2: New directory.
	* libgm2/ChangeLog: New file.
	* Makefile.def (host_modules) includes gm2tools.
	(target_modules): Includes libgm2.
	(GM2_FOR_TARGET): Added.
	(GM2FLAGS_FOR_TARGET): Added.
	(dependencies): all-gm2tools on all-target-libgm2.
	(dependencies): configure-target-libgm2 on all-target-libstdc++-v3.
	(dependencies): all-target-libgm2 on all-target-libatomic.
	(languages): m2 define gcc-check-target as check-m2,
	define lib-check-target as check-target-libgm2 and
	lib-check-target as check-gm2tools.
	* Makefile.tpl: Assign GM2,
	GM2_FOR_BUILD, GM2_FOR_TARGET and GM2FLAGS.
	Pass variables to make.
	* configure.ac (GM2_FOR_TARGET): Added.
	Request build driver program gm2.
	(libgm2) option added.
	(GCC_TARGET_TOOL): define gm2 and how it is invoked.
	(compare_exclusions) includes SYSTEM and M2Version.

libgm2/
	* Makefile.am: New file.
	* Makefile.in: New file.
	* aclocal.m4: New file.
	* autogen.sh: New file.
	* config.h.in: New file.
	* configure: New file.
	* configure.ac: New file.
	* libm2cor/KeyBoardLEDs.c: New file.
	* libm2cor/Makefile.am: New file.
	* libm2cor/Makefile.in: New file.
	* libm2iso/ChanConsts.h: New file.
	* libm2iso/ErrnoCategory.c: New file.
	* libm2iso/Makefile.am: New file.
	* libm2iso/Makefile.in: New file.
	* libm2iso/RTco.c: New file.
	* libm2iso/wrapsock.c: New file.
	* libm2iso/wraptime.c: New file.
	* libm2log/Break.c: New file.
	* libm2log/Makefile.am: New file.
	* libm2log/Makefile.in: New file.
	* libm2min/Makefile.am: New file.
	* libm2min/Makefile.in: New file.
	* libm2min/libc.c: New file.
	* libm2pim/Makefile.am: New file.
	* libm2pim/Makefile.in: New file.
	* libm2pim/Selective.c: New file.
	* libm2pim/SysExceptions.c: New file.
	* libm2pim/UnixArgs.c: New file.
	* libm2pim/cgetopt.c: New file.
	* libm2pim/dtoa.c: New file.
	* libm2pim/errno.c: New file.
	* libm2pim/ldtoa.c: New file.
	* libm2pim/sckt.c: New file.
	* libm2pim/target.c: New file.
	* libm2pim/termios.c: New file.
	* libm2pim/wrapc.c: New file.

gm2tools/
	* Makefile.am: New file.
	* Makefile.in: New file.
	* aclocal.m4: New file.
	* autogen.sh: New file.
	* configure: New file.
	* configure.ac: New file.
	* errors.c: New file.
	* gm2l.1: New file.
	* gm2lcc.1: New file.
	* gm2lgen.1: New file.
	* gm2lorder.1: New file.
	* m2color.c: New file.

gcc/
	* m2: New directory.
	* m2/ChangeLog: New file.
	* doc/gm2.texi: New file.
	* doc/install.texi (m2): Add Modula-2 as a recognized front end
	language.  (--disable-libgm2) Add entry.  (check-m2) Add reference
	to run the Modula-2 regression tests.
	* doc/sourcebuild.texi (gm2tools): Added top level directory additions.
	(libgm2) Added top level directory entry.  (m2) Added reference for
	a new language subdirectory.
	* gcc/c-family/cppspec.c (lang_register_spec_functions): Added.
	* gcc/c/gccspec.c (lang_register_spec_functions): Added.
	* gcc/cp/g++spec.c (lang_register_spec_functions): Added.
	* gcc/d/d-spec.cc (lang_register_spec_functions): Added.
	* gcc/fortran/gfortranspec.c(lang_register_spec_functions): Added.
	* gcc/gcc.c (allow_linker): Global variable to disable
	linker by the front end.  (xputenv) available externally.
	(xgetenv) New function.  (save_switch) available externally.
	(fe_add_linker_option) New function.  (handle_OPT_B) New function.
	(fe_add_infile) New function.  (fe_mark_compiled) New function.
	(driver_handle_option) call handle_OPT_B.  (print_option) New
	function.  (print_options) New function.  (dbg_options) New function.
	(fe_add_spec_function) New function.  (lookup_spec_function)
	checks front end registered functions.
	(driver::set_up_specs):  call lang_register_spec_functions.
	(maybe_run_linker): Check allow_linker before running the linker.
	* gcc/gcc.h (fe_save_switch): Prototype.
	(handle_OPT_B) Prototype.  (fe_add_infile) Prototype.
	(fe_add_linker_option) Prototype.  (fe_add_spec_function) Prototype.
	(xputenv) Prototype.  (xgetenv) Prototype.  (print_options) Prototype.
	(print_option) Prototype.  (dbg_options) Prototype.
	(lang_register_spec_functions) Prototype.
	(allow_linker): Extern.
	* gcc/go/gospec.c (lang_register_spec_functions): Added.

gcc/m2/
	* COPYING.FDL: New file.
	* COPYING.RUNTIME: New file.
	* COPYING3: New file.
	* COPYING3.LIB: New file.
	* ChangeLog-2001: New file.
	* ChangeLog-2002: New file.
	* ChangeLog-2003: New file.
	* ChangeLog-2004: New file.
	* ChangeLog-2005: New file.
	* ChangeLog-2006: New file.
	* ChangeLog-2007: New file.
	* ChangeLog-2008: New file.
	* ChangeLog-2009: New file.
	* ChangeLog-2010: New file.
	* ChangeLog-2011: New file.
	* ChangeLog-2012: New file.
	* ChangeLog-2013: New file.
	* ChangeLog-2014: New file.
	* ChangeLog-2015: New file.
	* ChangeLog-2016: New file.
	* ChangeLog-2017: New file.
	* ChangeLog-2018: New file.
	* ChangeLog-2019: New file.
	* ChangeLog-2020: New file.
	* Make-lang.in: New file.
	* NEWS: New file.
	* README: New file.
	* aclocal.m4: New file.
	* bnf/README: New file.
	* bnf/gm2l.bnf: New file.
	* bnf/gm2m.bnf: New file.
	* bnf/m2-1.bnf: New file.
	* bnf/m2-2.bnf: New file.
	* bnf/m2-3.bnf: New file.
	* bnf/m2-c.bnf: New file.
	* bnf/m2-h.bnf: New file.
	* bnf/m2.bnf: New file.
	* bnf/mc-1.bnf: New file.
	* bnf/mc-2.bnf: New file.
	* bnf/mc-3.bnf: New file.
	* bnf/mc-4.bnf: New file.
	* bnf/mc-5.bnf: New file.
	* config-lang.in: New file.
	* config-make.in: New file.
	* configure: New file.
	* configure.ac: New file.
	* el/gm2-mode.el: New file.
	* gm2-compiler/CLexBuf.def: New file.
	* gm2-compiler/CLexBuf.mod: New file.
	* gm2-compiler/FifoQueue.def: New file.
	* gm2-compiler/FifoQueue.mod: New file.
	* gm2-compiler/Lists.def: New file.
	* gm2-compiler/Lists.mod: New file.
	* gm2-compiler/M2ALU.def: New file.
	* gm2-compiler/M2ALU.mod: New file.
	* gm2-compiler/M2AsmUtil.def: New file.
	* gm2-compiler/M2AsmUtil.mod: New file.
	* gm2-compiler/M2Base.def: New file.
	* gm2-compiler/M2Base.mod: New file.
	* gm2-compiler/M2BasicBlock.def: New file.
	* gm2-compiler/M2BasicBlock.mod: New file.
	* gm2-compiler/M2Batch.def: New file.
	* gm2-compiler/M2Batch.mod: New file.
	* gm2-compiler/M2Bitset.def: New file.
	* gm2-compiler/M2Bitset.mod: New file.
	* gm2-compiler/M2CaseList.def: New file.
	* gm2-compiler/M2CaseList.mod: New file.
	* gm2-compiler/M2Check.def: New file.
	* gm2-compiler/M2Check.mod: New file.
	* gm2-compiler/M2Code.def: New file.
	* gm2-compiler/M2Code.mod: New file.
	* gm2-compiler/M2ColorString.def: New file.
	* gm2-compiler/M2ColorString.mod: New file.
	* gm2-compiler/M2Comp.def: New file.
	* gm2-compiler/M2Comp.mod: New file.
	* gm2-compiler/M2Configure.def: New file.
	* gm2-compiler/M2Configure.mod: New file.
	* gm2-compiler/M2Const.def: New file.
	* gm2-compiler/M2Const.mod: New file.
	* gm2-compiler/M2Debug.def: New file.
	* gm2-compiler/M2Debug.mod: New file.
	* gm2-compiler/M2DebugStack.def: New file.
	* gm2-compiler/M2DebugStack.mod: New file.
	* gm2-compiler/M2Defaults.def: New file.
	* gm2-compiler/M2Defaults.mod: New file.
	* gm2-compiler/M2Depth.def: New file.
	* gm2-compiler/M2Depth.mod: New file.
	* gm2-compiler/M2DriverOptions.def: New file.
	* gm2-compiler/M2DriverOptions.mod: New file.
	* gm2-compiler/M2Emit.def: New file.
	* gm2-compiler/M2Emit.mod: New file.
	* gm2-compiler/M2Error.def: New file.
	* gm2-compiler/M2Error.mod: New file.
	* gm2-compiler/M2EvalSym.def: New file.
	* gm2-compiler/M2FileName.def: New file.
	* gm2-compiler/M2FileName.mod: New file.
	* gm2-compiler/M2GCCDeclare.def: New file.
	* gm2-compiler/M2GCCDeclare.mod: New file.
	* gm2-compiler/M2GenGCC.def: New file.
	* gm2-compiler/M2GenGCC.mod: New file.
	* gm2-compiler/M2Lex.def: New file.
	* gm2-compiler/M2Lex.mod: New file.
	* gm2-compiler/M2LexBuf.def: New file.
	* gm2-compiler/M2LexBuf.mod: New file.
	* gm2-compiler/M2MetaError.def: New file.
	* gm2-compiler/M2MetaError.mod: New file.
	* gm2-compiler/M2Optimize.def: New file.
	* gm2-compiler/M2Optimize.mod: New file.
	* gm2-compiler/M2Options.def: New file.
	* gm2-compiler/M2Options.mod: New file.
	* gm2-compiler/M2Pass.def: New file.
	* gm2-compiler/M2Pass.mod: New file.
	* gm2-compiler/M2Preprocess.def: New file.
	* gm2-compiler/M2Preprocess.mod: New file.
	* gm2-compiler/M2Printf.def: New file.
	* gm2-compiler/M2Printf.mod: New file.
	* gm2-compiler/M2Quads.def: New file.
	* gm2-compiler/M2Quads.mod: New file.
	* gm2-compiler/M2Quiet.def: New file.
	* gm2-compiler/M2Quiet.mod: New file.
	* gm2-compiler/M2Range.def: New file.
	* gm2-compiler/M2Range.mod: New file.
	* gm2-compiler/M2Reserved.def: New file.
	* gm2-compiler/M2Reserved.mod: New file.
	* gm2-compiler/M2SSA.def: New file.
	* gm2-compiler/M2SSA.mod: New file.
	* gm2-compiler/M2Scope.def: New file.
	* gm2-compiler/M2Scope.mod: New file.
	* gm2-compiler/M2Search.def: New file.
	* gm2-compiler/M2Search.mod: New file.
	* gm2-compiler/M2Size.def: New file.
	* gm2-compiler/M2Size.mod: New file.
	* gm2-compiler/M2StackAddress.def: New file.
	* gm2-compiler/M2StackAddress.mod: New file.
	* gm2-compiler/M2StackWord.def: New file.
	* gm2-compiler/M2StackWord.mod: New file.
	* gm2-compiler/M2Students.def: New file.
	* gm2-compiler/M2Students.mod: New file.
	* gm2-compiler/M2Swig.def: New file.
	* gm2-compiler/M2Swig.mod: New file.
	* gm2-compiler/M2System.def: New file.
	* gm2-compiler/M2System.mod: New file.
	* gm2-compiler/M2Version.def: New file.
	* gm2-compiler/NameKey.def: New file.
	* gm2-compiler/NameKey.mod: New file.
	* gm2-compiler/ObjectFiles.def: New file.
	* gm2-compiler/ObjectFiles.mod: New file.
	* gm2-compiler/P0SymBuild.def: New file.
	* gm2-compiler/P0SymBuild.mod: New file.
	* gm2-compiler/P0SyntaxCheck.def: New file.
	* gm2-compiler/P1Build.def: New file.
	* gm2-compiler/P1SymBuild.def: New file.
	* gm2-compiler/P1SymBuild.mod: New file.
	* gm2-compiler/P2Build.def: New file.
	* gm2-compiler/P2SymBuild.def: New file.
	* gm2-compiler/P2SymBuild.mod: New file.
	* gm2-compiler/P3Build.def: New file.
	* gm2-compiler/P3SymBuild.def: New file.
	* gm2-compiler/P3SymBuild.mod: New file.
	* gm2-compiler/PCBuild.def: New file.
	* gm2-compiler/PCSymBuild.def: New file.
	* gm2-compiler/PCSymBuild.mod: New file.
	* gm2-compiler/PHBuild.def: New file.
	* gm2-compiler/README: New file.
	* gm2-compiler/Sets.def: New file.
	* gm2-compiler/Sets.mod: New file.
	* gm2-compiler/SymbolConversion.def: New file.
	* gm2-compiler/SymbolConversion.mod: New file.
	* gm2-compiler/SymbolKey.def: New file.
	* gm2-compiler/SymbolKey.mod: New file.
	* gm2-compiler/SymbolTable.def: New file.
	* gm2-compiler/SymbolTable.mod: New file.
	* gm2-compiler/bnflex.def: New file.
	* gm2-compiler/bnflex.mod: New file.
	* gm2-compiler/cflex.def: New file.
	* gm2-compiler/gm2.mod: New file.
	* gm2-compiler/gm2lcc.mod: New file.
	* gm2-compiler/gm2lgen.mod: New file.
	* gm2-compiler/gm2lorder.mod: New file.
	* gm2-compiler/m2flex.def: New file.
	* gm2-compiler/ppg.mod: New file.
	* gm2-gcc/README: New file.
	* gm2-gcc/dynamicstrings.h: New file.
	* gm2-gcc/gcc-consolidation.h: New file.
	* gm2-gcc/init.c: New file.
	* gm2-gcc/init.def: New file.
	* gm2-gcc/init.h: New file.
	* gm2-gcc/m2assert.c: New file.
	* gm2-gcc/m2assert.h: New file.
	* gm2-gcc/m2block.c: New file.
	* gm2-gcc/m2block.def: New file.
	* gm2-gcc/m2block.h: New file.
	* gm2-gcc/m2builtins.c: New file.
	* gm2-gcc/m2builtins.def: New file.
	* gm2-gcc/m2builtins.h: New file.
	* gm2-gcc/m2color.c: New file.
	* gm2-gcc/m2color.def: New file.
	* gm2-gcc/m2color.h: New file.
	* gm2-gcc/m2convert.c: New file.
	* gm2-gcc/m2convert.def: New file.
	* gm2-gcc/m2convert.h: New file.
	* gm2-gcc/m2decl.c: New file.
	* gm2-gcc/m2decl.def: New file.
	* gm2-gcc/m2decl.h: New file.
	* gm2-gcc/m2except.c: New file.
	* gm2-gcc/m2except.def: New file.
	* gm2-gcc/m2except.h: New file.
	* gm2-gcc/m2expr.c: New file.
	* gm2-gcc/m2expr.def: New file.
	* gm2-gcc/m2expr.h: New file.
	* gm2-gcc/m2linemap.c: New file.
	* gm2-gcc/m2linemap.def: New file.
	* gm2-gcc/m2linemap.h: New file.
	* gm2-gcc/m2misc.c: New file.
	* gm2-gcc/m2misc.def: New file.
	* gm2-gcc/m2misc.h: New file.
	* gm2-gcc/m2options.h: New file.
	* gm2-gcc/m2range.h: New file.
	* gm2-gcc/m2search.h: New file.
	* gm2-gcc/m2statement.c: New file.
	* gm2-gcc/m2statement.def: New file.
	* gm2-gcc/m2statement.h: New file.
	* gm2-gcc/m2top.c: New file.
	* gm2-gcc/m2top.def: New file.
	* gm2-gcc/m2top.h: New file.
	* gm2-gcc/m2tree.c: New file.
	* gm2-gcc/m2tree.def: New file.
	* gm2-gcc/m2tree.h: New file.
	* gm2-gcc/m2treelib.c: New file.
	* gm2-gcc/m2treelib.def: New file.
	* gm2-gcc/m2treelib.h: New file.
	* gm2-gcc/m2type.c: New file.
	* gm2-gcc/m2type.def: New file.
	* gm2-gcc/m2type.h: New file.
	* gm2-gcc/rtegraph.c: New file.
	* gm2-gcc/rtegraph.h: New file.
	* gm2-ici/M2Emit.mod: New file.
	* gm2-ici/README: New file.
	* gm2-ici/m2linemap.c: New file.
	* gm2-internals.texi: New file.
	* gm2-lang.c: New file.
	* gm2-lang.h: New file.
	* gm2-libiberty/README: New file.
	* gm2-libiberty/choosetemp.def: New file.
	* gm2-libiberty/pexecute.def: New file.
	* gm2-libs-ch/README: New file.
	* gm2-libs-ch/RTcodummy.c: New file.
	* gm2-libs-ch/RTintdummy.c: New file.
	* gm2-libs-ch/Selective.c: New file.
	* gm2-libs-ch/SysExceptions.c: New file.
	* gm2-libs-ch/UnixArgs.c: New file.
	* gm2-libs-ch/cgetopt.c: New file.
	* gm2-libs-ch/choosetemp.c: New file.
	* gm2-libs-ch/dtoa.c: New file.
	* gm2-libs-ch/errno.c: New file.
	* gm2-libs-ch/host.c: New file.
	* gm2-libs-ch/ldtoa.c: New file.
	* gm2-libs-ch/pthdummy.c: New file.
	* gm2-libs-ch/termios.c: New file.
	* gm2-libs-ch/tools.c: New file.
	* gm2-libs-ch/wrapc.c: New file.
	* gm2-libs-ch/xlibc.c: New file.
	* gm2-libs-coroutines/Debug.def: New file.
	* gm2-libs-coroutines/Debug.mod: New file.
	* gm2-libs-coroutines/Executive.def: New file.
	* gm2-libs-coroutines/Executive.mod: New file.
	* gm2-libs-coroutines/KeyBoardLEDs.def: New file.
	* gm2-libs-coroutines/README.texi: New file.
	* gm2-libs-coroutines/SYSTEM.def: New file.
	* gm2-libs-coroutines/SYSTEM.mod: New file.
	* gm2-libs-coroutines/TimerHandler.def: New file.
	* gm2-libs-coroutines/TimerHandler.mod: New file.
	* gm2-libs-iso/COROUTINES.def: New file.
	* gm2-libs-iso/COROUTINES.mod: New file.
	* gm2-libs-iso/ChanConsts.def: New file.
	* gm2-libs-iso/ChanConsts.h: New file.
	* gm2-libs-iso/ChanConsts.mod: New file.
	* gm2-libs-iso/CharClass.def: New file.
	* gm2-libs-iso/CharClass.mod: New file.
	* gm2-libs-iso/ClientSocket.def: New file.
	* gm2-libs-iso/ClientSocket.mod: New file.
	* gm2-libs-iso/ComplexMath.def: New file.
	* gm2-libs-iso/ComplexMath.mod: New file.
	* gm2-libs-iso/ConvStringLong.def: New file.
	* gm2-libs-iso/ConvStringLong.mod: New file.
	* gm2-libs-iso/ConvStringReal.def: New file.
	* gm2-libs-iso/ConvStringReal.mod: New file.
	* gm2-libs-iso/ConvTypes.def: New file.
	* gm2-libs-iso/ConvTypes.mod: New file.
	* gm2-libs-iso/EXCEPTIONS.def: New file.
	* gm2-libs-iso/EXCEPTIONS.mod: New file.
	* gm2-libs-iso/ErrnoCategory.c: New file.
	* gm2-libs-iso/ErrnoCategory.def: New file.
	* gm2-libs-iso/GeneralUserExceptions.def: New file.
	* gm2-libs-iso/GeneralUserExceptions.mod: New file.
	* gm2-libs-iso/IOChan.def: New file.
	* gm2-libs-iso/IOChan.mod: New file.
	* gm2-libs-iso/IOConsts.def: New file.
	* gm2-libs-iso/IOConsts.mod: New file.
	* gm2-libs-iso/IOLink.def: New file.
	* gm2-libs-iso/IOLink.mod: New file.
	* gm2-libs-iso/IOResult.def: New file.
	* gm2-libs-iso/IOResult.mod: New file.
	* gm2-libs-iso/LongComplexMath.def: New file.
	* gm2-libs-iso/LongComplexMath.mod: New file.
	* gm2-libs-iso/LongConv.def: New file.
	* gm2-libs-iso/LongConv.mod: New file.
	* gm2-libs-iso/LongIO.def: New file.
	* gm2-libs-iso/LongIO.mod: New file.
	* gm2-libs-iso/LongMath.def: New file.
	* gm2-libs-iso/LongMath.mod: New file.
	* gm2-libs-iso/LongStr.def: New file.
	* gm2-libs-iso/LongStr.mod: New file.
	* gm2-libs-iso/LongWholeIO.def: New file.
	* gm2-libs-iso/LongWholeIO.mod: New file.
	* gm2-libs-iso/LowLong.def: New file.
	* gm2-libs-iso/LowLong.mod: New file.
	* gm2-libs-iso/LowReal.def: New file.
	* gm2-libs-iso/LowReal.mod: New file.
	* gm2-libs-iso/LowShort.def: New file.
	* gm2-libs-iso/LowShort.mod: New file.
	* gm2-libs-iso/M2EXCEPTION.def: New file.
	* gm2-libs-iso/M2EXCEPTION.mod: New file.
	* gm2-libs-iso/M2RTS.def: New file.
	* gm2-libs-iso/M2RTS.mod: New file.
	* gm2-libs-iso/MemStream.def: New file.
	* gm2-libs-iso/MemStream.mod: New file.
	* gm2-libs-iso/Preemptive.def: New file.
	* gm2-libs-iso/Preemptive.mod: New file.
	* gm2-libs-iso/Processes.def: New file.
	* gm2-libs-iso/Processes.mod: New file.
	* gm2-libs-iso/ProgramArgs.def: New file.
	* gm2-libs-iso/ProgramArgs.mod: New file.
	* gm2-libs-iso/README.texi: New file.
	* gm2-libs-iso/RTco.def: New file.
	* gm2-libs-iso/RTdata.def: New file.
	* gm2-libs-iso/RTdata.mod: New file.
	* gm2-libs-iso/RTentity.def: New file.
	* gm2-libs-iso/RTentity.mod: New file.
	* gm2-libs-iso/RTfio.def: New file.
	* gm2-libs-iso/RTfio.mod: New file.
	* gm2-libs-iso/RTgen.def: New file.
	* gm2-libs-iso/RTgen.mod: New file.
	* gm2-libs-iso/RTgenif.def: New file.
	* gm2-libs-iso/RTgenif.mod: New file.
	* gm2-libs-iso/RTio.def: New file.
	* gm2-libs-iso/RTio.mod: New file.
	* gm2-libs-iso/RandomNumber.def: New file.
	* gm2-libs-iso/RandomNumber.mod: New file.
	* gm2-libs-iso/RawIO.def: New file.
	* gm2-libs-iso/RawIO.mod: New file.
	* gm2-libs-iso/RealConv.def: New file.
	* gm2-libs-iso/RealConv.mod: New file.
	* gm2-libs-iso/RealIO.def: New file.
	* gm2-libs-iso/RealIO.mod: New file.
	* gm2-libs-iso/RealMath.def: New file.
	* gm2-libs-iso/RealMath.mod: New file.
	* gm2-libs-iso/RealStr.def: New file.
	* gm2-libs-iso/RealStr.mod: New file.
	* gm2-libs-iso/RndFile.def: New file.
	* gm2-libs-iso/RndFile.mod: New file.
	* gm2-libs-iso/SIOResult.def: New file.
	* gm2-libs-iso/SIOResult.mod: New file.
	* gm2-libs-iso/SLongIO.def: New file.
	* gm2-libs-iso/SLongIO.mod: New file.
	* gm2-libs-iso/SLongWholeIO.def: New file.
	* gm2-libs-iso/SLongWholeIO.mod: New file.
	* gm2-libs-iso/SRawIO.def: New file.
	* gm2-libs-iso/SRawIO.mod: New file.
	* gm2-libs-iso/SRealIO.def: New file.
	* gm2-libs-iso/SRealIO.mod: New file.
	* gm2-libs-iso/SShortIO.def: New file.
	* gm2-libs-iso/SShortIO.mod: New file.
	* gm2-libs-iso/SShortWholeIO.def: New file.
	* gm2-libs-iso/SShortWholeIO.mod: New file.
	* gm2-libs-iso/STextIO.def: New file.
	* gm2-libs-iso/STextIO.mod: New file.
	* gm2-libs-iso/SWholeIO.def: New file.
	* gm2-libs-iso/SWholeIO.mod: New file.
	* gm2-libs-iso/SYSTEM.def: New file.
	* gm2-libs-iso/SYSTEM.mod: New file.
	* gm2-libs-iso/Semaphores.def: New file.
	* gm2-libs-iso/Semaphores.mod: New file.
	* gm2-libs-iso/SeqFile.def: New file.
	* gm2-libs-iso/SeqFile.mod: New file.
	* gm2-libs-iso/ServerSocket.def: New file.
	* gm2-libs-iso/ServerSocket.mod: New file.
	* gm2-libs-iso/ShortComplexMath.def: New file.
	* gm2-libs-iso/ShortComplexMath.mod: New file.
	* gm2-libs-iso/ShortIO.def: New file.
	* gm2-libs-iso/ShortIO.mod: New file.
	* gm2-libs-iso/ShortWholeIO.def: New file.
	* gm2-libs-iso/ShortWholeIO.mod: New file.
	* gm2-libs-iso/SimpleCipher.def: New file.
	* gm2-libs-iso/SimpleCipher.mod: New file.
	* gm2-libs-iso/StdChans.def: New file.
	* gm2-libs-iso/StdChans.mod: New file.
	* gm2-libs-iso/Storage.def: New file.
	* gm2-libs-iso/Storage.mod: New file.
	* gm2-libs-iso/StreamFile.def: New file.
	* gm2-libs-iso/StreamFile.mod: New file.
	* gm2-libs-iso/StringChan.def: New file.
	* gm2-libs-iso/StringChan.mod: New file.
	* gm2-libs-iso/Strings.def: New file.
	* gm2-libs-iso/Strings.mod: New file.
	* gm2-libs-iso/SysClock.def: New file.
	* gm2-libs-iso/SysClock.mod: New file.
	* gm2-libs-iso/TERMINATION.def: New file.
	* gm2-libs-iso/TERMINATION.mod: New file.
	* gm2-libs-iso/TermFile.def: New file.
	* gm2-libs-iso/TermFile.mod: New file.
	* gm2-libs-iso/TextIO.def: New file.
	* gm2-libs-iso/TextIO.mod: New file.
	* gm2-libs-iso/WholeConv.def: New file.
	* gm2-libs-iso/WholeConv.mod: New file.
	* gm2-libs-iso/WholeIO.def: New file.
	* gm2-libs-iso/WholeIO.mod: New file.
	* gm2-libs-iso/WholeStr.def: New file.
	* gm2-libs-iso/WholeStr.mod: New file.
	* gm2-libs-iso/wrapsock.c: New file.
	* gm2-libs-iso/wrapsock.def: New file.
	* gm2-libs-iso/wraptime.c: New file.
	* gm2-libs-iso/wraptime.def: New file.
	* gm2-libs-min/M2RTS.def: New file.
	* gm2-libs-min/M2RTS.mod: New file.
	* gm2-libs-min/SYSTEM.def: New file.
	* gm2-libs-min/SYSTEM.mod: New file.
	* gm2-libs-min/libc.c: New file.
	* gm2-libs-min/libc.def: New file.
	* gm2-libs-pim/BitBlockOps.def: New file.
	* gm2-libs-pim/BitBlockOps.mod: New file.
	* gm2-libs-pim/BitByteOps.def: New file.
	* gm2-libs-pim/BitByteOps.mod: New file.
	* gm2-libs-pim/BitWordOps.def: New file.
	* gm2-libs-pim/BitWordOps.mod: New file.
	* gm2-libs-pim/BlockOps.def: New file.
	* gm2-libs-pim/BlockOps.mod: New file.
	* gm2-libs-pim/Break.c: New file.
	* gm2-libs-pim/Break.def: New file.
	* gm2-libs-pim/CardinalIO.def: New file.
	* gm2-libs-pim/CardinalIO.mod: New file.
	* gm2-libs-pim/Conversions.def: New file.
	* gm2-libs-pim/Conversions.mod: New file.
	* gm2-libs-pim/DebugPMD.def: New file.
	* gm2-libs-pim/DebugPMD.mod: New file.
	* gm2-libs-pim/DebugTrace.def: New file.
	* gm2-libs-pim/DebugTrace.mod: New file.
	* gm2-libs-pim/Delay.def: New file.
	* gm2-libs-pim/Delay.mod: New file.
	* gm2-libs-pim/Display.def: New file.
	* gm2-libs-pim/Display.mod: New file.
	* gm2-libs-pim/ErrorCode.def: New file.
	* gm2-libs-pim/ErrorCode.mod: New file.
	* gm2-libs-pim/FileSystem.def: New file.
	* gm2-libs-pim/FileSystem.mod: New file.
	* gm2-libs-pim/FloatingUtilities.def: New file.
	* gm2-libs-pim/FloatingUtilities.mod: New file.
	* gm2-libs-pim/InOut.def: New file.
	* gm2-libs-pim/InOut.mod: New file.
	* gm2-libs-pim/Keyboard.def: New file.
	* gm2-libs-pim/Keyboard.mod: New file.
	* gm2-libs-pim/LongIO.def: New file.
	* gm2-libs-pim/LongIO.mod: New file.
	* gm2-libs-pim/NumberConversion.def: New file.
	* gm2-libs-pim/NumberConversion.mod: New file.
	* gm2-libs-pim/README.texi: New file.
	* gm2-libs-pim/Random.def: New file.
	* gm2-libs-pim/Random.mod: New file.
	* gm2-libs-pim/RealConversions.def: New file.
	* gm2-libs-pim/RealConversions.mod: New file.
	* gm2-libs-pim/RealInOut.def: New file.
	* gm2-libs-pim/RealInOut.mod: New file.
	* gm2-libs-pim/Strings.def: New file.
	* gm2-libs-pim/Strings.mod: New file.
	* gm2-libs-pim/Termbase.def: New file.
	* gm2-libs-pim/Termbase.mod: New file.
	* gm2-libs-pim/Terminal.def: New file.
	* gm2-libs-pim/Terminal.mod: New file.
	* gm2-libs-pim/TimeDate.def: New file.
	* gm2-libs-pim/TimeDate.mod: New file.
	* gm2-libs/ASCII.def: New file.
	* gm2-libs/ASCII.mod: New file.
	* gm2-libs/Args.def: New file.
	* gm2-libs/Args.mod: New file.
	* gm2-libs/Assertion.def: New file.
	* gm2-libs/Assertion.mod: New file.
	* gm2-libs/Break.def: New file.
	* gm2-libs/Break.mod: New file.
	* gm2-libs/Builtins.def: New file.
	* gm2-libs/Builtins.mod: New file.
	* gm2-libs/COROUTINES.def: New file.
	* gm2-libs/COROUTINES.mod: New file.
	* gm2-libs/CmdArgs.def: New file.
	* gm2-libs/CmdArgs.mod: New file.
	* gm2-libs/Debug.def: New file.
	* gm2-libs/Debug.mod: New file.
	* gm2-libs/DynamicStrings.def: New file.
	* gm2-libs/DynamicStrings.mod: New file.
	* gm2-libs/Environment.def: New file.
	* gm2-libs/Environment.mod: New file.
	* gm2-libs/FIO.def: New file.
	* gm2-libs/FIO.mod: New file.
	* gm2-libs/FormatStrings.def: New file.
	* gm2-libs/FormatStrings.mod: New file.
	* gm2-libs/FpuIO.def: New file.
	* gm2-libs/FpuIO.mod: New file.
	* gm2-libs/GetOpt.def: New file.
	* gm2-libs/GetOpt.mod: New file.
	* gm2-libs/IO.def: New file.
	* gm2-libs/IO.mod: New file.
	* gm2-libs/Indexing.def: New file.
	* gm2-libs/Indexing.mod: New file.
	* gm2-libs/LMathLib0.def: New file.
	* gm2-libs/LMathLib0.mod: New file.
	* gm2-libs/LegacyReal.def: New file.
	* gm2-libs/LegacyReal.mod: New file.
	* gm2-libs/M2EXCEPTION.def: New file.
	* gm2-libs/M2EXCEPTION.mod: New file.
	* gm2-libs/M2RTS.def: New file.
	* gm2-libs/M2RTS.mod: New file.
	* gm2-libs/MathLib0.def: New file.
	* gm2-libs/MathLib0.mod: New file.
	* gm2-libs/MemUtils.def: New file.
	* gm2-libs/MemUtils.mod: New file.
	* gm2-libs/NumberIO.def: New file.
	* gm2-libs/NumberIO.mod: New file.
	* gm2-libs/OptLib.def: New file.
	* gm2-libs/OptLib.mod: New file.
	* gm2-libs/PushBackInput.def: New file.
	* gm2-libs/PushBackInput.mod: New file.
	* gm2-libs/README.texi: New file.
	* gm2-libs/RTExceptions.def: New file.
	* gm2-libs/RTExceptions.mod: New file.
	* gm2-libs/RTint.def: New file.
	* gm2-libs/RTint.mod: New file.
	* gm2-libs/SArgs.def: New file.
	* gm2-libs/SArgs.mod: New file.
	* gm2-libs/SCmdArgs.def: New file.
	* gm2-libs/SCmdArgs.mod: New file.
	* gm2-libs/SEnvironment.def: New file.
	* gm2-libs/SEnvironment.mod: New file.
	* gm2-libs/SFIO.def: New file.
	* gm2-libs/SFIO.mod: New file.
	* gm2-libs/SMathLib0.def: New file.
	* gm2-libs/SMathLib0.mod: New file.
	* gm2-libs/SYSTEM.def: New file.
	* gm2-libs/SYSTEM.mod: New file.
	* gm2-libs/Scan.def: New file.
	* gm2-libs/Scan.mod: New file.
	* gm2-libs/Selective.def: New file.
	* gm2-libs/StdIO.def: New file.
	* gm2-libs/StdIO.mod: New file.
	* gm2-libs/Storage.def: New file.
	* gm2-libs/Storage.mod: New file.
	* gm2-libs/StrCase.def: New file.
	* gm2-libs/StrCase.mod: New file.
	* gm2-libs/StrIO.def: New file.
	* gm2-libs/StrIO.mod: New file.
	* gm2-libs/StrLib.def: New file.
	* gm2-libs/StrLib.mod: New file.
	* gm2-libs/StringConvert.def: New file.
	* gm2-libs/StringConvert.mod: New file.
	* gm2-libs/SysExceptions.def: New file.
	* gm2-libs/SysStorage.def: New file.
	* gm2-libs/SysStorage.mod: New file.
	* gm2-libs/TimeString.def: New file.
	* gm2-libs/TimeString.mod: New file.
	* gm2-libs/UnixArgs.def: New file.
	* gm2-libs/cbuiltin.def: New file.
	* gm2-libs/cgetopt.def: New file.
	* gm2-libs/config-host: New file.
	* gm2-libs/config-host.in: New file.
	* gm2-libs/cxxabi.def: New file.
	* gm2-libs/dtoa.def: New file.
	* gm2-libs/errno.def: New file.
	* gm2-libs/gdbif.def: New file.
	* gm2-libs/gdbif.mod: New file.
	* gm2-libs/gm2-libs-host.h.in: New file.
	* gm2-libs/ldtoa.def: New file.
	* gm2-libs/libc.def: New file.
	* gm2-libs/libm.def: New file.
	* gm2-libs/sckt.def: New file.
	* gm2-libs/termios.def: New file.
	* gm2-libs/wrapc.def: New file.
	* gm2config.h.in: New file.
	* gm2spec.c: New file.
	* gm2version.h: New file.
	* images/LICENSE.IMG: New file.
	* images/gnu.eps: New file.
	* images/gnupng: New file.
	* init/README: New file.
	* init/gm2-gccinit: New file.
	* init/gm2lccinit: New file.
	* init/gm2lgeninit: New file.
	* init/gm2linit: New file.
	* init/gm2lorderinit: New file.
	* init/gm2minit: New file.
	* init/mcinit: New file.
	* init/ppginit: New file.
	* lang-options.h: New file.
	* lang-specs.h: New file.
	* lang.opt: New file.
	* m2-link-support.h: New file.
	* m2-tree.def: New file.
	* m2-tree.h: New file.
	* m2.flex: New file.
	* m2pp.c: New file.
	* m2pp.h: New file.
	* mc-boot-ch/GBuiltins.c: New file.
	* mc-boot-ch/GRTco.c: New file.
	* mc-boot-ch/GSYSTEM.c: New file.
	* mc-boot-ch/GSelective.c: New file.
	* mc-boot-ch/GSysExceptions.c: New file.
	* mc-boot-ch/GUnixArgs.c: New file.
	* mc-boot-ch/Gcbuiltin.c: New file.
	* mc-boot-ch/Gdtoa.c: New file.
	* mc-boot-ch/Gerrno.c: New file.
	* mc-boot-ch/Gldtoa.c: New file.
	* mc-boot-ch/Glibc.c: New file.
	* mc-boot-ch/Glibm.c: New file.
	* mc-boot-ch/Gmcrts.c: New file.
	* mc-boot-ch/Gmcrts.h: New file.
	* mc-boot-ch/Gnetwork.h: New file.
	* mc-boot-ch/Gpth.c: New file.
	* mc-boot-ch/Gtermios.c: New file.
	* mc-boot-ch/Gwrapc.c: New file.
	* mc-boot-ch/README: New file.
	* mc-boot-ch/network.c: New file.
	* mc-boot/GASCII.c: New file.
	* mc-boot/GASCII.h: New file.
	* mc-boot/GArgs.c: New file.
	* mc-boot/GArgs.h: New file.
	* mc-boot/GAssertion.c: New file.
	* mc-boot/GAssertion.h: New file.
	* mc-boot/GBreak.c: New file.
	* mc-boot/GBreak.h: New file.
	* mc-boot/GCOROUTINES.h: New file.
	* mc-boot/GCmdArgs.c: New file.
	* mc-boot/GCmdArgs.h: New file.
	* mc-boot/GDebug.c: New file.
	* mc-boot/GDebug.h: New file.
	* mc-boot/GDynamicStrings.c: New file.
	* mc-boot/GDynamicStrings.h: New file.
	* mc-boot/GEnvironment.c: New file.
	* mc-boot/GEnvironment.h: New file.
	* mc-boot/GFIO.c: New file.
	* mc-boot/GFIO.h: New file.
	* mc-boot/GFormatStrings.c: New file.
	* mc-boot/GFormatStrings.h: New file.
	* mc-boot/GFpuIO.c: New file.
	* mc-boot/GFpuIO.h: New file.
	* mc-boot/GIO.c: New file.
	* mc-boot/GIO.h: New file.
	* mc-boot/GIndexing.c: New file.
	* mc-boot/GIndexing.h: New file.
	* mc-boot/GM2EXCEPTION.c: New file.
	* mc-boot/GM2EXCEPTION.h: New file.
	* mc-boot/GM2RTS.c: New file.
	* mc-boot/GM2RTS.h: New file.
	* mc-boot/GMemUtils.c: New file.
	* mc-boot/GMemUtils.h: New file.
	* mc-boot/GNumberIO.c: New file.
	* mc-boot/GNumberIO.h: New file.
	* mc-boot/GPushBackInput.c: New file.
	* mc-boot/GPushBackInput.h: New file.
	* mc-boot/GRTExceptions.c: New file.
	* mc-boot/GRTExceptions.h: New file.
	* mc-boot/GRTco.h: New file.
	* mc-boot/GRTint.c: New file.
	* mc-boot/GRTint.h: New file.
	* mc-boot/GSArgs.c: New file.
	* mc-boot/GSArgs.h: New file.
	* mc-boot/GSFIO.c: New file.
	* mc-boot/GSFIO.h: New file.
	* mc-boot/GSYSTEM.h: New file.
	* mc-boot/GSelective.h: New file.
	* mc-boot/GStdIO.c: New file.
	* mc-boot/GStdIO.h: New file.
	* mc-boot/GStorage.c: New file.
	* mc-boot/GStorage.h: New file.
	* mc-boot/GStrCase.c: New file.
	* mc-boot/GStrCase.h: New file.
	* mc-boot/GStrIO.c: New file.
	* mc-boot/GStrIO.h: New file.
	* mc-boot/GStrLib.c: New file.
	* mc-boot/GStrLib.h: New file.
	* mc-boot/GStringConvert.c: New file.
	* mc-boot/GStringConvert.h: New file.
	* mc-boot/GSysExceptions.h: New file.
	* mc-boot/GSysStorage.c: New file.
	* mc-boot/GSysStorage.h: New file.
	* mc-boot/GTimeString.c: New file.
	* mc-boot/GTimeString.h: New file.
	* mc-boot/GUnixArgs.h: New file.
	* mc-boot/Galists.c: New file.
	* mc-boot/Galists.h: New file.
	* mc-boot/Gdecl.c: New file.
	* mc-boot/Gdecl.h: New file.
	* mc-boot/Gdtoa.h: New file.
	* mc-boot/Gerrno.h: New file.
	* mc-boot/Gkeyc.c: New file.
	* mc-boot/Gkeyc.h: New file.
	* mc-boot/Gldtoa.h: New file.
	* mc-boot/Glibc.h: New file.
	* mc-boot/Glibm.h: New file.
	* mc-boot/Glists.c: New file.
	* mc-boot/Glists.h: New file.
	* mc-boot/GmcComment.c: New file.
	* mc-boot/GmcComment.h: New file.
	* mc-boot/GmcComp.c: New file.
	* mc-boot/GmcComp.h: New file.
	* mc-boot/GmcDebug.c: New file.
	* mc-boot/GmcDebug.h: New file.
	* mc-boot/GmcError.c: New file.
	* mc-boot/GmcError.h: New file.
	* mc-boot/GmcFileName.c: New file.
	* mc-boot/GmcFileName.h: New file.
	* mc-boot/GmcLexBuf.c: New file.
	* mc-boot/GmcLexBuf.h: New file.
	* mc-boot/GmcMetaError.c: New file.
	* mc-boot/GmcMetaError.h: New file.
	* mc-boot/GmcOptions.c: New file.
	* mc-boot/GmcOptions.h: New file.
	* mc-boot/GmcPreprocess.c: New file.
	* mc-boot/GmcPreprocess.h: New file.
	* mc-boot/GmcPretty.c: New file.
	* mc-boot/GmcPretty.h: New file.
	* mc-boot/GmcPrintf.c: New file.
	* mc-boot/GmcPrintf.h: New file.
	* mc-boot/GmcQuiet.c: New file.
	* mc-boot/GmcQuiet.h: New file.
	* mc-boot/GmcReserved.c: New file.
	* mc-boot/GmcReserved.h: New file.
	* mc-boot/GmcSearch.c: New file.
	* mc-boot/GmcSearch.h: New file.
	* mc-boot/GmcStack.c: New file.
	* mc-boot/GmcStack.h: New file.
	* mc-boot/GmcStream.c: New file.
	* mc-boot/GmcStream.h: New file.
	* mc-boot/Gmcflex.h: New file.
	* mc-boot/Gmcp1.c: New file.
	* mc-boot/Gmcp1.h: New file.
	* mc-boot/Gmcp2.c: New file.
	* mc-boot/Gmcp2.h: New file.
	* mc-boot/Gmcp3.c: New file.
	* mc-boot/Gmcp3.h: New file.
	* mc-boot/Gmcp4.c: New file.
	* mc-boot/Gmcp4.h: New file.
	* mc-boot/Gmcp5.c: New file.
	* mc-boot/Gmcp5.h: New file.
	* mc-boot/GnameKey.c: New file.
	* mc-boot/GnameKey.h: New file.
	* mc-boot/Gpth.h: New file.
	* mc-boot/GsymbolKey.c: New file.
	* mc-boot/GsymbolKey.h: New file.
	* mc-boot/Gtermios.h: New file.
	* mc-boot/Gtop.c: New file.
	* mc-boot/Gvarargs.c: New file.
	* mc-boot/Gvarargs.h: New file.
	* mc-boot/Gwlists.c: New file.
	* mc-boot/Gwlists.h: New file.
	* mc-boot/Gwrapc.h: New file.
	* mc-boot/README: New file.
	* mc/Indexing.def: New file.
	* mc/Indexing.mod: New file.
	* mc/README: New file.
	* mc/alists.def: New file.
	* mc/alists.mod: New file.
	* mc/decl.def: New file.
	* mc/decl.mod: New file.
	* mc/decl.mod-extra: New file.
	* mc/keyc.def: New file.
	* mc/keyc.mod: New file.
	* mc/lists.def: New file.
	* mc/lists.mod: New file.
	* mc/m2flex.def: New file.
	* mc/mc.flex: New file.
	* mc/mcComment.def: New file.
	* mc/mcComment.h: New file.
	* mc/mcComment.mod: New file.
	* mc/mcComp.def: New file.
	* mc/mcComp.mod: New file.
	* mc/mcDebug.def: New file.
	* mc/mcDebug.mod: New file.
	* mc/mcError.def: New file.
	* mc/mcError.mod: New file.
	* mc/mcFileName.def: New file.
	* mc/mcFileName.mod: New file.
	* mc/mcLexBuf.def: New file.
	* mc/mcLexBuf.h: New file.
	* mc/mcLexBuf.mod: New file.
	* mc/mcMetaError.def: New file.
	* mc/mcMetaError.mod: New file.
	* mc/mcOptions.def: New file.
	* mc/mcOptions.mod: New file.
	* mc/mcPreprocess.def: New file.
	* mc/mcPreprocess.mod: New file.
	* mc/mcPretty.def: New file.
	* mc/mcPretty.mod: New file.
	* mc/mcPrintf.def: New file.
	* mc/mcPrintf.mod: New file.
	* mc/mcQuiet.def: New file.
	* mc/mcQuiet.mod: New file.
	* mc/mcReserved.def: New file.
	* mc/mcReserved.h: New file.
	* mc/mcReserved.mod: New file.
	* mc/mcSearch.def: New file.
	* mc/mcSearch.mod: New file.
	* mc/mcStack.def: New file.
	* mc/mcStack.mod: New file.
	* mc/mcStream.def: New file.
	* mc/mcStream.mod: New file.
	* mc/mcflex.def: New file.
	* mc/mcp1.def: New file.
	* mc/mcp2.def: New file.
	* mc/mcp3.def: New file.
	* mc/mcp4.def: New file.
	* mc/mcp5.def: New file.
	* mc/nameKey.def: New file.
	* mc/nameKey.mod: New file.
	* mc/symbolKey.def: New file.
	* mc/symbolKey.mod: New file.
	* mc/top.mod: New file.
	* mc/varargs.def: New file.
	* mc/varargs.mod: New file.
	* mc/wlists.def: New file.
	* mc/wlists.mod: New file.
	* patches/gcc/11.1.0/01-patches: New file.
	* patches/gcc/11.1.0/02-patches: New file.
	* patches/gcc/11.1.0/03-patches: New file.
	* patches/gcc/11.1.0/04-patches: New file.
	* patches/gcc/11.1.0/05-patches: New file.
	* patches/gcc/11.1.0/06-patches: New file.
	* patches/gcc/11.1.0/07-patches: New file.
	* patches/gcc/11.1.0/08-patches: New file.
	* patches/gcc/11.1.0/09-patches: New file.
	* patches/gcc/11.1.0/10-patches: New file.
	* patches/gcc/11.1.0/11-patches: New file.
	* patches/gcc/11.1.0/12-patches: New file.
	* patches/gcc/11.1.0/13-patches: New file.
	* patches/gcc/11.1.0/14-patches: New file.
	* patches/gcc/11.1.0/15-patches: New file.
	* patches/gcc/11.1.0/16-patches: New file.
	* patches/gcc/11.1.0/17-patches: New file.
	* patches/gcc/11.1.0/18-patches: New file.
	* patches/gcc/11.1.0/19-patches: New file.
	* patches/gcc/11.1.0/20-patches: New file.
	* patches/gcc/11.1.0/21-patches: New file.
	* patches/gcc/11.1.0/22-patches: New file.
	* patches/gcc/11.1.0/23-patches: New file.
	* patches/gcc/3.3.6/01.waldek_patch_gcc: New file.
	* patches/gcc/3.3.6/02.gaius_patch_gcc: New file.
	* patches/gcc/4.1.0/01.gaius_patch_gcc: New file.
	* patches/gcc/4.1.1/01.gaius_patch_gcc: New file.
	* patches/gcc/4.1.2/01-patches: New file.
	* patches/gcc/4.1.2/02-patches: New file.
	* patches/gcc/4.1.2/ChangeLog: New file.
	* patches/gcc/4.1.2/old/01.gaius_patch_gcc: New file.
	* patches/gcc/4.1.2/old/02.gaius_rs6000_lang: New file.
	* patches/gcc/4.1.2/old/03.michael_i386: New file.
	* patches/gcc/4.1.2/old/04.gaius_patch_gcc: New file.
	* patches/gcc/4.1.2/old/05.gaius_patch_gcc: New file.
	* patches/gcc/4.1.2/old/06.gaius_patch_tree: New file.
	* patches/gcc/4.1.2/old/07.michael_i386: New file.
	* patches/gcc/4.1.2/old/08.gaius_ipa_type_escape.c: New file.
	* patches/gcc/4.1.2/old/09.gaius_patch_config: New file.
	* patches/gcc/4.1.2/old/10.michael_snowleopard1: New file.
	* patches/gcc/4.1.2/old/11.michael_snowleopard2: New file.
	* patches/gcc/4.1.2/old/12.gaius_patch_tree_flow_inline_h: New file.
	* patches/gcc/4.7.1/01-patches: New file.
	* patches/gcc/4.7.1/02-patches: New file.
	* patches/gcc/4.7.3/01-patches: New file.
	* patches/gcc/4.7.3/02-patches: New file.
	* patches/gcc/4.7.3/03-patches: New file.
	* patches/gcc/4.7.3/04-patches: New file.
	* patches/gcc/4.7.3/05-patches: New file.
	* patches/gcc/4.7.3/06-patches: New file.
	* patches/gcc/4.7.3/07-patches: New file.
	* patches/gcc/4.7.3/08-patches: New file.
	* patches/gcc/4.7.3/09-patches: New file.
	* patches/gcc/4.7.3/10-patches: New file.
	* patches/gcc/4.7.3/11-patches: New file.
	* patches/gcc/4.7.3/12-patches: New file.
	* patches/gcc/4.7.4/01-patches: New file.
	* patches/gcc/4.7.4/02-patches: New file.
	* patches/gcc/4.7.4/03-patches: New file.
	* patches/gcc/4.7.4/04-patches: New file.
	* patches/gcc/4.7.4/05-patches: New file.
	* patches/gcc/4.7.4/06-patches: New file.
	* patches/gcc/4.7.4/07-patches: New file.
	* patches/gcc/4.7.4/08-patches: New file.
	* patches/gcc/4.7.4/09-patches: New file.
	* patches/gcc/4.7.4/10-patches: New file.
	* patches/gcc/4.7.4/11-patches: New file.
	* patches/gcc/4.7.4/12-patches: New file.
	* patches/gcc/5.2.0/01-patches: New file.
	* patches/gcc/5.2.0/02-patches: New file.
	* patches/gcc/5.2.0/03-patches: New file.
	* patches/gcc/5.2.0/04-patches: New file.
	* patches/gcc/5.2.0/05-patches: New file.
	* patches/gcc/5.2.0/06-patches: New file.
	* patches/gcc/5.2.0/07-patches: New file.
	* patches/gcc/5.2.0/08-patches: New file.
	* patches/gcc/5.2.0/09-patches: New file.
	* patches/gcc/5.2.0/10-patches: New file.
	* patches/gcc/5.2.0/11-patches: New file.
	* patches/gcc/5.2.0/12-patches: New file.
	* patches/gcc/6.4.0/01-patches: New file.
	* patches/gcc/6.4.0/02-patches: New file.
	* patches/gcc/6.4.0/03-patches: New file.
	* patches/gcc/6.4.0/04-patches: New file.
	* patches/gcc/6.4.0/05-patches: New file.
	* patches/gcc/6.4.0/06-patches: New file.
	* patches/gcc/6.4.0/07-patches: New file.
	* patches/gcc/6.4.0/08-patches: New file.
	* patches/gcc/6.4.0/09-patches: New file.
	* patches/gcc/6.4.0/10-patches: New file.
	* patches/gcc/6.4.0/11-patches: New file.
	* patches/gcc/trunc/01-patches: New file.
	* patches/gcc/trunc/02-patches: New file.
	* patches/gcc/trunc/03-patches: New file.
	* patches/gcc/trunc/04-patches: New file.
	* patches/gcc/trunc/05-patches: New file.
	* patches/gcc/trunc/06-patches: New file.
	* patches/gcc/trunc/07-patches: New file.
	* patches/gcc/trunc/08-patches: New file.
	* patches/gcc/trunc/09-patches: New file.
	* patches/gcc/trunc/10-patches: New file.
	* patches/gcc/trunc/11-patches: New file.
	* patches/gcc/trunk/01-patches: New file.
	* patches/gcc/trunk/02-patches: New file.
	* patches/gcc/trunk/03-patches: New file.
	* patches/gcc/trunk/04-patches: New file.
	* patches/gcc/trunk/05-patches: New file.
	* patches/gcc/trunk/06-patches: New file.
	* patches/gcc/trunk/07-patches: New file.
	* patches/gcc/trunk/08-patches: New file.
	* patches/gcc/trunk/09-patches: New file.
	* patches/gcc/trunk/10-patches: New file.
	* patches/gcc/trunk/11-patches: New file.
	* patches/gcc/trunk/12-patches: New file.
	* patches/gcc/trunk/13-patches: New file.
	* patches/gcc/trunk/15-patches: New file.
	* patches/gcc/trunk/23-patches: New file.
	* patches/gcc/trunk/24-patches: New file.
	* patches/gcc/trunk/25-patches: New file.
	* patches/gdb/6.3/01.waldek_patch_gdb: New file.
	* patches/gdb/6.3/02.gaius_patch_gdb: New file.
	* plugin/README: New file.
	* plugin/m2rte.c: New file.
	* tools-src/README: New file.
	* tools-src/array2index.py: New file.
	* tools-src/boilerplate.py: New file.
	* tools-src/buildpg: New file.
	* tools-src/buildsyntax: New file.
	* tools-src/calcpath: New file.
	* tools-src/createUlmSys: New file.
	* tools-src/def2texi.py: New file.
	* tools-src/gensum.py: New file.
	* tools-src/incfile: New file.
	* tools-src/makeSystem: New file.
	* tools-src/makeconfigure: New file.
	* tools-src/makeversion: New file.
	* tools-src/mklink.c: New file.
	* tools-src/tidydates.py: New file.
	* version.c: New file.
	* www/Makefile.in: New file.
	* www/README: New file.
	* www/gm2-logo.ms: New file.
	* www/gm2.css: New file.
	* www/tools/createhtml.py: New file.
	* www/tools/texi2tr/html/about.tpl: New file.
	* www/tools/texi2tr/html/community.html: New file.
	* www/tools/texi2tr/html/community.tpl: New file.
	* www/tools/texi2tr/html/development.html: New file.
	* www/tools/texi2tr/html/development.tpl: New file.
	* www/tools/texi2tr/html/download.tpl: New file.
	* www/tools/texi2tr/html/footer.ht: New file.
	* www/tools/texi2tr/html/header.ht: New file.
	* www/tools/texi2tr/html/heading.ht: New file.
	* www/tools/texi2tr/html/homepage.tpl: New file.
	* www/tools/texi2tr/html/index.html: New file.
	* www/tools/texi2tr/html/license.tpl: New file.
	* www/tools/texi2tr/html/news.html: New file.
	* www/tools/texi2tr/html/news.tpl: New file.
	* www/tools/texi2tr/html/platforms.tpl: New file.
	* www/tools/texi2tr/html/release.tpl: New file.
	* www/tools/texi2tr/html/texi2tr.css: New file.
	* www/tools/texi2tr/html/title.ht: New file.
	* www/tools/texi2tr/html/users.tpl: New file.
	* www/tools/texi2tr/png/200px-Heckert_GNU_white.png: New file.
	* www/tools/texi2tr/png/debian-swirl48x48.png: New file.
	* www/tools/texi2tr/png/develop.png: New file.
	* www/tools/texi2tr/png/install.png: New file.
	* www/tools/texi2tr/png/library.png: New file.
	* www/tools/texi2tr/png/menu-left-tab.png: New file.
	* www/tools/texi2tr/png/menu-right-tab.png: New file.
	* www/tools/texi2tr/png/menu-selected-left-tab.png: New file.
	* www/tools/texi2tr/png/menu-selected-right-tab.png: New file.
	* www/tools/texi2tr/png/next.png: New file.
	* www/tools/texi2tr/png/note.png: New file.
	* www/tools/texi2tr/png/prev.png: New file.
	* www/tools/texi2tr/png/release.png: New file.
	* www/tools/texi2tr/png/snapshot.png: New file.
	* www/tools/texi2tr/png/terminal.png: New file.
	* www/tools/texi2tr/png/users.png: New file.
	* www/tools/texi2tr/src/config.py: New file.
	* www/tools/texi2tr/src/navigation.py: New file.
	* www/tools/texi2tr/src/outputdev.py: New file.
	* www/tools/texi2tr/src/texi2tr.py: New file.

gcc/testsuite/
	* gm2: New directory.
	* gm2/ChangeLog: New file.
	* lib/gm2-dg.exp: New file.
	* lib/gm2-simple.exp: New file.
	* lib/gm2-torture.exp: New file.
	* lib/gm2.exp: New file.

gcc/testsuite/gm2/
	* calling-c/datatypes/unbounded/run/pass/c.c: New file.
	* calling-c/datatypes/unbounded/run/pass/c.def: New file.
	* calling-c/datatypes/unbounded/run/pass/gm2.exp: New file.
	* calling-c/datatypes/unbounded/run/pass/m.mod: New file.
	* case/pass/gm2.exp: New file.
	* case/pass/testcase1.mod: New file.
	* case/pass/testcase2.mod: New file.
	* case/pass/testcase3.mod: New file.
	* case/pass/testcase4.mod: New file.
	* complex/fail/var1.mod: New file.
	* complex/pass/arith.mod: New file.
	* complex/pass/arith2.mod: New file.
	* complex/pass/arith3.mod: New file.
	* complex/pass/arith4.mod: New file.
	* complex/pass/arith5.mod: New file.
	* complex/pass/arith6.mod: New file.
	* complex/pass/consts.mod: New file.
	* complex/pass/consts2.mod: New file.
	* complex/pass/consts3.mod: New file.
	* complex/pass/gm2.exp: New file.
	* complex/pass/tinycabs.mod: New file.
	* complex/pass/var1.mod: New file.
	* complex/pass/var2.mod: New file.
	* complex/pass/var3.mod: New file.
	* complex/pass/var4.mod: New file.
	* complex/pass/var5.mod: New file.
	* complex/pass/var6.mod: New file.
	* complex/pass/var7.mod: New file.
	* complex/pass/var8.mod: New file.
	* complex/run/pass/arith3.mod: New file.
	* complex/run/pass/arith4.mod: New file.
	* complex/run/pass/arith5.mod: New file.
	* complex/run/pass/arith6.mod: New file.
	* complex/run/pass/arith7.mod: New file.
	* complex/run/pass/arith8.mod: New file.
	* complex/run/pass/gm2.exp: New file.
	* coroutines/pim/run/pass/gm2.exp: New file.
	* coroutines/pim/run/pass/testiotransfer.mod: New file.
	* coroutines/pim/run/pass/testtransfer.mod: New file.
	* cpp/fail/another.h: New file.
	* cpp/fail/fail1.mod: New file.
	* cpp/fail/ignore: New file.
	* cpp/fail/ignorem2f: New file.
	* cpp/fail/mustfail: New file.
	* cpp/longcard2.mod: New file.
	* cpp/longstrimp.mod: New file.
	* cpp/pass/arrayhuge.mod: New file.
	* cpp/pass/arrayhuge2.mod: New file.
	* cpp/pass/cpp.mod: New file.
	* cpp/pass/cpph.mod: New file.
	* cpp/pass/gm2.exp: New file.
	* cpp/pass/subaddr.mod: New file.
	* cpp/pass/testcpp.mod: New file.
	* cpp/pass/testcpp2.mod: New file.
	* cpp/setchar2.mod: New file.
	* cpp/setchar6.mod: New file.
	* cse/fail/gm2.exp: New file.
	* cse/fail/testcse38.mod: New file.
	* cse/pass/gm2.exp: New file.
	* cse/pass/m2t.c: New file.
	* cse/pass/testb.mod: New file.
	* cse/pass/testbuiltin.def: New file.
	* cse/pass/testbuiltin.mod: New file.
	* cse/pass/testcse.def: New file.
	* cse/pass/testcse.mod: New file.
	* cse/pass/testcse10.mod: New file.
	* cse/pass/testcse11.mod: New file.
	* cse/pass/testcse12.mod: New file.
	* cse/pass/testcse13.mod: New file.
	* cse/pass/testcse14.mod: New file.
	* cse/pass/testcse15.mod: New file.
	* cse/pass/testcse16.mod: New file.
	* cse/pass/testcse17.mod: New file.
	* cse/pass/testcse18.mod: New file.
	* cse/pass/testcse19.mod: New file.
	* cse/pass/testcse2.mod: New file.
	* cse/pass/testcse20.mod: New file.
	* cse/pass/testcse21.mod: New file.
	* cse/pass/testcse22.mod: New file.
	* cse/pass/testcse23.mod: New file.
	* cse/pass/testcse24.mod: New file.
	* cse/pass/testcse25.mod: New file.
	* cse/pass/testcse26.mod: New file.
	* cse/pass/testcse27.mod: New file.
	* cse/pass/testcse28.mod: New file.
	* cse/pass/testcse29.mod: New file.
	* cse/pass/testcse3.mod: New file.
	* cse/pass/testcse31.mod: New file.
	* cse/pass/testcse32.mod: New file.
	* cse/pass/testcse33.mod: New file.
	* cse/pass/testcse34.mod: New file.
	* cse/pass/testcse35.mod: New file.
	* cse/pass/testcse36.mod: New file.
	* cse/pass/testcse37.mod: New file.
	* cse/pass/testcse39.mod: New file.
	* cse/pass/testcse4.c: New file.
	* cse/pass/testcse4.mod: New file.
	* cse/pass/testcse40.mod: New file.
	* cse/pass/testcse41.mod: New file.
	* cse/pass/testcse42.mod: New file.
	* cse/pass/testcse43.mod: New file.
	* cse/pass/testcse44.mod: New file.
	* cse/pass/testcse45.mod: New file.
	* cse/pass/testcse46.mod: New file.
	* cse/pass/testcse47.mod: New file.
	* cse/pass/testcse48.mod: New file.
	* cse/pass/testcse49.mod: New file.
	* cse/pass/testcse5.c: New file.
	* cse/pass/testcse5.mod: New file.
	* cse/pass/testcse50.def: New file.
	* cse/pass/testcse50.mod: New file.
	* cse/pass/testcse51.mod: New file.
	* cse/pass/testcse52.def: New file.
	* cse/pass/testcse52.mod: New file.
	* cse/pass/testcse53.def: New file.
	* cse/pass/testcse53.mod: New file.
	* cse/pass/testcse6.c: New file.
	* cse/pass/testcse6.mod: New file.
	* cse/pass/testcse7.c: New file.
	* cse/pass/testcse7.mod: New file.
	* cse/pass/testcse8.c: New file.
	* cse/pass/testcse8.mod: New file.
	* cse/pass/testcse9.c: New file.
	* cse/pass/testsize.mod: New file.
	* dynamic/pass/add.mod: New file.
	* dynamic/pass/gm2.exp: New file.
	* dynamic/pass/prog21.mod: New file.
	* dynamic/pass/testarray.mod: New file.
	* dynamic/pass/testarray2.mod: New file.
	* dynamic/pass/testarray3.mod: New file.
	* dynamic/pass/testarray4.mod: New file.
	* dynamic/pass/testarray6.mod: New file.
	* dynamic/pass/testbec.mod: New file.
	* dynamic/pass/testbec10.mod: New file.
	* dynamic/pass/testbec11.mod: New file.
	* dynamic/pass/testbec12.mod: New file.
	* dynamic/pass/testbec13.mod: New file.
	* dynamic/pass/testbec14.mod: New file.
	* dynamic/pass/testbec15.mod: New file.
	* dynamic/pass/testbec16.mod: New file.
	* dynamic/pass/testbec17.mod: New file.
	* dynamic/pass/testbec18.mod: New file.
	* dynamic/pass/testbec19.mod: New file.
	* dynamic/pass/testbec2.mod: New file.
	* dynamic/pass/testbec20.mod: New file.
	* dynamic/pass/testbec21.mod: New file.
	* dynamic/pass/testbec22.mod: New file.
	* dynamic/pass/testbec23.mod: New file.
	* dynamic/pass/testbec24.mod: New file.
	* dynamic/pass/testbec25.mod: New file.
	* dynamic/pass/testbec26.mod: New file.
	* dynamic/pass/testbec27.mod: New file.
	* dynamic/pass/testbec28.mod: New file.
	* dynamic/pass/testbec29.mod: New file.
	* dynamic/pass/testbec3.mod: New file.
	* dynamic/pass/testbec30.mod: New file.
	* dynamic/pass/testbec31.mod: New file.
	* dynamic/pass/testbec32.mod: New file.
	* dynamic/pass/testbec33.mod: New file.
	* dynamic/pass/testbec34.mod: New file.
	* dynamic/pass/testbec35.mod: New file.
	* dynamic/pass/testbec36.mod: New file.
	* dynamic/pass/testbec37.mod: New file.
	* dynamic/pass/testbec38.mod: New file.
	* dynamic/pass/testbec39.mod: New file.
	* dynamic/pass/testbec4.mod: New file.
	* dynamic/pass/testbec40.mod: New file.
	* dynamic/pass/testbec41.mod: New file.
	* dynamic/pass/testbec42.mod: New file.
	* dynamic/pass/testbec43.mod: New file.
	* dynamic/pass/testbec44.mod: New file.
	* dynamic/pass/testbec45.mod: New file.
	* dynamic/pass/testbec5.mod: New file.
	* dynamic/pass/testbec6.mod: New file.
	* dynamic/pass/testbec7.mod: New file.
	* dynamic/pass/testbec8.mod: New file.
	* dynamic/pass/testbec9.mod: New file.
	* dynamic/pass/testdavid.mod: New file.
	* dynamic/pass/testdiv.mod: New file.
	* dynamic/pass/testexp.mod: New file.
	* dynamic/pass/testfor.mod: New file.
	* dynamic/pass/testfor2.mod: New file.
	* dynamic/pass/testfunc.mod: New file.
	* dynamic/pass/testfunc2.mod: New file.
	* dynamic/pass/testfunc3.mod: New file.
	* dynamic/pass/testfunc4.mod: New file.
	* dynamic/pass/testfunc5.mod: New file.
	* dynamic/pass/testfunc6.mod: New file.
	* dynamic/pass/testif.mod: New file.
	* dynamic/pass/testit.mod: New file.
	* dynamic/pass/testloop.mod: New file.
	* dynamic/pass/testloop2.mod: New file.
	* dynamic/pass/testloop3.mod: New file.
	* dynamic/pass/testloop4.mod: New file.
	* dynamic/pass/testloop5.mod: New file.
	* dynamic/pass/testmin.mod: New file.
	* dynamic/pass/testnum4.mod: New file.
	* dynamic/pass/testord.mod: New file.
	* dynamic/pass/testparam.mod: New file.
	* dynamic/pass/testparam2.mod: New file.
	* dynamic/pass/testproc.mod: New file.
	* dynamic/pass/testproc2.c: New file.
	* dynamic/pass/testproc2.def: New file.
	* dynamic/pass/testproc2.mod: New file.
	* dynamic/pass/testscn.mod: New file.
	* dynamic/pass/testset.mod: New file.
	* dynamic/pass/testset2.mod: New file.
	* dynamic/pass/testset3.mod: New file.
	* dynamic/pass/teststr.c: New file.
	* dynamic/pass/teststr.mod: New file.
	* dynamic/pass/teststr2.mod: New file.
	* dynamic/pass/teststring.mod: New file.
	* dynamic/pass/testunbounded.mod: New file.
	* dynamic/pass/testwith.mod: New file.
	* dynamic/pass/testzero.mod: New file.
	* dynamic/pass/wc.mod: New file.
	* embedded/pass/gm2.exp: New file.
	* embedded/pass/varataddress.mod: New file.
	* embedded/pass/varataddress1.mod: New file.
	* embedded/pass/varataddress2.mod: New file.
	* embedded/pass/varataddress3.mod: New file.
	* errors/Makefile.in: New file.
	* errors/fail/array1.mod: New file.
	* errors/fail/badfor.mod: New file.
	* errors/fail/badshift.mod: New file.
	* errors/fail/badsubexpradr.mod: New file.
	* errors/fail/end.mod: New file.
	* errors/fail/gm2.exp: New file.
	* errors/fail/mismatched.mod: New file.
	* errors/fail/mismatchedproc.mod: New file.
	* errors/fail/nestedproc4.mod: New file.
	* errors/fail/nomodule.mod: New file.
	* errors/fail/proctype.mod: New file.
	* errors/fail/prog110.mod: New file.
	* errors/fail/prog111.mod: New file.
	* errors/fail/prog113.mod: New file.
	* errors/fail/prog114.mod: New file.
	* errors/fail/testaddress.mod: New file.
	* errors/fail/testarray.mod: New file.
	* errors/fail/testbit.mod: New file.
	* errors/fail/testbit2.mod: New file.
	* errors/fail/testcase.mod: New file.
	* errors/fail/testcomment.mod: New file.
	* errors/fail/testcomment2.mod: New file.
	* errors/fail/testcomment3.mod: New file.
	* errors/fail/testconst.mod: New file.
	* errors/fail/testdyn.mod: New file.
	* errors/fail/testdyn2.mod: New file.
	* errors/fail/testdyn3.mod: New file.
	* errors/fail/testexp.mod: New file.
	* errors/fail/testfio.mod: New file.
	* errors/fail/testimport.mod: New file.
	* errors/fail/testimport2.def: New file.
	* errors/fail/testimport2.mod: New file.
	* errors/fail/testinit.mod: New file.
	* errors/fail/testmodule.mod: New file.
	* errors/fail/testnil.mod: New file.
	* errors/fail/testnil2.mod: New file.
	* errors/fail/testparam.mod: New file.
	* errors/fail/testproc.mod: New file.
	* errors/fail/testproc2.mod: New file.
	* errors/fail/testsize.mod: New file.
	* errors/fail/teststring.mod: New file.
	* errors/fail/testsub3.mod: New file.
	* errors/fail/testsub4.mod: New file.
	* errors/fail/testtype.mod: New file.
	* errors/fail/testvar.mod: New file.
	* errors/fail/testwith.mod: New file.
	* errors/fail/testwrite.mod: New file.
	* errors/fail/type.mod: New file.
	* errors/mustfail: New file.
	* errors/options: New file.
	* errors/testchar.mod: New file.
	* errors/testsub2.mod: New file.
	* examples/callingC/pass/gm2.exp: New file.
	* examples/callingC/pass/hello.mod: New file.
	* examples/callingC/pass/libprintf.def: New file.
	* examples/callingC/run/pass/c.c: New file.
	* examples/callingC/run/pass/c.def: New file.
	* examples/callingC/run/pass/gm2.exp: New file.
	* examples/callingC/run/pass/hello.mod: New file.
	* examples/callingC/run/pass/libprintf.def: New file.
	* examples/callingC/run/pass/m.mod: New file.
	* examples/cpp/pass/gm2.exp: New file.
	* examples/cpp/pass/hello.mod: New file.
	* examples/cppDef/pass/a.def: New file.
	* examples/cppDef/pass/a.mod: New file.
	* examples/cppDef/pass/b.mod: New file.
	* examples/cppDef/pass/gm2.exp: New file.
	* examples/cppDef/pass/libprintf.def: New file.
	* examples/hello/pass/gm2.exp: New file.
	* examples/hello/pass/hello.mod: New file.
	* examples/map/pass/AdvMap.def: New file.
	* examples/map/pass/AdvMap.mod: New file.
	* examples/map/pass/BoxMap.def: New file.
	* examples/map/pass/BoxMap.mod: New file.
	* examples/map/pass/Chance.def: New file.
	* examples/map/pass/Chance.mod: New file.
	* examples/map/pass/Find.def: New file.
	* examples/map/pass/Find.mod: New file.
	* examples/map/pass/Geometry.def: New file.
	* examples/map/pass/Geometry.mod: New file.
	* examples/map/pass/MakeBoxes.def: New file.
	* examples/map/pass/MakeBoxes.mod: New file.
	* examples/map/pass/Makefile.in: New file.
	* examples/map/pass/Map.mod: New file.
	* examples/map/pass/RoomMap.def: New file.
	* examples/map/pass/RoomMap.mod: New file.
	* examples/map/pass/Semantic.mod: New file.
	* examples/map/pass/StoreCoord.def: New file.
	* examples/map/pass/StoreCoord.mod: New file.
	* examples/map/pass/StoreCoords.def: New file.
	* examples/map/pass/StoreCoords.mod: New file.
	* examples/map/pass/WriteMap.def: New file.
	* examples/map/pass/WriteMap.mod: New file.
	* examples/map/pass/gm2.exp: New file.
	* examples/map/pass/makemaps: New file.
	* examples/map/pass/testch2.mod: New file.
	* examples/map/pass/testchan.mod: New file.
	* examples/map/pass/testcoor.mod: New file.
	* examples/map/pass/testmaps: New file.
	* exceptions/run/pass/cpp.cpp: New file.
	* exceptions/run/pass/cpp.def: New file.
	* exceptions/run/pass/gm2.exp: New file.
	* exceptions/run/pass/libexcept.mod: New file.
	* exceptions/run/pass/m2test.def: New file.
	* exceptions/run/pass/m2test.mod: New file.
	* exceptions/run/pass/mycpp.cpp: New file.
	* exceptions/run/pass/mycpp.def: New file.
	* exceptions/run/pass/mym2.mod: New file.
	* exceptions/run/pass/mym2a.mod: New file.
	* extensions/pass/align.mod: New file.
	* extensions/pass/align2.mod: New file.
	* extensions/pass/card16p.mod: New file.
	* extensions/pass/card32p.mod: New file.
	* extensions/pass/card64p.mod: New file.
	* extensions/pass/card8p.mod: New file.
	* extensions/pass/co.def: New file.
	* extensions/pass/co.mod: New file.
	* extensions/pass/frame.mod: New file.
	* extensions/pass/gm2.exp: New file.
	* extensions/pass/hello.mod: New file.
	* extensions/pass/int16p.mod: New file.
	* extensions/pass/int32p.mod: New file.
	* extensions/pass/int64p.mod: New file.
	* extensions/pass/int8p.mod: New file.
	* extensions/pass/intsize8.mod: New file.
	* extensions/pass/jmp.mod: New file.
	* extensions/pass/libc.def: New file.
	* extensions/pass/optparam.mod: New file.
	* extensions/pass/optparam2.mod: New file.
	* extensions/pass/return.mod: New file.
	* extensions/pass/set8.mod: New file.
	* extensions/pass/set8a.mod: New file.
	* extensions/pass/set8b.mod: New file.
	* extensions/pass/testco.mod: New file.
	* extensions/run/fail/gm2.exp: New file.
	* extensions/run/fail/intsize8.mod: New file.
	* extensions/run/pass/align3.mod: New file.
	* extensions/run/pass/align4.mod: New file.
	* extensions/run/pass/align5.mod: New file.
	* extensions/run/pass/align6.mod: New file.
	* extensions/run/pass/align7.mod: New file.
	* extensions/run/pass/callingc.mod: New file.
	* extensions/run/pass/card16p.mod: New file.
	* extensions/run/pass/card32p.mod: New file.
	* extensions/run/pass/card64p.mod: New file.
	* extensions/run/pass/card8p.mod: New file.
	* extensions/run/pass/column.mod: New file.
	* extensions/run/pass/cvararg.c: New file.
	* extensions/run/pass/cvararg.def: New file.
	* extensions/run/pass/gm2.exp: New file.
	* extensions/run/pass/int16p.mod: New file.
	* extensions/run/pass/int32p.mod: New file.
	* extensions/run/pass/int64p.mod: New file.
	* extensions/run/pass/int8field.mod: New file.
	* extensions/run/pass/int8p.mod: New file.
	* extensions/run/pass/packedrecord.mod: New file.
	* extensions/run/pass/packedrecord2.mod: New file.
	* extensions/run/pass/real32.mod: New file.
	* extensions/run/pass/real32a.mod: New file.
	* extensions/run/pass/record.mod: New file.
	* extensions/run/pass/testopen.mod: New file.
	* extensions/run/pass/vararg.mod: New file.
	* extensions/run/pass/vararg2.mod: New file.
	* extensions/run/pass/vararg3.mod: New file.
	* fpu/pass/five.mod: New file.
	* fpu/pass/fp.def: New file.
	* fpu/pass/fp.mod: New file.
	* fpu/pass/gm2.exp: New file.
	* fpu/pass/one.mod: New file.
	* fpu/pass/r1.mod: New file.
	* fpu/pass/realconst.mod: New file.
	* fpu/pass/testfp.mod: New file.
	* fpu/pass/testfp2.mod: New file.
	* fpu/pass/testfpu1.mod: New file.
	* fpu/pass/testfpu2.mod: New file.
	* fpu/pass/testfpu3.mod: New file.
	* fpu/pass/testsin.mod: New file.
	* imports/run/pass/c.def: New file.
	* imports/run/pass/c.mod: New file.
	* imports/run/pass/gm2.exp: New file.
	* imports/run/pass/innermods.mod: New file.
	* imports/run/pass/innermods2.mod: New file.
	* imports/run/pass/innermods3.mod: New file.
	* imports/run/pass/innermods4.mod: New file.
	* imports/run/pass/innermods5.def: New file.
	* imports/run/pass/innermods5.mod: New file.
	* imports/run/pass/innermods6.mod: New file.
	* integer/div.mod: New file.
	* integer/expr.mod: New file.
	* integer/mod.mod: New file.
	* integer/mod2.mod: New file.
	* integer/mustrunandpass: New file.
	* integer/one.mod: New file.
	* integer/options: New file.
	* integer/zero.mod: New file.
	* iso/analysis/fail/Makefile: New file.
	* iso/analysis/fail/arithoverflow.mod: New file.
	* iso/analysis/fail/arithoverflow2.mod: New file.
	* iso/analysis/fail/arithsubcard.mod: New file.
	* iso/analysis/fail/arrayrange.mod: New file.
	* iso/analysis/fail/assignvalue.mod: New file.
	* iso/analysis/fail/callassignment.mod: New file.
	* iso/analysis/fail/callassignment2.mod: New file.
	* iso/analysis/fail/callassignment3.mod: New file.
	* iso/analysis/fail/callassignment4.mod: New file.
	* iso/analysis/fail/caserange.mod: New file.
	* iso/analysis/fail/decvalue.mod: New file.
	* iso/analysis/fail/forloop.mod: New file.
	* iso/analysis/fail/gm2.exp: New file.
	* iso/analysis/fail/incvalue.mod: New file.
	* iso/analysis/fail/noreturn.mod: New file.
	* iso/analysis/fail/returnvalue.mod: New file.
	* iso/analysis/fail/staticarray.mod: New file.
	* iso/check/fail/gm2.exp: New file.
	* iso/check/fail/modulusoverflow.mod: New file.
	* iso/fail/bug10.mod: New file.
	* iso/fail/bug8.mod: New file.
	* iso/fail/bug9.mod: New file.
	* iso/fail/case.mod: New file.
	* iso/fail/case2.mod: New file.
	* iso/fail/case3.mod: New file.
	* iso/fail/const1.mod: New file.
	* iso/fail/constprocedure.mod: New file.
	* iso/fail/constsubrange.mod: New file.
	* iso/fail/constsubrange2.mod: New file.
	* iso/fail/constsubrange3.mod: New file.
	* iso/fail/defa.def: New file.
	* iso/fail/defa.mod: New file.
	* iso/fail/defb.def: New file.
	* iso/fail/defb.mod: New file.
	* iso/fail/defc.def: New file.
	* iso/fail/defc.mod: New file.
	* iso/fail/except.mod: New file.
	* iso/fail/except2.mod: New file.
	* iso/fail/gm2.exp: New file.
	* iso/fail/isoa.def: New file.
	* iso/fail/isoa.mod: New file.
	* iso/fail/lengthsubexpr.mod: New file.
	* iso/fail/proc.mod: New file.
	* iso/fail/realbitscast.mod: New file.
	* iso/fail/varient.mod: New file.
	* iso/fail/varient2.mod: New file.
	* iso/future/builtinlj.mod: New file.
	* iso/pass/ChanConsts.def: New file.
	* iso/pass/ChanConsts.mod: New file.
	* iso/pass/ConvTypes.def: New file.
	* iso/pass/ConvTypes.mod: New file.
	* iso/pass/addadr1.mod: New file.
	* iso/pass/bits32c.mod: New file.
	* iso/pass/callwraptime.mod: New file.
	* iso/pass/caseiso.mod: New file.
	* iso/pass/caseiso2.mod: New file.
	* iso/pass/cast.mod: New file.
	* iso/pass/cast3.mod: New file.
	* iso/pass/castiso.mod: New file.
	* iso/pass/const1.mod: New file.
	* iso/pass/constreal.mod: New file.
	* iso/pass/constructor1.mod: New file.
	* iso/pass/constructor2.mod: New file.
	* iso/pass/constructor3.mod: New file.
	* iso/pass/constructor4.mod: New file.
	* iso/pass/constructor5.mod: New file.
	* iso/pass/constructor6.mod: New file.
	* iso/pass/constsize4.mod: New file.
	* iso/pass/delim.mod: New file.
	* iso/pass/delim2.mod: New file.
	* iso/pass/enummodule.mod: New file.
	* iso/pass/except1.mod: New file.
	* iso/pass/expproc.mod: New file.
	* iso/pass/expproc2.mod: New file.
	* iso/pass/gm2.exp: New file.
	* iso/pass/isob.def: New file.
	* iso/pass/isob.mod: New file.
	* iso/pass/isobitset.mod: New file.
	* iso/pass/isobitset2.mod: New file.
	* iso/pass/longm.mod: New file.
	* iso/pass/m.mod: New file.
	* iso/pass/proccast.mod: New file.
	* iso/pass/realbitscast.mod: New file.
	* iso/pass/set12.mod: New file.
	* iso/pass/stringchar.mod: New file.
	* iso/pass/subassign.mod: New file.
	* iso/pass/testaddindr.mod: New file.
	* iso/pass/testconv.def: New file.
	* iso/pass/testconv.mod: New file.
	* iso/pass/testconv2.def: New file.
	* iso/pass/testconv2.mod: New file.
	* iso/pass/testconv3.mod: New file.
	* iso/pass/testconv4.mod: New file.
	* iso/pass/testconv5.mod: New file.
	* iso/pass/testconv6.mod: New file.
	* iso/pass/testconv7.mod: New file.
	* iso/pass/testconv8.mod: New file.
	* iso/pass/testconv9.mod: New file.
	* iso/pass/testiso.mod: New file.
	* iso/pass/testiso2.mod: New file.
	* iso/pass/testisosize.mod: New file.
	* iso/pass/testlength.mod: New file.
	* iso/pass/testlength2.mod: New file.
	* iso/pass/testlength3.mod: New file.
	* iso/pass/testlength4.mod: New file.
	* iso/pass/testlength5.mod: New file.
	* iso/pass/unbounded.mod: New file.
	* iso/pass/unbounded2.mod: New file.
	* iso/run/pass/adraddress.mod: New file.
	* iso/run/pass/adrunbounded3.mod: New file.
	* iso/run/pass/baseimport.mod: New file.
	* iso/run/pass/compsize.mod: New file.
	* iso/run/pass/concurrentstore.mod: New file.
	* iso/run/pass/constprocedure.mod: New file.
	* iso/run/pass/constructor1.mod: New file.
	* iso/run/pass/constructor2.mod: New file.
	* iso/run/pass/conststrarray.mod: New file.
	* iso/run/pass/contimer.mod: New file.
	* iso/run/pass/except.c: New file.
	* iso/run/pass/except2.mod: New file.
	* iso/run/pass/except3.cpp: New file.
	* iso/run/pass/except4.mod: New file.
	* iso/run/pass/except5.cpp: New file.
	* iso/run/pass/except5.mod: New file.
	* iso/run/pass/except6.cpp: New file.
	* iso/run/pass/except7.mod: New file.
	* iso/run/pass/except8.mod: New file.
	* iso/run/pass/fileio.def: New file.
	* iso/run/pass/fileio.mod: New file.
	* iso/run/pass/gm2.exp: New file.
	* iso/run/pass/hello.mod: New file.
	* iso/run/pass/int8field.mod: New file.
	* iso/run/pass/long.mod: New file.
	* iso/run/pass/long2.mod: New file.
	* iso/run/pass/long3.mod: New file.
	* iso/run/pass/long4.c: New file.
	* iso/run/pass/long4.mod: New file.
	* iso/run/pass/minmax.mod: New file.
	* iso/run/pass/modulus.mod: New file.
	* iso/run/pass/nestediso.mod: New file.
	* iso/run/pass/nestedrecord.mod: New file.
	* iso/run/pass/onebyte.mod: New file.
	* iso/run/pass/onebyte2.mod: New file.
	* iso/run/pass/onebyte3.mod: New file.
	* iso/run/pass/packed.mod: New file.
	* iso/run/pass/proc.c: New file.
	* iso/run/pass/proc.mod: New file.
	* iso/run/pass/proc2.mod: New file.
	* iso/run/pass/returnrecord.mod: New file.
	* iso/run/pass/shift.mod: New file.
	* iso/run/pass/shift2.mod: New file.
	* iso/run/pass/shift3.mod: New file.
	* iso/run/pass/shift4.mod: New file.
	* iso/run/pass/simple: New file.
	* iso/run/pass/simplelarge.mod: New file.
	* iso/run/pass/strcons.mod: New file.
	* iso/run/pass/strcons2.mod: New file.
	* iso/run/pass/t.cpp: New file.
	* iso/run/pass/t1.cpp: New file.
	* iso/run/pass/testLength.mod: New file.
	* iso/run/pass/testarray.mod: New file.
	* iso/run/pass/testgeneric.mod: New file.
	* iso/run/pass/testlarge.mod: New file.
	* iso/run/pass/testsystem.mod: New file.
	* iso/run/pass/tinyconst.mod: New file.
	* iso/run/pass/tinyconst2.mod: New file.
	* iso/run/pass/tinyconst3.mod: New file.
	* iso/run/pass/tinyconst4.mod: New file.
	* iso/run/pass/tinyconst5.mod: New file.
	* iso/run/pass/tinytimer.mod: New file.
	* iso/run/pass/trivialmodulus.mod: New file.
	* iso/run/pass/tsize.mod: New file.
	* iso/run/pass/tsize2.mod: New file.
	* iso/run/pass/tstLength.mod: New file.
	* iso/run/pass/unbounded.mod: New file.
	* iso/run/pass/unbounded2.mod: New file.
	* iso/run/pass/unbounded3.mod: New file.
	* iso/run/pass/unbounded4.mod: New file.
	* iso/run/pass/unbounded5.mod: New file.
	* iso/run/pass/unbounded6.mod: New file.
	* iso/run/pass/unbounded7.mod: New file.
	* iso/run/pass/unbounded8.mod: New file.
	* isocoroutines/run/pass/coroutine.mod: New file.
	* isocoroutines/run/pass/gm2.exp: New file.
	* isolib/run/pass/arraycons.mod: New file.
	* isolib/run/pass/arraycons2.mod: New file.
	* isolib/run/pass/arraycons3.mod: New file.
	* isolib/run/pass/arraycons5.mod: New file.
	* isolib/run/pass/arraycons6.mod: New file.
	* isolib/run/pass/arraycons7.mod: New file.
	* isolib/run/pass/arrayconst8.mod: New file.
	* isolib/run/pass/exceptiontest.mod: New file.
	* isolib/run/pass/filepos.mod: New file.
	* isolib/run/pass/gm2.exp: New file.
	* isolib/run/pass/hello.mod: New file.
	* isolib/run/pass/insert.mod: New file.
	* isolib/run/pass/intconv.mod: New file.
	* isolib/run/pass/longstr.mod: New file.
	* isolib/run/pass/openlibc.mod: New file.
	* isolib/run/pass/raise.mod: New file.
	* isolib/run/pass/raise2.mod: New file.
	* isolib/run/pass/readreal.mod: New file.
	* isolib/run/pass/real1.mod: New file.
	* isolib/run/pass/real2.mod: New file.
	* isolib/run/pass/real3.mod: New file.
	* isolib/run/pass/realconv.mod: New file.
	* isolib/run/pass/realconv2.mod: New file.
	* isolib/run/pass/realstr.mod: New file.
	* isolib/run/pass/sigfig.mod: New file.
	* isolib/run/pass/stringreal2.mod: New file.
	* isolib/run/pass/termfile.mod-disabled: New file.
	* isolib/run/pass/testappend.mod: New file.
	* isolib/run/pass/testinput: New file.
	* isolib/run/pass/testio.mod: New file.
	* isolib/run/pass/testio2.mod: New file.
	* isolib/run/pass/testmem.mod: New file.
	* isolib/run/pass/testmem2.mod: New file.
	* isolib/run/pass/testnumber: New file.
	* isolib/run/pass/tiny.mod: New file.
	* isolib/run/pass/tiny2.mod: New file.
	* isolib/run/pass/tiny3.mod: New file.
	* isolib/run/pass/tiny4.mod: New file.
	* isolib/run/pass/tiny5.mod: New file.
	* libs/a.def: New file.
	* libs/a.mod: New file.
	* libs/b.def: New file.
	* libs/b.mod: New file.
	* libs/testraw.mod: New file.
	* link/pim/fail/gm2.exp: New file.
	* link/pim/fail/import.mod: New file.
	* link/pim/pass/gm2.exp: New file.
	* linking/libarchive/pass/c.c: New file.
	* linking/libarchive/pass/c.def: New file.
	* linking/libarchive/pass/d.def: New file.
	* linking/libarchive/pass/e.def: New file.
	* linking/libarchive/pass/gm2.exp: New file.
	* linking/libarchive/pass/m.mod: New file.
	* linking/verbose/pass/gm2.exp: New file.
	* linking/verbose/pass/hello.mod: New file.
	* pim/fail/TestLong3.mod: New file.
	* pim/fail/TestLong4.mod: New file.
	* pim/fail/TestLong6.mod: New file.
	* pim/fail/a.def: New file.
	* pim/fail/assignbounds.mod: New file.
	* pim/fail/assignsubrange.mod: New file.
	* pim/fail/assignsubrange2.mod: New file.
	* pim/fail/b.def: New file.
	* pim/fail/bad.def: New file.
	* pim/fail/badconst.mod: New file.
	* pim/fail/badfunc.mod: New file.
	* pim/fail/badfunc.mod.x: New file.
	* pim/fail/badparam.mod: New file.
	* pim/fail/badparam2.mod: New file.
	* pim/fail/badtype.mod: New file.
	* pim/fail/badtypes.mod: New file.
	* pim/fail/bits.mod: New file.
	* pim/fail/bits2.mod: New file.
	* pim/fail/bits3.mod: New file.
	* pim/fail/bits4.mod: New file.
	* pim/fail/cardword.mod: New file.
	* pim/fail/constbec.mod: New file.
	* pim/fail/constsize3.mod: New file.
	* pim/fail/constvar.mod: New file.
	* pim/fail/convert5.mod: New file.
	* pim/fail/dupconst.mod: New file.
	* pim/fail/dupenum.mod: New file.
	* pim/fail/dupfield.mod: New file.
	* pim/fail/duptype.mod: New file.
	* pim/fail/dupvar.mod: New file.
	* pim/fail/expression.mod: New file.
	* pim/fail/expression2.mod: New file.
	* pim/fail/expression3.mod: New file.
	* pim/fail/func.mod: New file.
	* pim/fail/gm2.exp: New file.
	* pim/fail/good.def: New file.
	* pim/fail/good.mod: New file.
	* pim/fail/import.mod: New file.
	* pim/fail/inserttok.def: New file.
	* pim/fail/inserttok.mod: New file.
	* pim/fail/integer.mod: New file.
	* pim/fail/keyword.mod: New file.
	* pim/fail/longtypes2.mod: New file.
	* pim/fail/longtypes3.mod: New file.
	* pim/fail/multisetf.mod: New file.
	* pim/fail/nested3.mod: New file.
	* pim/fail/opaque.mod: New file.
	* pim/fail/opaque2.mod: New file.
	* pim/fail/opasfail.mod: New file.
	* pim/fail/opcpfail.mod: New file.
	* pim/fail/procmod.mod: New file.
	* pim/fail/rotate.mod: New file.
	* pim/fail/rotate2.mod: New file.
	* pim/fail/setbec.mod: New file.
	* pim/fail/setequiv.mod: New file.
	* pim/fail/setsnulf.mod: New file.
	* pim/fail/settype.mod: New file.
	* pim/fail/shift.mod: New file.
	* pim/fail/shift2.mod: New file.
	* pim/fail/subrange7.mod: New file.
	* pim/fail/unary.mod: New file.
	* pim/fail/undeclared.mod: New file.
	* pim/fail/val.mod: New file.
	* pim/fail/val2.mod: New file.
	* pim/fail/wordconst.mod: New file.
	* pim/no-options/run/pass/gm2.exp: New file.
	* pim/no-options/run/pass/integer.mod: New file.
	* pim/options/bounds/fail/IdentifierBug.mod: New file.
	* pim/options/bounds/fail/gm2.exp: New file.
	* pim/options/optimize/run/pass/addition.def: New file.
	* pim/options/optimize/run/pass/addition.mod: New file.
	* pim/options/optimize/run/pass/concat.mod: New file.
	* pim/options/optimize/run/pass/gm2.exp: New file.
	* pim/options/optimize/run/pass/testadd.mod: New file.
	* pim/pass/ABSBug.mod: New file.
	* pim/pass/TestLong7.mod: New file.
	* pim/pass/TestLong8.mod: New file.
	* pim/pass/TestLong9.mod: New file.
	* pim/pass/another.mod: New file.
	* pim/pass/aochar.mod: New file.
	* pim/pass/array.mod: New file.
	* pim/pass/array2.mod: New file.
	* pim/pass/array3.mod: New file.
	* pim/pass/array4.mod: New file.
	* pim/pass/array5.mod: New file.
	* pim/pass/array6.mod: New file.
	* pim/pass/arraybool.mod: New file.
	* pim/pass/arraychar.mod: New file.
	* pim/pass/arraychar2.mod: New file.
	* pim/pass/arraychar3.mod: New file.
	* pim/pass/arrayconst1.mod: New file.
	* pim/pass/arrayconst2.mod: New file.
	* pim/pass/arrayconst3.mod: New file.
	* pim/pass/arraydecl.mod: New file.
	* pim/pass/arraydim.mod: New file.
	* pim/pass/arraydyn.mod: New file.
	* pim/pass/arrayeqiv.mod: New file.
	* pim/pass/arrayfio.mod: New file.
	* pim/pass/arrayhuge.mod: New file.
	* pim/pass/arrayhuge2.mod: New file.
	* pim/pass/arrayindex.mod: New file.
	* pim/pass/arrayindirect.mod: New file.
	* pim/pass/arrayinproc.mod: New file.
	* pim/pass/arrayint.mod: New file.
	* pim/pass/arrayofbyte.mod: New file.
	* pim/pass/arrayofcard.mod: New file.
	* pim/pass/arrayptr.mod: New file.
	* pim/pass/arrayptr2.mod: New file.
	* pim/pass/arrayptr3.mod: New file.
	* pim/pass/arrayptr4.mod: New file.
	* pim/pass/arrayptr5.mod: New file.
	* pim/pass/arrayptr6.mod: New file.
	* pim/pass/arrayrecord.mod: New file.
	* pim/pass/arraytiny.c: New file.
	* pim/pass/arraytiny.mod: New file.
	* pim/pass/arraytype.mod: New file.
	* pim/pass/arraytype2.mod: New file.
	* pim/pass/arraytype3.mod: New file.
	* pim/pass/arraytype4.mod: New file.
	* pim/pass/assignment.mod: New file.
	* pim/pass/assignment2.mod: New file.
	* pim/pass/assignment3.mod: New file.
	* pim/pass/assignment4.mod: New file.
	* pim/pass/badpointer.mod: New file.
	* pim/pass/bits32.def: New file.
	* pim/pass/bits32.mod: New file.
	* pim/pass/bits32i.mod: New file.
	* pim/pass/bitset.mod: New file.
	* pim/pass/bitset2.mod: New file.
	* pim/pass/bitset3.mod: New file.
	* pim/pass/bitset4.mod: New file.
	* pim/pass/bitset5.mod: New file.
	* pim/pass/bitsetfunc.mod: New file.
	* pim/pass/block.mod: New file.
	* pim/pass/blockindirect.mod: New file.
	* pim/pass/builtin.def: New file.
	* pim/pass/builtin.mod: New file.
	* pim/pass/builtin2.mod: New file.
	* pim/pass/builtinconst.mod: New file.
	* pim/pass/bytearray.mod: New file.
	* pim/pass/card.mod: New file.
	* pim/pass/card2.mod: New file.
	* pim/pass/char.mod: New file.
	* pim/pass/char2.mod: New file.
	* pim/pass/charproc.mod: New file.
	* pim/pass/charset.mod: New file.
	* pim/pass/charset2.mod: New file.
	* pim/pass/charset3.mod: New file.
	* pim/pass/checkparm.def: New file.
	* pim/pass/checkparm.mod: New file.
	* pim/pass/colour.mod: New file.
	* pim/pass/comment1.mod: New file.
	* pim/pass/complexarray.mod: New file.
	* pim/pass/complextypes.mod: New file.
	* pim/pass/constcast.mod: New file.
	* pim/pass/constmax.mod: New file.
	* pim/pass/constset.mod: New file.
	* pim/pass/constset2.mod: New file.
	* pim/pass/constset3.mod: New file.
	* pim/pass/constsize.mod: New file.
	* pim/pass/constsize2.mod: New file.
	* pim/pass/convert.mod: New file.
	* pim/pass/convert2.mod: New file.
	* pim/pass/convert3.mod: New file.
	* pim/pass/convert4.mod: New file.
	* pim/pass/danglingelse.mod: New file.
	* pim/pass/debug: New file.
	* pim/pass/defset.def: New file.
	* pim/pass/defset.mod: New file.
	* pim/pass/deftype.mod: New file.
	* pim/pass/divaddr.mod: New file.
	* pim/pass/enum.mod: New file.
	* pim/pass/enum2.mod: New file.
	* pim/pass/enum3.mod: New file.
	* pim/pass/file.mod: New file.
	* pim/pass/filesystem.mod: New file.
	* pim/pass/foo.mod: New file.
	* pim/pass/foo2.mod: New file.
	* pim/pass/for1.mod: New file.
	* pim/pass/function.mod: New file.
	* pim/pass/function2.mod: New file.
	* pim/pass/gcd.def: New file.
	* pim/pass/gcd.mod: New file.
	* pim/pass/getconst.mod: New file.
	* pim/pass/gm2.exp: New file.
	* pim/pass/hello.mod: New file.
	* pim/pass/impa.mod: New file.
	* pim/pass/impb.def: New file.
	* pim/pass/impb.mod: New file.
	* pim/pass/impc.def: New file.
	* pim/pass/impc.mod: New file.
	* pim/pass/impd.mod: New file.
	* pim/pass/impe.mod: New file.
	* pim/pass/impf.mod: New file.
	* pim/pass/impg.mod: New file.
	* pim/pass/imph.mod: New file.
	* pim/pass/impi.mod: New file.
	* pim/pass/impj.mod: New file.
	* pim/pass/impk.mod: New file.
	* pim/pass/impl.mod: New file.
	* pim/pass/impm.mod: New file.
	* pim/pass/impn.def: New file.
	* pim/pass/impn.mod: New file.
	* pim/pass/impo.mod: New file.
	* pim/pass/imports.mod: New file.
	* pim/pass/impp.def: New file.
	* pim/pass/impp.mod: New file.
	* pim/pass/impq.def: New file.
	* pim/pass/impq.mod: New file.
	* pim/pass/incompsets.mod: New file.
	* pim/pass/index.mod: New file.
	* pim/pass/index2.mod: New file.
	* pim/pass/indirect.mod: New file.
	* pim/pass/inner.mod: New file.
	* pim/pass/inner2.mod: New file.
	* pim/pass/int.mod: New file.
	* pim/pass/largeset.mod: New file.
	* pim/pass/largeset1.mod: New file.
	* pim/pass/largeset2.mod: New file.
	* pim/pass/largeset3.mod: New file.
	* pim/pass/largeset4.mod: New file.
	* pim/pass/largeset5.mod: New file.
	* pim/pass/largeset6.mod: New file.
	* pim/pass/largeset7.mod: New file.
	* pim/pass/localmod.mod: New file.
	* pim/pass/localproc.mod: New file.
	* pim/pass/localvar.mod: New file.
	* pim/pass/log: New file.
	* pim/pass/longint.mod: New file.
	* pim/pass/longint2.mod: New file.
	* pim/pass/longmm.mod: New file.
	* pim/pass/longreal.mod: New file.
	* pim/pass/longtypes.mod: New file.
	* pim/pass/longtypes3.mod: New file.
	* pim/pass/longtypes4.mod: New file.
	* pim/pass/longtypes5.mod: New file.
	* pim/pass/longtypes6.mod: New file.
	* pim/pass/loopexit.mod: New file.
	* pim/pass/math.mod: New file.
	* pim/pass/maxlongint.mod: New file.
	* pim/pass/maxreal.mod: New file.
	* pim/pass/maxreal2.mod: New file.
	* pim/pass/minmaxconst.mod: New file.
	* pim/pass/minmaxconst2.mod: New file.
	* pim/pass/modaddr.mod: New file.
	* pim/pass/multaddr.mod: New file.
	* pim/pass/multiple.mod: New file.
	* pim/pass/multiset.mod: New file.
	* pim/pass/multtypes.mod: New file.
	* pim/pass/mydef.def: New file.
	* pim/pass/negatives.def: New file.
	* pim/pass/negatives.mod: New file.
	* pim/pass/nested.mod: New file.
	* pim/pass/nested2.mod: New file.
	* pim/pass/nested3.mod: New file.
	* pim/pass/nested4.mod: New file.
	* pim/pass/nested5.mod: New file.
	* pim/pass/nested6.mod: New file.
	* pim/pass/nested7.mod: New file.
	* pim/pass/nestedfor.mod: New file.
	* pim/pass/nestedif.mod: New file.
	* pim/pass/nestedset.mod: New file.
	* pim/pass/onezero.mod: New file.
	* pim/pass/opaque.def: New file.
	* pim/pass/opaque.mod: New file.
	* pim/pass/opaque2.mod: New file.
	* pim/pass/opaquetype.def: New file.
	* pim/pass/opaquetype.mod: New file.
	* pim/pass/param.mod: New file.
	* pim/pass/param2.mod: New file.
	* pim/pass/param3.mod: New file.
	* pim/pass/parambool.mod: New file.
	* pim/pass/paramreal.mod: New file.
	* pim/pass/pimimp.mod: New file.
	* pim/pass/pointer.mod: New file.
	* pim/pass/procadr.mod: New file.
	* pim/pass/procconv.mod: New file.
	* pim/pass/procconv2.mod: New file.
	* pim/pass/procedure1.mod: New file.
	* pim/pass/procedure2.mod: New file.
	* pim/pass/procindirect.mod: New file.
	* pim/pass/procmod.mod: New file.
	* pim/pass/procmod2.mod: New file.
	* pim/pass/procmod3.mod: New file.
	* pim/pass/procmod31.mod: New file.
	* pim/pass/procmod4.mod: New file.
	* pim/pass/procmod5.mod: New file.
	* pim/pass/procmod6.def: New file.
	* pim/pass/procmod6.mod: New file.
	* pim/pass/procmod7.mod: New file.
	* pim/pass/procmod8.mod: New file.
	* pim/pass/procmod9.mod: New file.
	* pim/pass/proctype.mod: New file.
	* pim/pass/proctype2.def: New file.
	* pim/pass/proctype3.mod: New file.
	* pim/pass/proctype4.mod: New file.
	* pim/pass/program.mod: New file.
	* pim/pass/program2.mod: New file.
	* pim/pass/ptrarray.mod: New file.
	* pim/pass/ptrarray2.mod: New file.
	* pim/pass/ptrarray3.mod: New file.
	* pim/pass/ptrcard.mod: New file.
	* pim/pass/quads.def: New file.
	* pim/pass/quads.mod: New file.
	* pim/pass/real.mod: New file.
	* pim/pass/real2.mod: New file.
	* pim/pass/real3.mod: New file.
	* pim/pass/realconst.mod: New file.
	* pim/pass/realneg.mod: New file.
	* pim/pass/realneg2.mod: New file.
	* pim/pass/realone.mod: New file.
	* pim/pass/realsize.mod: New file.
	* pim/pass/record1.mod: New file.
	* pim/pass/record10.mod: New file.
	* pim/pass/record11.mod: New file.
	* pim/pass/record12.def: New file.
	* pim/pass/record13.def: New file.
	* pim/pass/record14.def: New file.
	* pim/pass/record15.def: New file.
	* pim/pass/record16.def: New file.
	* pim/pass/record2.mod: New file.
	* pim/pass/record3.mod: New file.
	* pim/pass/record4.mod: New file.
	* pim/pass/record5.mod: New file.
	* pim/pass/record6.mod: New file.
	* pim/pass/record7.mod: New file.
	* pim/pass/record8.mod: New file.
	* pim/pass/record9.mod: New file.
	* pim/pass/recordarray.c: New file.
	* pim/pass/recordarray.mod: New file.
	* pim/pass/recordarray2.mod: New file.
	* pim/pass/redef.mod: New file.
	* pim/pass/set10.mod: New file.
	* pim/pass/set11.def: New file.
	* pim/pass/set11.mod: New file.
	* pim/pass/set12.mod: New file.
	* pim/pass/set4.mod: New file.
	* pim/pass/set5.mod: New file.
	* pim/pass/set6.mod: New file.
	* pim/pass/set7.mod: New file.
	* pim/pass/set8.mod: New file.
	* pim/pass/set9.mod: New file.
	* pim/pass/setchar.mod: New file.
	* pim/pass/setchar10.mod: New file.
	* pim/pass/setchar11.mod: New file.
	* pim/pass/setchar3.mod: New file.
	* pim/pass/setchar4.mod: New file.
	* pim/pass/setchar5.mod: New file.
	* pim/pass/setchar7.mod: New file.
	* pim/pass/setchar8.mod: New file.
	* pim/pass/setchar9.mod: New file.
	* pim/pass/setconst.mod: New file.
	* pim/pass/setconst2.mod: New file.
	* pim/pass/setconst3.mod: New file.
	* pim/pass/setenum.mod: New file.
	* pim/pass/setimp.mod: New file.
	* pim/pass/setimp2.mod: New file.
	* pim/pass/setofchar.mod: New file.
	* pim/pass/setoverflow.mod: New file.
	* pim/pass/sets.mod: New file.
	* pim/pass/sets2.mod: New file.
	* pim/pass/sets3.mod: New file.
	* pim/pass/sets4.mod: New file.
	* pim/pass/sets5.mod: New file.
	* pim/pass/sets6.mod: New file.
	* pim/pass/setsnul.mod: New file.
	* pim/pass/settest1.mod: New file.
	* pim/pass/settest2.mod: New file.
	* pim/pass/settest3.mod: New file.
	* pim/pass/simpleproc.mod: New file.
	* pim/pass/sizes.mod: New file.
	* pim/pass/sizetype.mod: New file.
	* pim/pass/smallset1.mod: New file.
	* pim/pass/smallset2.mod: New file.
	* pim/pass/smallset3.mod: New file.
	* pim/pass/smallset4.mod: New file.
	* pim/pass/smallset5.mod: New file.
	* pim/pass/smallset6.mod: New file.
	* pim/pass/smallset7.mod: New file.
	* pim/pass/stabs.mod: New file.
	* pim/pass/stdio.mod: New file.
	* pim/pass/str1.mod: New file.
	* pim/pass/str2.mod: New file.
	* pim/pass/str3.mod: New file.
	* pim/pass/str4.mod: New file.
	* pim/pass/str5.mod: New file.
	* pim/pass/stressset.mod: New file.
	* pim/pass/stringassign.mod: New file.
	* pim/pass/stringopaq.mod: New file.
	* pim/pass/strings.mod: New file.
	* pim/pass/strparam.def: New file.
	* pim/pass/strparam.mod: New file.
	* pim/pass/subrange.mod: New file.
	* pim/pass/subrange10.mod: New file.
	* pim/pass/subrange11.mod: New file.
	* pim/pass/subrange12.mod: New file.
	* pim/pass/subrange14.mod: New file.
	* pim/pass/subrange15.mod: New file.
	* pim/pass/subrange16.mod: New file.
	* pim/pass/subrange17.mod: New file.
	* pim/pass/subrange2.mod: New file.
	* pim/pass/subrange3.mod: New file.
	* pim/pass/subrange4.mod: New file.
	* pim/pass/subrange5.mod: New file.
	* pim/pass/subrange6.mod: New file.
	* pim/pass/subrange7.mod: New file.
	* pim/pass/subrange8.mod: New file.
	* pim/pass/subrange9.mod: New file.
	* pim/pass/test2recursive.mod: New file.
	* pim/pass/testabs.mod: New file.
	* pim/pass/testbuiltin.mod: New file.
	* pim/pass/testbuiltin2.mod: New file.
	* pim/pass/testbuiltstr.mod: New file.
	* pim/pass/testcap.mod: New file.
	* pim/pass/testcap2.mod: New file.
	* pim/pass/testcard.mod: New file.
	* pim/pass/testcard2.mod: New file.
	* pim/pass/testcard3.mod: New file.
	* pim/pass/testcard4.mod: New file.
	* pim/pass/testcard5.mod: New file.
	* pim/pass/testcase.mod: New file.
	* pim/pass/testcase2.mod: New file.
	* pim/pass/testcase3.mod: New file.
	* pim/pass/testcase4.mod: New file.
	* pim/pass/testchar.mod: New file.
	* pim/pass/testfloat.mod: New file.
	* pim/pass/testfloat2.mod: New file.
	* pim/pass/testfloat3.mod: New file.
	* pim/pass/testfloat4.mod: New file.
	* pim/pass/testfor.mod: New file.
	* pim/pass/testimpvar.mod: New file.
	* pim/pass/testlong3.mod: New file.
	* pim/pass/testmod.mod: New file.
	* pim/pass/testmod2.mod: New file.
	* pim/pass/testodd.mod: New file.
	* pim/pass/testopaque.mod: New file.
	* pim/pass/testopaque2.mod: New file.
	* pim/pass/testopaque3.mod: New file.
	* pim/pass/testord.mod: New file.
	* pim/pass/testparam.mod: New file.
	* pim/pass/testparam2.mod: New file.
	* pim/pass/testparam3.mod: New file.
	* pim/pass/testpimsize.mod: New file.
	* pim/pass/testrecursive.def: New file.
	* pim/pass/testrecursive.mod: New file.
	* pim/pass/testreturnstr.mod: New file.
	* pim/pass/testset.mod: New file.
	* pim/pass/testshort.mod: New file.
	* pim/pass/testsinf.mod: New file.
	* pim/pass/testsinl.mod: New file.
	* pim/pass/testsize.mod: New file.
	* pim/pass/testvar.mod: New file.
	* pim/pass/testvarin.mod: New file.
	* pim/pass/timeio.mod: New file.
	* pim/pass/timeio2.mod: New file.
	* pim/pass/timeio3.mod: New file.
	* pim/pass/timeio4.mod: New file.
	* pim/pass/timeio5.mod: New file.
	* pim/pass/timeio6.mod: New file.
	* pim/pass/timeio7.mod: New file.
	* pim/pass/timeio8.mod: New file.
	* pim/pass/timeio9.mod: New file.
	* pim/pass/tinyalloc.mod: New file.
	* pim/pass/tinyarray.mod: New file.
	* pim/pass/tinyarray2.mod: New file.
	* pim/pass/tinyarray3.mod: New file.
	* pim/pass/tinyarray4.mod: New file.
	* pim/pass/tinyarray5.mod: New file.
	* pim/pass/tinyarray6.mod: New file.
	* pim/pass/tinyassign.def: New file.
	* pim/pass/tinyassign.mod: New file.
	* pim/pass/tinyassign2.mod: New file.
	* pim/pass/tinyassign3.mod: New file.
	* pim/pass/tinyassign4.mod: New file.
	* pim/pass/tinyassign5.mod: New file.
	* pim/pass/tinybitset.mod: New file.
	* pim/pass/tinyelse.mod: New file.
	* pim/pass/tinyenum.mod: New file.
	* pim/pass/tinyfor.mod: New file.
	* pim/pass/tinyfor2.mod: New file.
	* pim/pass/tinyfor3.mod: New file.
	* pim/pass/tinyhalt.mod: New file.
	* pim/pass/tinyhello.mod: New file.
	* pim/pass/tinyif.mod: New file.
	* pim/pass/tinyif2.mod: New file.
	* pim/pass/tinyif3.mod: New file.
	* pim/pass/tinyif4.mod: New file.
	* pim/pass/tinyif5.mod: New file.
	* pim/pass/tinyif6.mod: New file.
	* pim/pass/tinyif7.mod: New file.
	* pim/pass/tinyif8.mod: New file.
	* pim/pass/tinyimp.mod: New file.
	* pim/pass/tinylit.mod: New file.
	* pim/pass/tinylit2.mod: New file.
	* pim/pass/tinymax.mod: New file.
	* pim/pass/tinymod.mod: New file.
	* pim/pass/tinynode.mod: New file.
	* pim/pass/tinyparam.mod: New file.
	* pim/pass/tinyparam2.mod: New file.
	* pim/pass/tinyplus.mod: New file.
	* pim/pass/tinyproc.mod: New file.
	* pim/pass/tinyproc2.mod: New file.
	* pim/pass/tinyproc3.mod: New file.
	* pim/pass/tinyproc4.mod: New file.
	* pim/pass/tinyproc5.mod: New file.
	* pim/pass/tinyproc6.mod: New file.
	* pim/pass/tinyptr.mod: New file.
	* pim/pass/tinyreal.mod: New file.
	* pim/pass/tinyrecord.mod: New file.
	* pim/pass/tinyrepeat.mod: New file.
	* pim/pass/tinyset6.mod: New file.
	* pim/pass/tinyset7.mod: New file.
	* pim/pass/tinystate.mod: New file.
	* pim/pass/tinysub.def: New file.
	* pim/pass/tinytest.mod: New file.
	* pim/pass/tinytrue.mod: New file.
	* pim/pass/tinyvar.mod: New file.
	* pim/pass/tinyvar2.mod: New file.
	* pim/pass/tinyvar3.mod: New file.
	* pim/pass/tinyvar4.mod: New file.
	* pim/pass/tinyvar5.mod: New file.
	* pim/pass/tinyvarient.mod: New file.
	* pim/pass/tinyvarient2.mod: New file.
	* pim/pass/tinyvarient3.def: New file.
	* pim/pass/tinyvarient3.mod: New file.
	* pim/pass/tinyvarient4.mod: New file.
	* pim/pass/tinyvarient5.mod: New file.
	* pim/pass/tinyvarient6.mod: New file.
	* pim/pass/tinywhile.mod: New file.
	* pim/pass/tinywith.mod: New file.
	* pim/pass/tinywith2.mod: New file.
	* pim/pass/tinywith3.mod: New file.
	* pim/pass/tinywith4.mod: New file.
	* pim/pass/tinywith5.mod: New file.
	* pim/pass/tinywith6.mod: New file.
	* pim/pass/trunc.mod: New file.
	* pim/pass/try: New file.
	* pim/pass/typeequiv.mod: New file.
	* pim/pass/typeequiv2.mod: New file.
	* pim/pass/typeequiv3.mod: New file.
	* pim/pass/typeonly.def: New file.
	* pim/pass/typeonly.mod: New file.
	* pim/pass/typesize.mod: New file.
	* pim/pass/unbounded.mod: New file.
	* pim/pass/unbounded2.mod: New file.
	* pim/pass/unbounded3.mod: New file.
	* pim/pass/v.def: New file.
	* pim/pass/varaddress.mod: New file.
	* pim/pass/varaddress2.mod: New file.
	* pim/pass/varaddress3.mod: New file.
	* pim/pass/varcard.mod: New file.
	* pim/pass/variant9.mod: New file.
	* pim/pass/varient.mod: New file.
	* pim/pass/varient2.mod: New file.
	* pim/pass/varient3.mod: New file.
	* pim/pass/varient4.mod: New file.
	* pim/pass/varient5.mod: New file.
	* pim/pass/varient6.mod: New file.
	* pim/pass/varient7.mod: New file.
	* pim/pass/varient8.mod: New file.
	* pim/pass/varin.def: New file.
	* pim/pass/varin.mod: New file.
	* pim/pass/varint.mod: New file.
	* pim/pass/wincat.mod: New file.
	* pim/pass/with.mod: New file.
	* pim/pass/wordconst.mod: New file.
	* pim/run/fail/case.mod: New file.
	* pim/run/fail/gm2.exp: New file.
	* pim/run/fail/nil.mod: New file.
	* pim/run/pass/Countdown.mod: New file.
	* pim/run/pass/EndFor.def: New file.
	* pim/run/pass/EndFor.mod: New file.
	* pim/run/pass/EnumTest.mod: New file.
	* pim/run/pass/For1.mod: New file.
	* pim/run/pass/For10.mod: New file.
	* pim/run/pass/For11.mod: New file.
	* pim/run/pass/For12.mod: New file.
	* pim/run/pass/For2.mod: New file.
	* pim/run/pass/For3.mod: New file.
	* pim/run/pass/For4.mod: New file.
	* pim/run/pass/For5.mod: New file.
	* pim/run/pass/For6.mod: New file.
	* pim/run/pass/For7.mod: New file.
	* pim/run/pass/For8.mod: New file.
	* pim/run/pass/For9.mod: New file.
	* pim/run/pass/FpuIOBug.mod: New file.
	* pim/run/pass/MaxReal.mod: New file.
	* pim/run/pass/MaxReal2.mod: New file.
	* pim/run/pass/TestLong.mod: New file.
	* pim/run/pass/TestLong2.mod: New file.
	* pim/run/pass/TestLong4.mod: New file.
	* pim/run/pass/TestLong5.mod: New file.
	* pim/run/pass/addrarray.mod: New file.
	* pim/run/pass/arraychar.mod: New file.
	* pim/run/pass/arraychar2.mod: New file.
	* pim/run/pass/arrayrecord.mod: New file.
	* pim/run/pass/bitsettest.def: New file.
	* pim/run/pass/bitsettest.mod: New file.
	* pim/run/pass/bytearray.mod: New file.
	* pim/run/pass/constdynstr.mod: New file.
	* pim/run/pass/conststr.mod: New file.
	* pim/run/pass/conststr2.mod: New file.
	* pim/run/pass/cycles.mod: New file.
	* pim/run/pass/dec.mod: New file.
	* pim/run/pass/enums.mod: New file.
	* pim/run/pass/gm2.exp: New file.
	* pim/run/pass/incsubrange.def: New file.
	* pim/run/pass/incsubrange.mod: New file.
	* pim/run/pass/index3.mod: New file.
	* pim/run/pass/int16.mod: New file.
	* pim/run/pass/int32.mod: New file.
	* pim/run/pass/int8.mod: New file.
	* pim/run/pass/line.mod: New file.
	* pim/run/pass/long.mod: New file.
	* pim/run/pass/longfor.mod: New file.
	* pim/run/pass/longtypes10.mod: New file.
	* pim/run/pass/longtypes7.mod: New file.
	* pim/run/pass/longtypes8.mod: New file.
	* pim/run/pass/longtypes9.mod: New file.
	* pim/run/pass/math.mod: New file.
	* pim/run/pass/math2.mod: New file.
	* pim/run/pass/mathconst.mod: New file.
	* pim/run/pass/minimal.mod: New file.
	* pim/run/pass/nestedproc.mod: New file.
	* pim/run/pass/nestedproc2.mod: New file.
	* pim/run/pass/nestedproc3.mod: New file.
	* pim/run/pass/nestedproc4.mod: New file.
	* pim/run/pass/nestedproc5.mod: New file.
	* pim/run/pass/nestedproc6.mod: New file.
	* pim/run/pass/nestedproc7.mod: New file.
	* pim/run/pass/nestedwith.mod: New file.
	* pim/run/pass/nestedwith2.mod: New file.
	* pim/run/pass/nestedwith3.mod: New file.
	* pim/run/pass/nothing.mod: New file.
	* pim/run/pass/prog31ex.mod: New file.
	* pim/run/pass/rts.mod: New file.
	* pim/run/pass/setcritical.mod: New file.
	* pim/run/pass/setequiv.mod: New file.
	* pim/run/pass/str6.mod: New file.
	* pim/run/pass/stringaddr.mod: New file.
	* pim/run/pass/stringaddr2.def: New file.
	* pim/run/pass/stringaddr2.mod: New file.
	* pim/run/pass/stripped.mod: New file.
	* pim/run/pass/sys.def: New file.
	* pim/run/pass/sys.mod: New file.
	* pim/run/pass/t.def: New file.
	* pim/run/pass/testaddr.mod: New file.
	* pim/run/pass/testaddr2.mod: New file.
	* pim/run/pass/testaddr3.mod: New file.
	* pim/run/pass/testarray.mod: New file.
	* pim/run/pass/testarray2.mod: New file.
	* pim/run/pass/testarray3.mod: New file.
	* pim/run/pass/testarray4.mod: New file.
	* pim/run/pass/testarray5.mod: New file.
	* pim/run/pass/testavail.mod: New file.
	* pim/run/pass/testdiv.mod: New file.
	* pim/run/pass/testfpufunc.mod: New file.
	* pim/run/pass/testfpufunc2.mod: New file.
	* pim/run/pass/testlarge.mod: New file.
	* pim/run/pass/testlarge2.mod: New file.
	* pim/run/pass/testnextproc.mod: New file.
	* pim/run/pass/testparam.mod: New file.
	* pim/run/pass/testpound.mod: New file.
	* pim/run/pass/testreturnstr.mod: New file.
	* pim/run/pass/testreturnstr2.mod: New file.
	* pim/run/pass/testreturnstr3.def: New file.
	* pim/run/pass/testreturnstr3.mod: New file.
	* pim/run/pass/testsize.mod: New file.
	* pim/run/pass/testsize2.mod: New file.
	* pim/run/pass/testsize3.mod: New file.
	* pim/run/pass/tinywith.mod: New file.
	* pim/run/pass/unbounded.mod: New file.
	* pim/run/pass/varaddress3.mod: New file.
	* pim/run/pass/varparam2.mod: New file.
	* pim/run/pass/varparam3.mod: New file.
	* pim/run/pass/varparm.mod: New file.
	* pim/run/pass/wr.mod: New file.
	* pimcoroutines/pass/gm2.exp: New file.
	* pimcoroutines/pass/imports.mod: New file.
	* pimcoroutines/pass/imports2.mod: New file.
	* pimcoroutines/run/pass/gm2.exp: New file.
	* pimcoroutines/run/pass/testtime.mod: New file.
	* pimlib/base/run/pass/FIO.mod: New file.
	* pimlib/base/run/pass/StrLib.mod: New file.
	* pimlib/base/run/pass/gm2.exp: New file.
	* pimlib/base/run/pass/testconvert.mod: New file.
	* pimlib/coroutines/pass/gm2.exp: New file.
	* pimlib/coroutines/pass/priority.mod: New file.
	* pimlib/coroutines/pass/priority2.mod: New file.
	* pimlib/coroutines/pass/priority3.def: New file.
	* pimlib/coroutines/pass/priority3.mod: New file.
	* pimlib/logitech/pass/LogitechLong.mod: New file.
	* pimlib/logitech/pass/gm2.exp: New file.
	* pimlib/logitech/pass/hello.mod: New file.
	* pimlib/logitech/run/pass/bbits.mod: New file.
	* pimlib/logitech/run/pass/gm2.exp: New file.
	* pimlib/logitech/run/pass/hello.mod: New file.
	* pimlib/logitech/run/pass/helloinout.mod: New file.
	* pimlib/logitech/run/pass/intb.mod: New file.
	* pimlib/logitech/run/pass/realconv.mod: New file.
	* pimlib/logitech/run/pass/realinput.mod: New file.
	* pimlib/logitech/run/pass/realinput2.mod: New file.
	* pimlib/logitech/run/pass/realinput3.mod: New file.
	* pimlib/logitech/run/pass/rename.mod: New file.
	* pimlib/logitech/run/pass/timedate.mod: New file.
	* pimlib/logitech/run/pass/writeoct.mod: New file.
	* pimlib/pass/gm2.exp: New file.
	* pimlib/run/pass/format.mod: New file.
	* pimlib/run/pass/gm2.exp: New file.
	* pimlib/run/pass/limittests.c: New file.
	* pimlib/run/pass/limittests.mod: New file.
	* pimlib/run/pass/longreal.mod: New file.
	* pimlib/run/pass/test.c: New file.
	* pimlib/run/pass/testreal.mod: New file.
	* pimlib/run/pass/testreal2.mod: New file.
	* pimlib/run/pass/testreal4.mod: New file.
	* quads/run/pass/becomes.mod: New file.
	* quads/run/pass/gm2.exp: New file.
	* quads/run/pass/param.mod: New file.
	* quads/run/pass/return.mod: New file.
	* recover/begin.mod: New file.
	* recover/end2.mod: New file.
	* recover/of.mod: New file.
	* recover/rsbra.mod: New file.
	* recover/semi.mod: New file.
	* run/Makefile.in: New file.
	* run/fail/Makefile.in: New file.
	* run/fail/list.mod: New file.
	* run/fail/mustrunandfail: New file.
	* run/fail/options: New file.
	* run/fail/testdec.mod: New file.
	* run/fail/testfunc.mod: New file.
	* run/pass/Makefile.in: New file.
	* run/pass/cycles.mod: New file.
	* run/pass/line.mod: New file.
	* run/pass/mustrunandpass: New file.
	* run/pass/nestedproc.mod: New file.
	* run/pass/nestedproc2.mod: New file.
	* run/pass/nestedproc3.mod: New file.
	* run/pass/nestedproc5.mod: New file.
	* run/pass/nestedset.mod: New file.
	* run/pass/nothing.mod: New file.
	* run/pass/options: New file.
	* run/pass/prog31ex.mod: New file.
	* run/pass/rts.mod: New file.
	* run/pass/stripped.mod: New file.
	* run/pass/testavail.mod: New file.
	* run/pass/testfpufunc.mod: New file.
	* run/pass/testfpufunc2.mod: New file.
	* run/pass/testnextproc.mod: New file.
	* run/pass/testparam.mod: New file.
	* run/pass/testpound.mod: New file.
	* run/pass/testsize.mod: New file.
	* run/pass/testsize2.mod: New file.
	* run/pass/testsize3.mod: New file.
	* run/pass/wr.mod: New file.
	* scripts/addit: New file.
	* scripts/comp: New file.
	* scripts/compile: New file.
	* scripts/compileiso: New file.
	* scripts/link: New file.
	* scripts/regression: New file.
	* scripts/subit: New file.
	* sets/run/pass/gm2.exp: New file.
	* sets/run/pass/multisetarith.mod: New file.
	* sets/run/pass/multisetarith2.mod: New file.
	* sets/run/pass/multisetarith3.mod: New file.
	* sets/run/pass/multisetarith4.mod: New file.
	* sets/run/pass/multisetrotate.mod: New file.
	* sets/run/pass/multisetrotate2.mod: New file.
	* sets/run/pass/multisetrotate3.mod: New file.
	* sets/run/pass/multisetrotate4.mod: New file.
	* sets/run/pass/multisetshift.mod: New file.
	* sets/run/pass/multisetshift2.mod: New file.
	* sets/run/pass/multisimple.mod: New file.
	* sets/run/pass/multisimple2.mod: New file.
	* sets/run/pass/multisimple3.mod: New file.
	* sets/run/pass/multisimple4.mod: New file.
	* sets/run/pass/multisimple5.mod: New file.
	* sets/run/pass/multisimple6.mod: New file.
	* sets/run/pass/multisimple7.mod: New file.
	* sets/run/pass/setarith.mod: New file.
	* sets/run/pass/setarith2.mod: New file.
	* sets/run/pass/setarith3.mod: New file.
	* sets/run/pass/setarith4.mod: New file.
	* sets/run/pass/setrotate.mod: New file.
	* sets/run/pass/setrotate2.mod: New file.
	* sets/run/pass/setrotate3.mod: New file.
	* sets/run/pass/setrotate4.mod: New file.
	* sets/run/pass/setshift.mod: New file.
	* sets/run/pass/setshift2.mod: New file.
	* sets/run/pass/simple.mod: New file.
	* sets/run/pass/simple2.mod: New file.
	* sets/run/pass/simple3.mod: New file.
	* sets/run/pass/simple4.mod: New file.
	* sets/run/pass/simple5.mod: New file.
	* sets/run/pass/simple6.mod: New file.
	* sets/run/pass/simple7.mod: New file.
	* switches/auto-init/fail/gm2.exp: New file.
	* switches/auto-init/fail/uninitptr.mod: New file.
	* switches/auto-init/fail/uninitptr2.mod: New file.
	* switches/check-all/pim2/fail/gm2.exp: New file.
	* switches/check-all/pim2/fail/overflow.mod: New file.
	* switches/check-all/pim2/fail/overflow2.mod: New file.
	* switches/check-all/pim2/fail/overflowdiv1.mod: New file.
	* switches/check-all/plugin/iso/fail/divceilposneg.mod: New file.
	* switches/check-all/plugin/iso/fail/divceilposneg2.mod: New file.
	* switches/check-all/plugin/iso/fail/divceilposnegcall.mod: New file.
	* switches/check-all/plugin/iso/fail/divceilposnegcall2.mod: New file.
	* switches/check-all/plugin/iso/fail/divfloornegpos.mod: New file.
	* switches/check-all/plugin/iso/fail/divfloorpospos.mod: New file.
	* switches/check-all/plugin/iso/fail/gm2.exp: New file.
	* switches/check-all/plugin/iso/fail/lowdiv.mod: New file.
	* switches/check-all/plugin/pim2/fail/divceil.mod: New file.
	* switches/check-all/plugin/pim2/fail/gm2.exp: New file.
	* switches/check-all/plugin/pim2/fail/highdiv.mod: New file.
	* switches/check-all/plugin/pim2/fail/modulus.mod: New file.
	* switches/check-all/plugin/pim2/fail/plugin1.mod: New file.
	* switches/check-all/plugin/pim2/fail/plugin3.mod: New file.
	* switches/check-all/plugin/pim2/fail/plugin4.def: New file.
	* switches/check-all/plugin/pim2/fail/plugin4.mod: New file.
	* switches/check-all/plugin/pim2/fail/plugin5.def: New file.
	* switches/check-all/plugin/pim2/fail/plugin5.mod: New file.
	* switches/check-all/plugin/pim2/fail/plugin6.def: New file.
	* switches/check-all/plugin/pim2/fail/plugin6.mod: New file.
	* switches/check-all/plugin/pim2/fail/plugin7.def: New file.
	* switches/check-all/plugin/pim2/fail/plugin7.mod: New file.
	* switches/check-all/plugin/pim2/fail/plugin8.def: New file.
	* switches/check-all/plugin/pim2/fail/plugin8.mod: New file.
	* switches/check-all/plugin/pim2/fail/plugin9.mod: New file.
	* switches/check-all/run/fail/cardrange.mod: New file.
	* switches/check-all/run/fail/cardrange2.mod: New file.
	* switches/check-all/run/fail/cardrange3.mod: New file.
	* switches/check-all/run/fail/gm2.exp: New file.
	* switches/check-all/run/fail/intrange.mod: New file.
	* switches/check-all/run/fail/intrange2.mod: New file.
	* switches/check-all/run/fail/intrange3.mod: New file.
	* switches/check-all/run/fail/intrange4.mod: New file.
	* switches/check-all/run/fail/intrange5.mod: New file.
	* switches/check-all/run/fail/multint1.mod: New file.
	* switches/check-all/run/fail/multint2.mod: New file.
	* switches/check-all/run/fail/multint3.mod: New file.
	* switches/check-all/run/fail/rangesupport.def: New file.
	* switches/check-all/run/fail/rangesupport.mod: New file.
	* switches/check-all/run/fail/realrange.mod: New file.
	* switches/check-all/run/fail/subrange.mod: New file.
	* switches/check-all/run/pass/cardrange.mod: New file.
	* switches/check-all/run/pass/forcheck.mod: New file.
	* switches/check-all/run/pass/gm2.exp: New file.
	* switches/check-all/run/pass/subrange.mod: New file.
	* switches/extended-opaque/fail/a.def: New file.
	* switches/extended-opaque/fail/a.mod: New file.
	* switches/extended-opaque/fail/gm2.exp: New file.
	* switches/extended-opaque/pass/a.def: New file.
	* switches/extended-opaque/pass/a.mod: New file.
	* switches/extended-opaque/pass/b.mod: New file.
	* switches/extended-opaque/pass/gm2.exp: New file.
	* switches/iso/run/pass/gm2.exp: New file.
	* switches/iso/run/pass/modulus.mod: New file.
	* switches/iso/run/pass/modulus4.mod: New file.
	* switches/makeall/fail/gm2.exp: New file.
	* switches/makeall/fail/test.def: New file.
	* switches/makeall/fail/test.mod: New file.
	* switches/makeall/pass/gm2.exp: New file.
	* switches/makeall/pass/test.def: New file.
	* switches/makeall/pass/test.mod: New file.
	* switches/none/run/pass/gm2-none.exp: New file.
	* switches/none/run/pass/hello.mod: New file.
	* switches/optimization/run/pass/fact.mod: New file.
	* switches/optimization/run/pass/gm2.exp: New file.
	* switches/pedantic-params/fail/a.def: New file.
	* switches/pedantic-params/fail/a.mod: New file.
	* switches/pedantic-params/fail/gm2.exp: New file.
	* switches/pedantic-params/pass/Strings.def: New file.
	* switches/pedantic-params/pass/Strings.mod: New file.
	* switches/pedantic-params/pass/Strings2.def: New file.
	* switches/pedantic-params/pass/Strings2.mod: New file.
	* switches/pedantic-params/pass/gm2.exp: New file.
	* switches/pedantic/fail/onlywrite.mod: New file.
	* switches/pedantic/fail/readb4.mod: New file.
	* switches/pic/run/pass/func.c: New file.
	* switches/pic/run/pass/func.mod: New file.
	* switches/pic/run/pass/func2.c: New file.
	* switches/pic/run/pass/func2.mod: New file.
	* switches/pic/run/pass/gm2.exp: New file.
	* switches/pim2/run/pass/gm2.exp: New file.
	* switches/pim2/run/pass/modulus.mod: New file.
	* switches/pim3/run/pass/gm2.exp: New file.
	* switches/pim3/run/pass/modulus.mod: New file.
	* switches/pim4/run/pass/FpuIOBug.mod: New file.
	* switches/pim4/run/pass/InOutBug.mod: New file.
	* switches/pim4/run/pass/NumberIOBug.mod: New file.
	* switches/pim4/run/pass/gm2.exp: New file.
	* switches/pim4/run/pass/modulus.mod: New file.
	* switches/pim4/run/pass/modulus2.mod: New file.
	* switches/whole-program/pass/run/gm2.exp: New file.
	* switches/whole-program/pass/run/tiny.mod: New file.
	* switches/whole-program/pass/run/tiny2.mod: New file.
	* types/Makefile.in: New file.
	* types/bitset.mod: New file.
	* types/bitset2.mod: New file.
	* types/bitset3.mod: New file.
	* types/charset.mod: New file.
	* types/const.mod: New file.
	* types/prog35.mod: New file.
	* types/real.mod: New file.
	* types/run/pass/d.c: New file.
	* types/run/pass/d.def: New file.
	* types/run/pass/gm2.exp: New file.
	* types/run/pass/varient4.mod: New file.
	* types/run/pass/varient5.mod: New file.
	* types/string.mod: New file.
	* types/type1.mod: New file.
	* types/type2.mod: New file.
	* types/type3.mod: New file.
	* types/type4.mod: New file.
	* types/varient.mod: New file.
	* types/word.mod: New file.
	* ulmlib/pass/gm2.exp: New file.
	* ulmlib/std/pass/gm2.exp: New file.
	* ulmlib/sys/pass/gm2.exp: New file.
	* warnings/Makefile.in: New file.
	* warnings/todo/nestedproc6.mod: New file.
	* warnings/todo/options: New file.
	* warnings/todo/testfor.mod: New file.
	* warnings/todo/testfor2.mod: New file.
	* warnings/todo/testfor3.mod: New file.
	* warnings/todo/testkeywords.mod: New file.
	* warnings/todo/testloop.mod: New file.
	* warnings/todo/testscope.mod: New file.
	* warnings/todo/testscope2.mod: New file.
	* x86-asm/asm.mod: New file.
	* x86-asm/asm2.mod: New file.

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-07-07 20:23:23 +01:00
2659 changed files with 570066 additions and 84 deletions

View File

@@ -10,12 +10,12 @@ AutoGen definitions Makefile.tpl;
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with this program; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
@@ -46,7 +46,7 @@ host_modules= { module= fixincludes; bootstrap=true;
missing= install-dvi; };
host_modules= { module= flex; no_check_cross= true; };
host_modules= { module= gas; bootstrap=true; };
host_modules= { module= gcc; bootstrap=true;
host_modules= { module= gcc; bootstrap=true;
extra_make_flags="$(EXTRA_GCC_FLAGS)"; };
host_modules= { module= gmp; lib_path=.libs; bootstrap=true;
// Work around in-tree gmp configure bug with missing flex.
@@ -131,7 +131,7 @@ host_modules= { module= gdb; };
host_modules= { module= expect; };
host_modules= { module= guile; };
host_modules= { module= tk; };
host_modules= { module= libtermcap; no_check=true;
host_modules= { module= libtermcap; no_check=true;
missing=mostlyclean;
missing=clean;
missing=distclean;
@@ -185,6 +185,7 @@ target_modules = { module= libffi; no_install=true; };
target_modules = { module= zlib; bootstrap=true; };
target_modules = { module= rda; };
target_modules = { module= libada; };
target_modules = { module= libgm2; lib_path=.libs; };
target_modules = { module= libgomp; bootstrap= true; lib_path=.libs; };
target_modules = { module= libitm; lib_path=.libs; };
target_modules = { module= libatomic; bootstrap=true; lib_path=.libs; };
@@ -193,29 +194,29 @@ target_modules = { module= libatomic; bootstrap=true; lib_path=.libs; };
// Not all; these are the ones which don't have special options.
// "depend" indicates that a target depends on another target uniformly
// for each subdirectory. There can be several such lines per target.
recursive_targets = { make_target= info;
recursive_targets = { make_target= info;
depend=configure; };
recursive_targets = { make_target= dvi;
recursive_targets = { make_target= dvi;
depend=configure; };
recursive_targets = { make_target= pdf;
recursive_targets = { make_target= pdf;
depend=configure; };
recursive_targets = { make_target= html;
recursive_targets = { make_target= html;
depend=configure; };
recursive_targets = { make_target= TAGS;
recursive_targets = { make_target= TAGS;
depend=configure; };
recursive_targets = { make_target= install-info;
recursive_targets = { make_target= install-info;
depend=configure;
depend=info; };
recursive_targets = { make_target= install-dvi;
depend=configure;
depend=dvi; };
recursive_targets = { make_target= install-pdf;
recursive_targets = { make_target= install-pdf;
depend=configure;
depend=pdf; };
recursive_targets = { make_target= install-html;
recursive_targets = { make_target= install-html;
depend=configure;
depend=html; };
recursive_targets = { make_target= installcheck;
recursive_targets = { make_target= installcheck;
depend=configure; };
recursive_targets = { make_target= mostlyclean; };
recursive_targets = { make_target= clean; };
@@ -307,6 +308,8 @@ flags_to_pass = { flag= GOC_FOR_TARGET ; };
flags_to_pass = { flag= GOCFLAGS_FOR_TARGET ; };
flags_to_pass = { flag= GDC_FOR_TARGET ; };
flags_to_pass = { flag= GDCFLAGS_FOR_TARGET ; };
flags_to_pass = { flag= GM2_FOR_TARGET ; };
flags_to_pass = { flag= GM2FLAGS_FOR_TARGET ; };
flags_to_pass = { flag= LD_FOR_TARGET ; };
flags_to_pass = { flag= LIPO_FOR_TARGET ; };
flags_to_pass = { flag= LDFLAGS_FOR_TARGET ; };
@@ -618,6 +621,8 @@ dependencies = { module=configure-target-libgo; on=all-target-libstdc++-v3; };
dependencies = { module=all-target-libgo; on=all-target-libbacktrace; };
dependencies = { module=all-target-libgo; on=all-target-libffi; };
dependencies = { module=all-target-libgo; on=all-target-libatomic; };
dependencies = { module=configure-target-libgm2; on=all-target-libstdc++-v3; };
dependencies = { module=all-target-libgm2; on=all-target-libatomic; };
dependencies = { module=configure-target-libphobos; on=configure-target-libbacktrace; };
dependencies = { module=configure-target-libphobos; on=configure-target-zlib; };
dependencies = { module=all-target-libphobos; on=all-target-libbacktrace; };
@@ -673,6 +678,8 @@ languages = { language=obj-c++; gcc-check-target=check-obj-c++; };
languages = { language=go; gcc-check-target=check-go;
lib-check-target=check-target-libgo;
lib-check-target=check-gotools; };
languages = { language=m2; gcc-check-target=check-m2;
lib-check-target=check-target-libgm2; };
languages = { language=d; gcc-check-target=check-d;
lib-check-target=check-target-libphobos; };
languages = { language=jit; gcc-check-target=check-jit; };

View File

@@ -10,12 +10,12 @@
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
@@ -163,6 +163,8 @@ BUILD_EXPORTS = \
GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \
GDC="$(GDC_FOR_BUILD)"; export GDC; \
GDCFLAGS="$(GDCFLAGS_FOR_BUILD)"; export GDCFLAGS; \
GM2="$(GM2_FOR_BUILD)"; export GM2; \
GM2FLAGS="$(GM2FLAGS_FOR_BUILD)"; export GM2FLAGS; \
DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
DSYMUTIL="$(DSYMUTIL_FOR_BUILD)"; export DSYMUTIL; \
LD="$(LD_FOR_BUILD)"; export LD; \
@@ -201,6 +203,7 @@ HOST_EXPORTS = \
GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \
GOC="$(GOC)"; export GOC; \
GDC="$(GDC)"; export GDC; \
GM2="$(GM2)"; export GM2; \
AR="$(AR)"; export AR; \
AS="$(AS)"; export AS; \
CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
@@ -304,6 +307,7 @@ BASE_TARGET_EXPORTS = \
GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \
GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \
GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GDC; \
GM2="$(GM2_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GM2; \
DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
DSYMUTIL="$(DSYMUTIL_FOR_TARGET)"; export DSYMUTIL; \
LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
@@ -370,6 +374,7 @@ DSYMUTIL_FOR_BUILD = @DSYMUTIL_FOR_BUILD@
GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
GOC_FOR_BUILD = @GOC_FOR_BUILD@
GDC_FOR_BUILD = @GDC_FOR_BUILD@
GM2_FOR_BUILD = @GM2_FOR_BUILD@
LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
LD_FOR_BUILD = @LD_FOR_BUILD@
NM_FOR_BUILD = @NM_FOR_BUILD@
@@ -440,6 +445,7 @@ CXXFLAGS = @CXXFLAGS@
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
GOCFLAGS = $(CFLAGS)
GDCFLAGS = $(CFLAGS)
GM2FLAGS = $(CFLAGS)
# Pass additional PGO and LTO compiler options to the PGO build.
BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS)
@@ -655,6 +661,7 @@ RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@
GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@
GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@
GDC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GDC_FOR_TARGET@
GM2_FOR_TARGET=$(STAGE_CC_WRAPPER) @GM2_FOR_TARGET@
DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
DSYMUTIL_FOR_TARGET=@DSYMUTIL_FOR_TARGET@
LD_FOR_TARGET=@LD_FOR_TARGET@
@@ -680,6 +687,7 @@ CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@
GM2FLAGS_FOR_TARGET = -O2 -g
GOCFLAGS_FOR_TARGET = -O2 -g
GDCFLAGS_FOR_TARGET = -O2 -g
@@ -706,7 +714,7 @@ all:
# This is the list of directories that may be needed in RPATH_ENVVAR
# so that programs built for the target machine work.
TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libsanitizer)$(TARGET_LIB_PATH_libvtv)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libphobos)$(TARGET_LIB_PATH_libgomp)$(TARGET_LIB_PATH_libitm)$(TARGET_LIB_PATH_libatomic)$(HOST_LIB_PATH_gcc)
TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libsanitizer)$(TARGET_LIB_PATH_libvtv)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libphobos)$(TARGET_LIB_PATH_libgm2)$(TARGET_LIB_PATH_libgomp)$(TARGET_LIB_PATH_libitm)$(TARGET_LIB_PATH_libatomic)$(HOST_LIB_PATH_gcc)
@if target-libstdc++-v3
TARGET_LIB_PATH_libstdc++-v3 = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
@@ -728,6 +736,10 @@ TARGET_LIB_PATH_libssp = $$r/$(TARGET_SUBDIR)/libssp/.libs:
TARGET_LIB_PATH_libphobos = $$r/$(TARGET_SUBDIR)/libphobos/src/.libs:
@endif target-libphobos
@if target-libgm2
TARGET_LIB_PATH_libgm2 = $$r/$(TARGET_SUBDIR)/libgm2/.libs:
@endif target-libgm2
@if target-libgomp
TARGET_LIB_PATH_libgomp = $$r/$(TARGET_SUBDIR)/libgomp/.libs:
@endif target-libgomp
@@ -873,6 +885,8 @@ BASE_FLAGS_TO_PASS = \
"GOCFLAGS_FOR_TARGET=$(GOCFLAGS_FOR_TARGET)" \
"GDC_FOR_TARGET=$(GDC_FOR_TARGET)" \
"GDCFLAGS_FOR_TARGET=$(GDCFLAGS_FOR_TARGET)" \
"GM2_FOR_TARGET=$(GM2_FOR_TARGET)" \
"GM2FLAGS_FOR_TARGET=$(GM2FLAGS_FOR_TARGET)" \
"LD_FOR_TARGET=$(LD_FOR_TARGET)" \
"LIPO_FOR_TARGET=$(LIPO_FOR_TARGET)" \
"LDFLAGS_FOR_TARGET=$(LDFLAGS_FOR_TARGET)" \
@@ -946,6 +960,7 @@ EXTRA_HOST_FLAGS = \
'GFORTRAN=$(GFORTRAN)' \
'GOC=$(GOC)' \
'GDC=$(GDC)' \
'GM2=$(GM2)' \
'LD=$(LD)' \
'LIPO=$(LIPO)' \
'NM=$(NM)' \
@@ -972,6 +987,7 @@ POSTSTAGE1_FLAGS_TO_PASS = \
CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \
GDC="$${GDC}" GDC_FOR_BUILD="$${GDC_FOR_BUILD}" \
GM2="$${GM2}" GM2_FOR_BUILD="$${GM2_FOR_BUILD}" \
GNATBIND="$${GNATBIND}" \
LDFLAGS="$${LDFLAGS}" \
HOST_LIBS="$${HOST_LIBS}" \
@@ -1007,6 +1023,8 @@ EXTRA_TARGET_FLAGS = \
'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \
'GDC=$$(GDC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'GDCFLAGS=$$(GDCFLAGS_FOR_TARGET)' \
'GM2=$$(GM2_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'GM2FLAGS=$$(GM2FLAGS_FOR_TARGET)' \
'LD=$(COMPILER_LD_FOR_TARGET)' \
'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
@@ -1033,6 +1051,7 @@ TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
# cross-building scheme.
EXTRA_GCC_FLAGS = \
"GCC_FOR_TARGET=$(GCC_FOR_TARGET) $$TFLAGS" \
"GM2_FOR_TARGET=$(GM2_FOR_TARGET) $$TFLAGS" \
"`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
"`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
@@ -1120,6 +1139,7 @@ configure-target: \
maybe-configure-target-zlib \
maybe-configure-target-rda \
maybe-configure-target-libada \
maybe-configure-target-libgm2 \
maybe-configure-target-libgomp \
maybe-configure-target-libitm \
maybe-configure-target-libatomic
@@ -1313,6 +1333,7 @@ all-target: maybe-all-target-zlib
@endif target-zlib-no-bootstrap
all-target: maybe-all-target-rda
all-target: maybe-all-target-libada
all-target: maybe-all-target-libgm2
@if target-libgomp-no-bootstrap
all-target: maybe-all-target-libgomp
@endif target-libgomp-no-bootstrap
@@ -1411,6 +1432,7 @@ info-target: maybe-info-target-libffi
info-target: maybe-info-target-zlib
info-target: maybe-info-target-rda
info-target: maybe-info-target-libada
info-target: maybe-info-target-libgm2
info-target: maybe-info-target-libgomp
info-target: maybe-info-target-libitm
info-target: maybe-info-target-libatomic
@@ -1500,6 +1522,7 @@ dvi-target: maybe-dvi-target-libffi
dvi-target: maybe-dvi-target-zlib
dvi-target: maybe-dvi-target-rda
dvi-target: maybe-dvi-target-libada
dvi-target: maybe-dvi-target-libgm2
dvi-target: maybe-dvi-target-libgomp
dvi-target: maybe-dvi-target-libitm
dvi-target: maybe-dvi-target-libatomic
@@ -1589,6 +1612,7 @@ pdf-target: maybe-pdf-target-libffi
pdf-target: maybe-pdf-target-zlib
pdf-target: maybe-pdf-target-rda
pdf-target: maybe-pdf-target-libada
pdf-target: maybe-pdf-target-libgm2
pdf-target: maybe-pdf-target-libgomp
pdf-target: maybe-pdf-target-libitm
pdf-target: maybe-pdf-target-libatomic
@@ -1678,6 +1702,7 @@ html-target: maybe-html-target-libffi
html-target: maybe-html-target-zlib
html-target: maybe-html-target-rda
html-target: maybe-html-target-libada
html-target: maybe-html-target-libgm2
html-target: maybe-html-target-libgomp
html-target: maybe-html-target-libitm
html-target: maybe-html-target-libatomic
@@ -1767,6 +1792,7 @@ TAGS-target: maybe-TAGS-target-libffi
TAGS-target: maybe-TAGS-target-zlib
TAGS-target: maybe-TAGS-target-rda
TAGS-target: maybe-TAGS-target-libada
TAGS-target: maybe-TAGS-target-libgm2
TAGS-target: maybe-TAGS-target-libgomp
TAGS-target: maybe-TAGS-target-libitm
TAGS-target: maybe-TAGS-target-libatomic
@@ -1856,6 +1882,7 @@ install-info-target: maybe-install-info-target-libffi
install-info-target: maybe-install-info-target-zlib
install-info-target: maybe-install-info-target-rda
install-info-target: maybe-install-info-target-libada
install-info-target: maybe-install-info-target-libgm2
install-info-target: maybe-install-info-target-libgomp
install-info-target: maybe-install-info-target-libitm
install-info-target: maybe-install-info-target-libatomic
@@ -1945,6 +1972,7 @@ install-dvi-target: maybe-install-dvi-target-libffi
install-dvi-target: maybe-install-dvi-target-zlib
install-dvi-target: maybe-install-dvi-target-rda
install-dvi-target: maybe-install-dvi-target-libada
install-dvi-target: maybe-install-dvi-target-libgm2
install-dvi-target: maybe-install-dvi-target-libgomp
install-dvi-target: maybe-install-dvi-target-libitm
install-dvi-target: maybe-install-dvi-target-libatomic
@@ -2034,6 +2062,7 @@ install-pdf-target: maybe-install-pdf-target-libffi
install-pdf-target: maybe-install-pdf-target-zlib
install-pdf-target: maybe-install-pdf-target-rda
install-pdf-target: maybe-install-pdf-target-libada
install-pdf-target: maybe-install-pdf-target-libgm2
install-pdf-target: maybe-install-pdf-target-libgomp
install-pdf-target: maybe-install-pdf-target-libitm
install-pdf-target: maybe-install-pdf-target-libatomic
@@ -2123,6 +2152,7 @@ install-html-target: maybe-install-html-target-libffi
install-html-target: maybe-install-html-target-zlib
install-html-target: maybe-install-html-target-rda
install-html-target: maybe-install-html-target-libada
install-html-target: maybe-install-html-target-libgm2
install-html-target: maybe-install-html-target-libgomp
install-html-target: maybe-install-html-target-libitm
install-html-target: maybe-install-html-target-libatomic
@@ -2212,6 +2242,7 @@ installcheck-target: maybe-installcheck-target-libffi
installcheck-target: maybe-installcheck-target-zlib
installcheck-target: maybe-installcheck-target-rda
installcheck-target: maybe-installcheck-target-libada
installcheck-target: maybe-installcheck-target-libgm2
installcheck-target: maybe-installcheck-target-libgomp
installcheck-target: maybe-installcheck-target-libitm
installcheck-target: maybe-installcheck-target-libatomic
@@ -2301,6 +2332,7 @@ mostlyclean-target: maybe-mostlyclean-target-libffi
mostlyclean-target: maybe-mostlyclean-target-zlib
mostlyclean-target: maybe-mostlyclean-target-rda
mostlyclean-target: maybe-mostlyclean-target-libada
mostlyclean-target: maybe-mostlyclean-target-libgm2
mostlyclean-target: maybe-mostlyclean-target-libgomp
mostlyclean-target: maybe-mostlyclean-target-libitm
mostlyclean-target: maybe-mostlyclean-target-libatomic
@@ -2390,6 +2422,7 @@ clean-target: maybe-clean-target-libffi
clean-target: maybe-clean-target-zlib
clean-target: maybe-clean-target-rda
clean-target: maybe-clean-target-libada
clean-target: maybe-clean-target-libgm2
clean-target: maybe-clean-target-libgomp
clean-target: maybe-clean-target-libitm
clean-target: maybe-clean-target-libatomic
@@ -2479,6 +2512,7 @@ distclean-target: maybe-distclean-target-libffi
distclean-target: maybe-distclean-target-zlib
distclean-target: maybe-distclean-target-rda
distclean-target: maybe-distclean-target-libada
distclean-target: maybe-distclean-target-libgm2
distclean-target: maybe-distclean-target-libgomp
distclean-target: maybe-distclean-target-libitm
distclean-target: maybe-distclean-target-libatomic
@@ -2568,6 +2602,7 @@ maintainer-clean-target: maybe-maintainer-clean-target-libffi
maintainer-clean-target: maybe-maintainer-clean-target-zlib
maintainer-clean-target: maybe-maintainer-clean-target-rda
maintainer-clean-target: maybe-maintainer-clean-target-libada
maintainer-clean-target: maybe-maintainer-clean-target-libgm2
maintainer-clean-target: maybe-maintainer-clean-target-libgomp
maintainer-clean-target: maybe-maintainer-clean-target-libitm
maintainer-clean-target: maybe-maintainer-clean-target-libatomic
@@ -2629,7 +2664,7 @@ local-maintainer-clean:
clean: do-clean local-clean
mostlyclean: do-mostlyclean local-clean
distclean: do-distclean local-clean local-distclean
maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
maintainer-clean: local-distclean
realclean: maintainer-clean
@@ -2715,6 +2750,7 @@ check-target: \
maybe-check-target-zlib \
maybe-check-target-rda \
maybe-check-target-libada \
maybe-check-target-libgm2 \
maybe-check-target-libgomp \
maybe-check-target-libitm \
maybe-check-target-libatomic
@@ -2906,6 +2942,7 @@ install-target: \
maybe-install-target-zlib \
maybe-install-target-rda \
maybe-install-target-libada \
maybe-install-target-libgm2 \
maybe-install-target-libgomp \
maybe-install-target-libitm \
maybe-install-target-libatomic
@@ -3015,6 +3052,7 @@ install-strip-target: \
maybe-install-strip-target-zlib \
maybe-install-strip-target-rda \
maybe-install-strip-target-libada \
maybe-install-strip-target-libgm2 \
maybe-install-strip-target-libgomp \
maybe-install-strip-target-libitm \
maybe-install-strip-target-libatomic
@@ -3038,7 +3076,7 @@ dir.info: do-install-info
dist:
@echo "Building a full distribution of this tree isn't done"
@echo "via 'make dist'. Check out the etc/ subdirectory"
@echo "via 'make dist'. Check out the etc/ subdirectory"
etags tags: TAGS
@@ -58104,6 +58142,491 @@ maintainer-clean-target-libada:
.PHONY: configure-target-libgm2 maybe-configure-target-libgm2
maybe-configure-target-libgm2:
@if gcc-bootstrap
configure-target-libgm2: stage_current
@endif gcc-bootstrap
@if target-libgm2
maybe-configure-target-libgm2: configure-target-libgm2
configure-target-libgm2:
@: $(MAKE); $(unstage)
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
echo "Checking multilib configuration for libgm2..."; \
$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgm2; \
$(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgm2/multilib.tmp 2> /dev/null; \
if test -r $(TARGET_SUBDIR)/libgm2/multilib.out; then \
if cmp -s $(TARGET_SUBDIR)/libgm2/multilib.tmp $(TARGET_SUBDIR)/libgm2/multilib.out; then \
rm -f $(TARGET_SUBDIR)/libgm2/multilib.tmp; \
else \
rm -f $(TARGET_SUBDIR)/libgm2/Makefile; \
mv $(TARGET_SUBDIR)/libgm2/multilib.tmp $(TARGET_SUBDIR)/libgm2/multilib.out; \
fi; \
else \
mv $(TARGET_SUBDIR)/libgm2/multilib.tmp $(TARGET_SUBDIR)/libgm2/multilib.out; \
fi; \
test ! -f $(TARGET_SUBDIR)/libgm2/Makefile || exit 0; \
$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgm2; \
$(NORMAL_TARGET_EXPORTS) \
echo Configuring in $(TARGET_SUBDIR)/libgm2; \
cd "$(TARGET_SUBDIR)/libgm2" || exit 1; \
case $(srcdir) in \
/* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
*) topdir=`echo $(TARGET_SUBDIR)/libgm2/ | \
sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
esac; \
module_srcdir=libgm2; \
rm -f no-such-file || : ; \
CONFIG_SITE=no-such-file $(SHELL) \
$$s/$$module_srcdir/configure \
--srcdir=$${topdir}/$$module_srcdir \
$(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
--target=${target_alias} \
|| exit 1
@endif target-libgm2
.PHONY: all-target-libgm2 maybe-all-target-libgm2
maybe-all-target-libgm2:
@if gcc-bootstrap
all-target-libgm2: stage_current
@endif gcc-bootstrap
@if target-libgm2
TARGET-target-libgm2=all
maybe-all-target-libgm2: all-target-libgm2
all-target-libgm2: configure-target-libgm2
@: $(MAKE); $(unstage)
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \
$(TARGET-target-libgm2))
@endif target-libgm2
.PHONY: check-target-libgm2 maybe-check-target-libgm2
maybe-check-target-libgm2:
@if target-libgm2
maybe-check-target-libgm2: check-target-libgm2
check-target-libgm2:
@: $(MAKE); $(unstage)
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(TARGET_FLAGS_TO_PASS) check)
@endif target-libgm2
.PHONY: install-target-libgm2 maybe-install-target-libgm2
maybe-install-target-libgm2:
@if target-libgm2
maybe-install-target-libgm2: install-target-libgm2
install-target-libgm2: installdirs
@: $(MAKE); $(unstage)
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(TARGET_FLAGS_TO_PASS) install)
@endif target-libgm2
.PHONY: install-strip-target-libgm2 maybe-install-strip-target-libgm2
maybe-install-strip-target-libgm2:
@if target-libgm2
maybe-install-strip-target-libgm2: install-strip-target-libgm2
install-strip-target-libgm2: installdirs
@: $(MAKE); $(unstage)
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(TARGET_FLAGS_TO_PASS) install-strip)
@endif target-libgm2
# Other targets (info, dvi, pdf, etc.)
.PHONY: maybe-info-target-libgm2 info-target-libgm2
maybe-info-target-libgm2:
@if target-libgm2
maybe-info-target-libgm2: info-target-libgm2
info-target-libgm2: \
configure-target-libgm2
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing info in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
info) \
|| exit 1
@endif target-libgm2
.PHONY: maybe-dvi-target-libgm2 dvi-target-libgm2
maybe-dvi-target-libgm2:
@if target-libgm2
maybe-dvi-target-libgm2: dvi-target-libgm2
dvi-target-libgm2: \
configure-target-libgm2
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing dvi in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
dvi) \
|| exit 1
@endif target-libgm2
.PHONY: maybe-pdf-target-libgm2 pdf-target-libgm2
maybe-pdf-target-libgm2:
@if target-libgm2
maybe-pdf-target-libgm2: pdf-target-libgm2
pdf-target-libgm2: \
configure-target-libgm2
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing pdf in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
pdf) \
|| exit 1
@endif target-libgm2
.PHONY: maybe-html-target-libgm2 html-target-libgm2
maybe-html-target-libgm2:
@if target-libgm2
maybe-html-target-libgm2: html-target-libgm2
html-target-libgm2: \
configure-target-libgm2
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing html in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
html) \
|| exit 1
@endif target-libgm2
.PHONY: maybe-TAGS-target-libgm2 TAGS-target-libgm2
maybe-TAGS-target-libgm2:
@if target-libgm2
maybe-TAGS-target-libgm2: TAGS-target-libgm2
TAGS-target-libgm2: \
configure-target-libgm2
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing TAGS in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
TAGS) \
|| exit 1
@endif target-libgm2
.PHONY: maybe-install-info-target-libgm2 install-info-target-libgm2
maybe-install-info-target-libgm2:
@if target-libgm2
maybe-install-info-target-libgm2: install-info-target-libgm2
install-info-target-libgm2: \
configure-target-libgm2 \
info-target-libgm2
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing install-info in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
install-info) \
|| exit 1
@endif target-libgm2
.PHONY: maybe-install-dvi-target-libgm2 install-dvi-target-libgm2
maybe-install-dvi-target-libgm2:
@if target-libgm2
maybe-install-dvi-target-libgm2: install-dvi-target-libgm2
install-dvi-target-libgm2: \
configure-target-libgm2 \
dvi-target-libgm2
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing install-dvi in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
install-dvi) \
|| exit 1
@endif target-libgm2
.PHONY: maybe-install-pdf-target-libgm2 install-pdf-target-libgm2
maybe-install-pdf-target-libgm2:
@if target-libgm2
maybe-install-pdf-target-libgm2: install-pdf-target-libgm2
install-pdf-target-libgm2: \
configure-target-libgm2 \
pdf-target-libgm2
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing install-pdf in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
install-pdf) \
|| exit 1
@endif target-libgm2
.PHONY: maybe-install-html-target-libgm2 install-html-target-libgm2
maybe-install-html-target-libgm2:
@if target-libgm2
maybe-install-html-target-libgm2: install-html-target-libgm2
install-html-target-libgm2: \
configure-target-libgm2 \
html-target-libgm2
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing install-html in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
install-html) \
|| exit 1
@endif target-libgm2
.PHONY: maybe-installcheck-target-libgm2 installcheck-target-libgm2
maybe-installcheck-target-libgm2:
@if target-libgm2
maybe-installcheck-target-libgm2: installcheck-target-libgm2
installcheck-target-libgm2: \
configure-target-libgm2
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing installcheck in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
installcheck) \
|| exit 1
@endif target-libgm2
.PHONY: maybe-mostlyclean-target-libgm2 mostlyclean-target-libgm2
maybe-mostlyclean-target-libgm2:
@if target-libgm2
maybe-mostlyclean-target-libgm2: mostlyclean-target-libgm2
mostlyclean-target-libgm2:
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
mostlyclean) \
|| exit 1
@endif target-libgm2
.PHONY: maybe-clean-target-libgm2 clean-target-libgm2
maybe-clean-target-libgm2:
@if target-libgm2
maybe-clean-target-libgm2: clean-target-libgm2
clean-target-libgm2:
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing clean in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
clean) \
|| exit 1
@endif target-libgm2
.PHONY: maybe-distclean-target-libgm2 distclean-target-libgm2
maybe-distclean-target-libgm2:
@if target-libgm2
maybe-distclean-target-libgm2: distclean-target-libgm2
distclean-target-libgm2:
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing distclean in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
distclean) \
|| exit 1
@endif target-libgm2
.PHONY: maybe-maintainer-clean-target-libgm2 maintainer-clean-target-libgm2
maybe-maintainer-clean-target-libgm2:
@if target-libgm2
maybe-maintainer-clean-target-libgm2: maintainer-clean-target-libgm2
maintainer-clean-target-libgm2:
@: $(MAKE); $(unstage)
@[ -f $(TARGET_SUBDIR)/libgm2/Makefile ] || exit 0; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(NORMAL_TARGET_EXPORTS) \
echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgm2"; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
(cd $(TARGET_SUBDIR)/libgm2 && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"RANLIB=$${RANLIB}" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
maintainer-clean) \
|| exit 1
@endif target-libgm2
.PHONY: configure-target-libgomp maybe-configure-target-libgomp
maybe-configure-target-libgomp:
@if gcc-bootstrap
@@ -61221,6 +61744,14 @@ check-gcc-go:
(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-go);
check-go: check-gcc-go check-target-libgo check-gotools
.PHONY: check-gcc-m2 check-m2
check-gcc-m2:
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(HOST_EXPORTS) \
(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-m2);
check-m2: check-gcc-m2 check-target-libgm2
.PHONY: check-gcc-d check-d
check-gcc-d:
r=`${PWD_COMMAND}`; export r; \
@@ -61304,7 +61835,7 @@ LEAN = false
# reliable.
# 'touch' doesn't work right on some platforms.
STAMP = echo timestamp >
STAMP = echo timestamp >
# We only want to compare .o files, so set this!
objext = .o
@@ -64679,6 +65210,7 @@ configure-stageautoprofile-target-zlib: maybe-all-stageautoprofile-gcc
configure-stageautofeedback-target-zlib: maybe-all-stageautofeedback-gcc
configure-target-rda: stage_last
configure-target-libada: stage_last
configure-target-libgm2: stage_last
configure-stage1-target-libgomp: maybe-all-stage1-gcc
configure-stage2-target-libgomp: maybe-all-stage2-gcc
configure-stage3-target-libgomp: maybe-all-stage3-gcc
@@ -64720,6 +65252,7 @@ configure-target-libffi: maybe-all-gcc
configure-target-zlib: maybe-all-gcc
configure-target-rda: maybe-all-gcc
configure-target-libada: maybe-all-gcc
configure-target-libgm2: maybe-all-gcc
configure-target-libgomp: maybe-all-gcc
configure-target-libitm: maybe-all-gcc
configure-target-libatomic: maybe-all-gcc
@@ -66006,6 +66539,8 @@ all-target-fastjar: maybe-all-target-zlib
configure-target-libgo: maybe-all-target-libstdc++-v3
all-target-libgo: maybe-all-target-libbacktrace
all-target-libgo: maybe-all-target-libatomic
configure-target-libgm2: maybe-all-target-libstdc++-v3
all-target-libgm2: maybe-all-target-libatomic
configure-target-newlib: maybe-all-binutils
configure-target-newlib: maybe-all-ld
configure-target-libgfortran: maybe-all-target-libbacktrace
@@ -66111,6 +66646,7 @@ configure-target-libffi: maybe-all-target-libgcc
configure-target-zlib: maybe-all-target-libgcc
configure-target-rda: maybe-all-target-libgcc
configure-target-libada: maybe-all-target-libgcc
configure-target-libgm2: maybe-all-target-libgcc
configure-target-libgomp: maybe-all-target-libgcc
configure-target-libitm: maybe-all-target-libgcc
configure-target-libatomic: maybe-all-target-libgcc
@@ -66153,6 +66689,8 @@ configure-target-rda: maybe-all-target-newlib maybe-all-target-libgloss
configure-target-libada: maybe-all-target-newlib maybe-all-target-libgloss
configure-target-libgm2: maybe-all-target-newlib maybe-all-target-libgloss
configure-target-libgomp: maybe-all-target-newlib maybe-all-target-libgloss
configure-target-libitm: maybe-all-target-newlib maybe-all-target-libgloss
@@ -66169,7 +66707,7 @@ all-gdb: $(gdbnlmrequirements) $(GDB_TK)
install-gdb: $(INSTALL_GDB_TK)
# Serialization dependencies. Host configures don't work well in parallel to
# each other, due to contention over config.cache. Target configures and
# each other, due to contention over config.cache. Target configures and
# build configures are similar.
@serialization_dependencies@

View File

@@ -13,12 +13,12 @@ in
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
@@ -166,6 +166,8 @@ BUILD_EXPORTS = \
GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \
GDC="$(GDC_FOR_BUILD)"; export GDC; \
GDCFLAGS="$(GDCFLAGS_FOR_BUILD)"; export GDCFLAGS; \
GM2="$(GM2_FOR_BUILD)"; export GM2; \
GM2FLAGS="$(GM2FLAGS_FOR_BUILD)"; export GM2FLAGS; \
DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
DSYMUTIL="$(DSYMUTIL_FOR_BUILD)"; export DSYMUTIL; \
LD="$(LD_FOR_BUILD)"; export LD; \
@@ -204,6 +206,7 @@ HOST_EXPORTS = \
GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \
GOC="$(GOC)"; export GOC; \
GDC="$(GDC)"; export GDC; \
GM2="$(GM2)"; export GM2; \
AR="$(AR)"; export AR; \
AS="$(AS)"; export AS; \
CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
@@ -307,6 +310,7 @@ BASE_TARGET_EXPORTS = \
GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \
GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \
GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GDC; \
GM2="$(GM2_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GM2; \
DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
DSYMUTIL="$(DSYMUTIL_FOR_TARGET)"; export DSYMUTIL; \
LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
@@ -373,6 +377,7 @@ DSYMUTIL_FOR_BUILD = @DSYMUTIL_FOR_BUILD@
GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
GOC_FOR_BUILD = @GOC_FOR_BUILD@
GDC_FOR_BUILD = @GDC_FOR_BUILD@
GM2_FOR_BUILD = @GM2_FOR_BUILD@
LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
LD_FOR_BUILD = @LD_FOR_BUILD@
NM_FOR_BUILD = @NM_FOR_BUILD@
@@ -443,6 +448,7 @@ CXXFLAGS = @CXXFLAGS@
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
GOCFLAGS = $(CFLAGS)
GDCFLAGS = $(CFLAGS)
GM2FLAGS = $(CFLAGS)
# Pass additional PGO and LTO compiler options to the PGO build.
BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS)
@@ -578,6 +584,7 @@ RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@
GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@
GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@
GDC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GDC_FOR_TARGET@
GM2_FOR_TARGET=$(STAGE_CC_WRAPPER) @GM2_FOR_TARGET@
DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
DSYMUTIL_FOR_TARGET=@DSYMUTIL_FOR_TARGET@
LD_FOR_TARGET=@LD_FOR_TARGET@
@@ -603,6 +610,7 @@ CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@
GM2FLAGS_FOR_TARGET = -O2 -g
GOCFLAGS_FOR_TARGET = -O2 -g
GDCFLAGS_FOR_TARGET = -O2 -g
@@ -709,6 +717,7 @@ EXTRA_HOST_FLAGS = \
'GFORTRAN=$(GFORTRAN)' \
'GOC=$(GOC)' \
'GDC=$(GDC)' \
'GM2=$(GM2)' \
'LD=$(LD)' \
'LIPO=$(LIPO)' \
'NM=$(NM)' \
@@ -735,6 +744,7 @@ POSTSTAGE1_FLAGS_TO_PASS = \
CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \
GDC="$${GDC}" GDC_FOR_BUILD="$${GDC_FOR_BUILD}" \
GM2="$${GM2}" GM2_FOR_BUILD="$${GM2_FOR_BUILD}" \
GNATBIND="$${GNATBIND}" \
LDFLAGS="$${LDFLAGS}" \
HOST_LIBS="$${HOST_LIBS}" \
@@ -770,6 +780,8 @@ EXTRA_TARGET_FLAGS = \
'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \
'GDC=$$(GDC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'GDCFLAGS=$$(GDCFLAGS_FOR_TARGET)' \
'GM2=$$(GM2_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'GM2FLAGS=$$(GM2FLAGS_FOR_TARGET)' \
'LD=$(COMPILER_LD_FOR_TARGET)' \
'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
@@ -796,6 +808,7 @@ TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
# cross-building scheme.
EXTRA_GCC_FLAGS = \
"GCC_FOR_TARGET=$(GCC_FOR_TARGET) $$TFLAGS" \
"GM2_FOR_TARGET=$(GM2_FOR_TARGET) $$TFLAGS" \
"`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
"`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
@@ -956,7 +969,7 @@ local-maintainer-clean:
clean: do-clean local-clean
mostlyclean: do-mostlyclean local-clean
distclean: do-distclean local-clean local-distclean
maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
maintainer-clean: local-distclean
realclean: maintainer-clean
@@ -1113,7 +1126,7 @@ dir.info: do-install-info
dist:
@echo "Building a full distribution of this tree isn't done"
@echo "via 'make dist'. Check out the etc/ subdirectory"
@echo "via 'make dist'. Check out the etc/ subdirectory"
etags tags: TAGS
@@ -1486,9 +1499,9 @@ ELSE normal_cxx +]
ENDIF raw_cxx +]
(cd $(TARGET_SUBDIR)/[+module+] && \
$(MAKE) $(TARGET_FLAGS_TO_PASS) [+
IF raw_cxx
+] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
ENDIF raw_cxx
IF raw_cxx
+] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
ENDIF raw_cxx
+] [+extra_make_flags+] check)
[+ ENDIF no_check +]
@endif target-[+module+]
@@ -1681,7 +1694,7 @@ LEAN = false
# reliable.
# 'touch' doesn't work right on some platforms.
STAMP = echo timestamp >
STAMP = echo timestamp >
# We only want to compare .o files, so set this!
objext = .o
@@ -2063,7 +2076,7 @@ all-gdb: $(gdbnlmrequirements) $(GDB_TK)
install-gdb: $(INSTALL_GDB_TK)
# Serialization dependencies. Host configures don't work well in parallel to
# each other, due to contention over config.cache. Target configures and
# each other, due to contention over config.cache. Target configures and
# build configures are similar.
@serialization_dependencies@

229
configure vendored
View File

@@ -613,6 +613,7 @@ DSYMUTIL_FOR_TARGET
DLLTOOL_FOR_TARGET
AS_FOR_TARGET
AR_FOR_TARGET
GM2_FOR_TARGET
GDC_FOR_TARGET
GOC_FOR_TARGET
GFORTRAN_FOR_TARGET
@@ -803,6 +804,7 @@ enable_compressed_debug_sections
enable_libquadmath
enable_libquadmath_support
enable_libada
enable_libgm2
enable_libssp
enable_libstdcxx
enable_bootstrap
@@ -880,6 +882,7 @@ GCC_FOR_TARGET
GFORTRAN_FOR_TARGET
GOC_FOR_TARGET
GDC_FOR_TARGET
GM2_FOR_TARGET
AR_FOR_TARGET
AS_FOR_TARGET
DLLTOOL_FOR_TARGET
@@ -1540,6 +1543,7 @@ Optional Features:
--disable-libquadmath-support
disable libquadmath support for Fortran
--enable-libada build libada directory
--enable-libgm2 build libgm2 directory
--enable-libssp build libssp directory
--disable-libstdcxx do not build libstdc++-v3 directory
--enable-bootstrap enable bootstrapping [yes if native build]
@@ -1674,6 +1678,8 @@ Some influential environment variables:
GOC for the target
GDC_FOR_TARGET
GDC for the target
GM2_FOR_TARGET
GM2 for the target
AR_FOR_TARGET
AR for the target
AS_FOR_TARGET
@@ -2812,7 +2818,7 @@ host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktr
# binutils, gas and ld appear in that order because it makes sense to run
# "make check" in that particular order.
# If --enable-gold is used, "gold" may replace "ld".
host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gdbserver gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools c++tools"
host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gdbserver gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gm2tools gotools c++tools"
# these libraries are built for the target environment, and are built after
# the host libraries and the host tools (which may be a cross compiler)
@@ -2833,6 +2839,7 @@ target_libraries="target-libgcc \
target-libffi \
target-libobjc \
target-libada \
target-libgm2 \
target-libgo \
target-libphobos \
target-zlib"
@@ -3176,6 +3183,17 @@ if test "${ENABLE_LIBADA}" != "yes" ; then
noconfigdirs="$noconfigdirs gnattools"
fi
# Check whether --enable-libgm2 was given.
if test "${enable_libgm2+set}" = set; then :
enableval=$enable_libgm2; ENABLE_LIBGM2=$enableval
else
ENABLE_LIBGM2=no
fi
if test "${ENABLE_LIBGM2}" != "yes" ; then
noconfigdirs="$noconfigdirs gm2tools"
fi
# Check whether --enable-libssp was given.
if test "${enable_libssp+set}" = set; then :
enableval=$enable_libssp; ENABLE_LIBSSP=$enableval
@@ -13786,6 +13804,167 @@ fi
if test -n "$GM2_FOR_TARGET"; then
ac_cv_prog_GM2_FOR_TARGET=$GM2_FOR_TARGET
elif test -n "$ac_cv_prog_GM2_FOR_TARGET"; then
GM2_FOR_TARGET=$ac_cv_prog_GM2_FOR_TARGET
fi
if test -n "$ac_cv_prog_GM2_FOR_TARGET"; then
for ncn_progname in gm2; do
# Extract the first word of "${ncn_progname}", so it can be a program name with args.
set dummy ${ncn_progname}; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_GM2_FOR_TARGET+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$GM2_FOR_TARGET"; then
ac_cv_prog_GM2_FOR_TARGET="$GM2_FOR_TARGET" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_GM2_FOR_TARGET="${ncn_progname}"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
GM2_FOR_TARGET=$ac_cv_prog_GM2_FOR_TARGET
if test -n "$GM2_FOR_TARGET"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GM2_FOR_TARGET" >&5
$as_echo "$GM2_FOR_TARGET" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
done
fi
if test -z "$ac_cv_prog_GM2_FOR_TARGET" && test -n "$with_build_time_tools"; then
for ncn_progname in gm2; do
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ncn_progname} in $with_build_time_tools" >&5
$as_echo_n "checking for ${ncn_progname} in $with_build_time_tools... " >&6; }
if test -x $with_build_time_tools/${ncn_progname}; then
ac_cv_prog_GM2_FOR_TARGET=$with_build_time_tools/${ncn_progname}
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
break
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
done
fi
if test -z "$ac_cv_prog_GM2_FOR_TARGET"; then
for ncn_progname in gm2; do
if test -n "$ncn_target_tool_prefix"; then
# Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_GM2_FOR_TARGET+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$GM2_FOR_TARGET"; then
ac_cv_prog_GM2_FOR_TARGET="$GM2_FOR_TARGET" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_GM2_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
GM2_FOR_TARGET=$ac_cv_prog_GM2_FOR_TARGET
if test -n "$GM2_FOR_TARGET"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GM2_FOR_TARGET" >&5
$as_echo "$GM2_FOR_TARGET" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_GM2_FOR_TARGET" && test $build = $target ; then
# Extract the first word of "${ncn_progname}", so it can be a program name with args.
set dummy ${ncn_progname}; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_GM2_FOR_TARGET+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$GM2_FOR_TARGET"; then
ac_cv_prog_GM2_FOR_TARGET="$GM2_FOR_TARGET" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_GM2_FOR_TARGET="${ncn_progname}"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
GM2_FOR_TARGET=$ac_cv_prog_GM2_FOR_TARGET
if test -n "$GM2_FOR_TARGET"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GM2_FOR_TARGET" >&5
$as_echo "$GM2_FOR_TARGET" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
test -n "$ac_cv_prog_GM2_FOR_TARGET" && break
done
fi
if test -z "$ac_cv_prog_GM2_FOR_TARGET" ; then
set dummy gm2
if test $build = $target ; then
GM2_FOR_TARGET="$2"
else
GM2_FOR_TARGET="${ncn_target_tool_prefix}$2"
fi
else
GM2_FOR_TARGET="$ac_cv_prog_GM2_FOR_TARGET"
fi
cat > conftest.c << \EOF
#ifdef __GNUC__
gcc_yay;
@@ -17718,6 +17897,51 @@ $as_echo "pre-installed" >&6; }
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target gm2" >&5
$as_echo_n "checking where to find the target gm2... " >&6; }
if test "x${build}" != "x${host}" ; then
if expr "x$GM2_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $GM2_FOR_TARGET`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5
$as_echo "pre-installed in $ac_dir" >&6; }
else
# Canadian cross, just use what we found
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed" >&5
$as_echo "pre-installed" >&6; }
fi
else
ok=yes
case " ${configdirs} " in
*" gcc "*) ;;
*) ok=no ;;
esac
case ,${enable_languages}, in
*,m2,*) ;;
*) ok=no ;;
esac
if test $ok = yes; then
# An in-tree tool is available and we can use it
GM2_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gm2 -B$$r/$(HOST_SUBDIR)/gcc/'
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: just compiled" >&5
$as_echo "just compiled" >&6; }
elif expr "x$GM2_FOR_TARGET" : "x/" > /dev/null; then
# We already found the complete path
ac_dir=`dirname $GM2_FOR_TARGET`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5
$as_echo "pre-installed in $ac_dir" >&6; }
elif test "x$target" = "x$host"; then
# We can use an host tool
GM2_FOR_TARGET='$(GM2)'
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: host tool" >&5
$as_echo "host tool" >&6; }
else
# We need a cross tool
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed" >&5
$as_echo "pre-installed" >&6; }
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target ld" >&5
$as_echo_n "checking where to find the target ld... " >&6; }
if test "x${build}" != "x${host}" ; then
@@ -18279,6 +18503,9 @@ fi
# Specify what files to not compare during bootstrap.
compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
compare_exclusions="$compare_exclusions | gcc/m2/gm2-compiler-boot/M2Version*"
compare_exclusions="$compare_exclusions | gcc/m2/gm2-compiler-boot/SYSTEM*"
compare_exclusions="$compare_exclusions | gcc/m2/gm2version*"
case "$target" in
hppa*64*-*-hpux*) ;;
powerpc*-ibm-aix*) compare_exclusions="$compare_exclusions | *libgomp*\$(objext)" ;;

View File

@@ -140,7 +140,7 @@ host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktr
# binutils, gas and ld appear in that order because it makes sense to run
# "make check" in that particular order.
# If --enable-gold is used, "gold" may replace "ld".
host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gdbserver gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools c++tools"
host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gdbserver gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gm2tools gotools c++tools"
# these libraries are built for the target environment, and are built after
# the host libraries and the host tools (which may be a cross compiler)
@@ -161,6 +161,7 @@ target_libraries="target-libgcc \
target-libffi \
target-libobjc \
target-libada \
target-libgm2 \
target-libgo \
target-libphobos \
target-zlib"
@@ -464,6 +465,14 @@ if test "${ENABLE_LIBADA}" != "yes" ; then
noconfigdirs="$noconfigdirs gnattools"
fi
AC_ARG_ENABLE(libgm2,
[AS_HELP_STRING([--enable-libgm2], [build libgm2 directory])],
ENABLE_LIBGM2=$enableval,
ENABLE_LIBGM2=no)
if test "${ENABLE_LIBGM2}" != "yes" ; then
noconfigdirs="$noconfigdirs gm2tools"
fi
AC_ARG_ENABLE(libssp,
[AS_HELP_STRING([--enable-libssp], [build libssp directory])],
ENABLE_LIBSSP=$enableval,
@@ -3579,6 +3588,7 @@ NCN_STRICT_CHECK_TARGET_TOOLS(GCC_FOR_TARGET, gcc, ${CC_FOR_TARGET})
NCN_STRICT_CHECK_TARGET_TOOLS(GFORTRAN_FOR_TARGET, gfortran)
NCN_STRICT_CHECK_TARGET_TOOLS(GOC_FOR_TARGET, gccgo)
NCN_STRICT_CHECK_TARGET_TOOLS(GDC_FOR_TARGET, gdc)
NCN_STRICT_CHECK_TARGET_TOOLS(GM2_FOR_TARGET, gm2)
ACX_CHECK_INSTALLED_TARGET_TOOL(AR_FOR_TARGET, ar)
ACX_CHECK_INSTALLED_TARGET_TOOL(AS_FOR_TARGET, as)
@@ -3617,6 +3627,8 @@ GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC,
[gcc/gccgo -B$$r/$(HOST_SUBDIR)/gcc/], go)
GCC_TARGET_TOOL(gdc, GDC_FOR_TARGET, GDC,
[gcc/gdc -B$$r/$(HOST_SUBDIR)/gcc/], d)
GCC_TARGET_TOOL(gm2, GM2_FOR_TARGET, GM2,
[gcc/gm2 -B$$r/$(HOST_SUBDIR)/gcc/], m2)
GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new])
GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO)
GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new])
@@ -3743,6 +3755,9 @@ AC_SUBST(stage2_werror_flag)
# Specify what files to not compare during bootstrap.
compare_exclusions="gcc/cc*-checksum\$(objext) | gcc/ada/*tools/*"
compare_exclusions="$compare_exclusions | gcc/m2/gm2-compiler-boot/M2Version*"
compare_exclusions="$compare_exclusions | gcc/m2/gm2-compiler-boot/SYSTEM*"
compare_exclusions="$compare_exclusions | gcc/m2/gm2version*"
case "$target" in
hppa*64*-*-hpux*) ;;
powerpc*-ibm-aix*) compare_exclusions="$compare_exclusions | *libgomp*\$(objext)" ;;

View File

@@ -211,6 +211,12 @@
#endif
/* If --with-multiarch option is used */
#ifndef USED_FOR_TARGET
#undef ENABLE_MULTIARCH
#endif
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#ifndef USED_FOR_TARGET
@@ -2324,12 +2330,6 @@
#endif
/* Specify if mutliarch is enabled. */
#ifndef USED_FOR_TARGET
#undef ENABLE_MULTIARCH
#endif
/* The size of `dev_t', as computed by sizeof. */
#ifndef USED_FOR_TARGET
#undef SIZEOF_DEV_T

85
gcc/configure vendored
View File

@@ -805,6 +805,8 @@ am__leading_dot
doc_build_sys
AR
NM
HAVE_PYTHON
PYTHON
BISON
FLEX
GENERATED_MANPAGES
@@ -8899,6 +8901,84 @@ done
test -n "$BISON" || BISON="$MISSING bison"
# Python3?
# Extract the first word of "python3", so it can be a program name with args.
set dummy python3; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_PYTHON+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$PYTHON"; then
ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_PYTHON="python3"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
PYTHON=$ac_cv_prog_PYTHON
if test -n "$PYTHON"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
$as_echo "$PYTHON" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -n "$PYTHON"; then
# Found it, now check the version.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for modern python3" >&5
$as_echo_n "checking for modern python3... " >&6; }
if ${gcc_cv_prog_python3_modern+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_prog_version=`eval $PYTHON --version 2>&1 |
sed -n 's/^.*Python.* \([0-9][0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') gcc_cv_prog_python3_modern=no;;
3.[4-9]*|3.[1-9][0-9]*|[4-9].*|[1-9][0-9]*) gcc_cv_prog_python3_modern=yes;;
*) gcc_cv_prog_python3_modern=no;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_prog_python3_modern" >&5
$as_echo "$gcc_cv_prog_python3_modern" >&6; }
else
gcc_cv_prog_python3_modern=no
fi
if test $gcc_cv_prog_python3_modern = no; then
PYTHON="${CONFIG_SHELL-/bin/sh} $ac_aux_dir/missing python3"
fi
if test $gcc_cv_prog_python3_modern = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
*** Python3 is missing.
*** Documentation for modula-2 will not include the target SYSTEM module." >&5
$as_echo "$as_me: WARNING:
*** Python3 is missing.
*** Documentation for modula-2 will not include the target SYSTEM module." >&2;}
HAVE_PYTHON=no
else
HAVE_PYTHON=yes
fi
# Binutils are not build modules, unlike bison/flex/makeinfo. So we
# check for build == host before using them.
@@ -19712,7 +19792,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 19715 "configure"
#line 19795 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -19818,7 +19898,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 19821 "configure"
#line 19901 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -33909,4 +33989,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi

View File

@@ -137,7 +137,7 @@ AC_ARG_WITH([native-system-header-dir],
configured_native_system_header_dir="${withval}"
], [configured_native_system_header_dir=])
AC_ARG_WITH(build-sysroot,
AC_ARG_WITH(build-sysroot,
[AS_HELP_STRING([--with-build-sysroot=sysroot],
[use sysroot as the system root during the build])],
[if test x"$withval" != x ; then
@@ -169,10 +169,10 @@ AC_ARG_WITH(sysroot,
yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_noncanonical}/sys-root' ;;
*) TARGET_SYSTEM_ROOT=$with_sysroot ;;
esac
TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)'
case ${TARGET_SYSTEM_ROOT} in
"${test_prefix}"|"${test_prefix}/"*|\
"${test_exec_prefix}"|"${test_exec_prefix}/"*|\
@@ -282,14 +282,14 @@ elif test x$withval != xno; then
fi])
# We would like to our source tree to be readonly. However when releases or
# pre-releases are generated, the flex/bison generated files as well as the
# pre-releases are generated, the flex/bison generated files as well as the
# various formats of manuals need to be included along with the rest of the
# sources. Therefore we have --enable-generated-files-in-srcdir to do
# sources. Therefore we have --enable-generated-files-in-srcdir to do
# just that.
AC_MSG_CHECKING([whether to place generated files in the source directory])
dnl generated-files-in-srcdir is disabled by default
AC_ARG_ENABLE(generated-files-in-srcdir,
AC_ARG_ENABLE(generated-files-in-srcdir,
[AS_HELP_STRING([--enable-generated-files-in-srcdir],
[put copies of generated files in source dir
intended for creating source tarballs for users
@@ -585,7 +585,7 @@ ACX_PROG_CXX_WARNING_OPTS(
ACX_PROG_CC_WARNING_OPTS(
m4_quote(m4_do([-Wold-style-definition -Wc++-compat])), [c_strict_warn])
ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC(
m4_quote(m4_do([-Wno-long-long -Wno-variadic-macros ],
m4_quote(m4_do([-Wno-long-long -Wno-variadic-macros ],
[-Wno-overlength-strings])), [strict_warn])
ACX_PROG_CXX_WARNINGS_ARE_ERRORS([manual], [strict_warn])
@@ -605,7 +605,7 @@ AC_SUBST(warn_cxxflags)
ACX_PROG_CC_WARNING_OPTS(
m4_quote(m4_do([-fno-exceptions -fno-rtti -fasynchronous-unwind-tables])),
[noexception_flags])
# Enable expensive internal checks
is_release=
if test x"`cat $srcdir/DEV-PHASE`" != xexperimental; then
@@ -835,7 +835,7 @@ esac],
[coverage_flags=""])
AC_SUBST(coverage_flags)
AC_ARG_ENABLE(gather-detailed-mem-stats,
AC_ARG_ENABLE(gather-detailed-mem-stats,
[AS_HELP_STRING([--enable-gather-detailed-mem-stats],
[enable detailed memory allocation stats gathering])], [],
[enable_gather_detailed_mem_stats=no])
@@ -1218,7 +1218,7 @@ ACX_PROG_LN($LN_S)
AC_PROG_RANLIB
ranlib_flags=""
AC_SUBST(ranlib_flags)
gcc_AC_PROG_INSTALL
# See if cmp has --ignore-initial.
@@ -1263,6 +1263,20 @@ AC_CHECK_PROGS([FLEX], flex, [$MISSING flex])
# Bison?
AC_CHECK_PROGS([BISON], bison, [$MISSING bison])
# Python3?
ACX_CHECK_PROG_VER(PYTHON, python3, --version,
[Python.* \([0-9][0-9.]*\)],
[3.[4-9]*|3.[1-9][0-9]*|[4-9].*|[1-9][0-9]*])
if test $gcc_cv_prog_python3_modern = no; then
AC_MSG_WARN([
*** Python3 is missing.
*** Documentation for modula-2 will not include the target SYSTEM module.])
HAVE_PYTHON=no
else
HAVE_PYTHON=yes
fi
AC_SUBST(HAVE_PYTHON)
# Binutils are not build modules, unlike bison/flex/makeinfo. So we
# check for build == host before using them.
@@ -1550,7 +1564,7 @@ GCC_AC_FUNC_MMAP_BLACKLIST
case "${host}" in
*-*-*vms*)
# Under VMS, vfork works very differently than on Unix. The standard test
# Under VMS, vfork works very differently than on Unix. The standard test
# won't work, and it isn't easily adaptable. It makes more sense to
# just force it.
ac_cv_func_vfork_works=yes
@@ -1782,7 +1796,7 @@ fi
CFLAGS="$saved_CFLAGS"
CXXFLAGS="$saved_CXXFLAGS"
# mkdir takes a single argument on some systems.
# mkdir takes a single argument on some systems.
gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
# File extensions
@@ -2025,7 +2039,7 @@ if test x$enable___cxa_atexit = xyes || \
esac
else
# We can't check for __cxa_atexit when building a cross, so assume
# it is available
# it is available
use_cxa_atexit=yes
fi
if test x$use_cxa_atexit = xyes; then
@@ -2058,7 +2072,7 @@ AC_SUBST(extra_opt_files)
# auto-host.h is the file containing items generated by autoconf and is
# the first file included by config.h.
# If host=build, it is correct to have bconfig include auto-host.h
# as well. If host!=build, we are in error and need to do more
# as well. If host!=build, we are in error and need to do more
# work to find out the build config parameters.
if test x$host = x$build
then
@@ -2068,7 +2082,7 @@ else
# We create a subdir, then run autoconf in the subdir.
# To prevent recursion we set host and build for the new
# invocation of configure to the build for this invocation
# of configure.
# of configure.
tempdir=build.$$
rm -rf $tempdir
mkdir $tempdir
@@ -2274,7 +2288,7 @@ case $host_os in
&& test "x$enable_win32_registry" != x; then
AC_DEFINE_UNQUOTED(WIN32_REGISTRY_KEY, "$enable_win32_registry",
[Define to be the last component of the Windows registry key under which
to look for installation paths. The full key used will be
to look for installation paths. The full key used will be
HKEY_LOCAL_MACHINE/SOFTWARE/Free Software Foundation/{WIN32_REGISTRY_KEY}.
The default is the GCC version number.])
fi
@@ -2517,7 +2531,7 @@ AC_SUBST([collect2])
case $use_collect2 in
no) use_collect2= ;;
"") ;;
*)
*)
host_xm_defines="${host_xm_defines} USE_COLLECT2"
xm_defines="${xm_defines} USE_COLLECT2"
case $host_can_use_collect2 in
@@ -2582,7 +2596,7 @@ AC_SUBST(ORIGINAL_AS_FOR_TARGET)
case "$ORIGINAL_AS_FOR_TARGET" in
./as | ./as$build_exeext) ;;
*) AC_CONFIG_FILES(as:exec-tool.in, [chmod +x as]) ;;
esac
esac
default_ld=
AC_ARG_ENABLE(ld,
@@ -2690,7 +2704,7 @@ AC_MSG_CHECKING(gold linker with split stack support as non default)
# Check to see if default ld is not gold, but gold is
# available and has support for split stack. If gcc was configured
# with gold then no checking is done.
#
#
if test x$ld_is_gold = xno && which ${gcc_cv_ld}.gold >/dev/null 2>&1; then
# For platforms other than powerpc64*, enable as appropriate.
@@ -2727,7 +2741,7 @@ AC_SUBST(ORIGINAL_LD_FOR_TARGET)
case "$ORIGINAL_LD_FOR_TARGET" in
./collect-ld | ./collect-ld$build_exeext) ;;
*) AC_CONFIG_FILES(collect-ld:exec-tool.in, [chmod +x collect-ld]) ;;
esac
esac
AC_MSG_CHECKING(what linker to use)
if test "$gcc_cv_ld" = ../ld/ld-new$build_exeext \
@@ -2894,7 +2908,7 @@ AC_SUBST(ORIGINAL_DSYMUTIL_FOR_TARGET)
case "$ORIGINAL_DSYMUTIL_FOR_TARGET" in
./dsymutil | ./dsymutil$build_exeext) ;;
*) AC_CONFIG_FILES(dsymutil:exec-tool.in, [chmod +x dsymutil]) ;;
esac
esac
# Figure out what assembler alignment features are present.
gcc_GAS_CHECK_FEATURE([.balign and .p2align], gcc_cv_as_balign_and_p2align,,
@@ -3421,7 +3435,7 @@ if test $gcc_cv_as_section_exclude_e = no; then
;;
i?86-*-solaris2* | x86_64-*-solaris2*)
conftest_s='.section foo1, #exclude'
;;
;;
esac
;;
esac
@@ -3722,17 +3736,17 @@ foo: .long 25
addil LT%foo-$tls_gdidx$,gp
ldo RT%foo-$tls_gdidx$(%r1),%arg0
b __tls_get_addr
nop
nop
addil LT%foo-$tls_ldidx$,gp
b __tls_get_addr
ldo RT%foo-$tls_ldidx$(%r1),%arg0
addil LR%foo-$tls_dtpoff$,%ret0
ldo RR%foo-$tls_dtpoff$(%r1),%t1
mfctl %cr27,%t1
mfctl %cr27,%t1
addil LT%foo-$tls_ieoff$,gp
ldw RT%foo-$tls_ieoff$(%r1),%t2
add %t1,%t2,%t3
mfctl %cr27,%t1
add %t1,%t2,%t3
mfctl %cr27,%t1
addil LR%foo-$tls_leoff$,%t1
ldo RR%foo-$tls_leoff$(%r1),%t2'
tls_as_opt=--fatal-warnings
@@ -3798,7 +3812,7 @@ foo: .long 25
case $gas_flag in
yes) tls_as_opt="$tls_as_opt --64" ;;
no) tls_as_opt="$tls_as_opt -xarch=amd64" ;;
esac
esac
fi
conftest_s="$conftest_s
foo: .long 25
@@ -4855,7 +4869,7 @@ tls_ld:
.section .text,"ax",@progbits
.globl _start
.type _start, @function
_start:
_start:
leal value@tlsldm(%ebx), %eax
call ___tls_get_addr@plt
@@ -6642,7 +6656,7 @@ AC_CACHE_CHECK(linker --sysroot support,
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 ; then
gcc_cv_ld_sysroot=yes
fi
elif test x$gcc_cv_ld != x; then
elif test x$gcc_cv_ld != x; then
if $gcc_cv_ld --help 2>&1 | grep sysroot > /dev/null; then
gcc_cv_ld_sysroot=yes
fi
@@ -6650,7 +6664,7 @@ AC_CACHE_CHECK(linker --sysroot support,
if test x"$gcc_cv_ld_sysroot" = xyes; then
AC_DEFINE(HAVE_LD_SYSROOT, 1,
[Define if your linker supports --sysroot.])
fi
fi
case $target in
*-*-solaris2*)
@@ -7060,7 +7074,7 @@ changequote(,)dnl
# sources implementing front-end to GCC tree converters), and for
# build infrastructure purposes (Make-lang.in, etc.)
#
# This will be <subdir> (relative to $srcdir) if a line like
# This will be <subdir> (relative to $srcdir) if a line like
# gcc_subdir="<subdir>" or gcc_subdir=<subdir>
# is found in <langdir>/config-lang.in, and will remain <langdir>
# otherwise.
@@ -7349,7 +7363,7 @@ AC_ARG_VAR(GMPINC,[How to find GMP include files])
AC_ARG_VAR(ISLLIBS,[How to link isl])
AC_ARG_VAR(ISLINC,[How to find isl include files])
if test "x${ISLLIBS}" != "x" ; then
if test "x${ISLLIBS}" != "x" ; then
AC_DEFINE(HAVE_isl, 1, [Define if isl is in use.])
fi
@@ -7648,7 +7662,6 @@ for d in $subdirs doc build common c-family
do
test -d $d || mkdir $d
done
],
],
[subdirs='$subdirs'])
AC_OUTPUT

2838
gcc/doc/gm2.texi Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -308,6 +308,13 @@ On some targets, @samp{libphobos} isn't enabled by default, but compiles
and works if @option{--enable-libphobos} is used. Specifics are
documented for affected targets.
@item @anchor{GM2-prerequisite}GM2
Python3 is required if you want to build the complete Modula-2
documentation including the target @code{SYSTEM} definition module.
If Python3 is unavailable Modula-2 documentation will include a target
independent version of the SYSTEM modules.
@item A ``working'' POSIX compatible shell, or GNU bash
Necessary when running @command{configure} because some
@@ -436,6 +443,34 @@ Necessary to build GCC with zstd compression used for LTO bytecode.
The library is searched in your default library patch search.
Alternatively, the @option{--with-zstd} configure option should be used.
@item Python3 modules
The complete list of Python3 modules broken down by GCC subcomponent
is shown below:
@table @asis
@item internal debugging in gdbhooks
@code{gdb}, @code{gdb.printing}, @code{gdb.types},
@code{os.path}, @code{re}, @code{sys} and @code{tempfile},
@item g++ testsuite
@code{gcov}, @code{gzip}, @code{json}, @code{os} and @code{pytest}.
@item c++ cxx api generation
@code{csv}, @code{os}, @code{sys} and @code{time}.
@item modula-2 documentation
@code{argparse}, @code{os}, @code{pathlib}, @code{shutil} and
@code{sys}.
@item git developer tools
@code{os} and @code{sys}.
@item ada documentation
@code{latex_elements}, @code{os}, @code{pygments}, @code{re},
@code{sys} and @code{time}.
@end table
@end table
@heading Tools/packages necessary for modifying GCC
@@ -1853,11 +1888,13 @@ grep ^language= */config-lang.in
@end smallexample
Currently, you can use any of the following:
@code{all}, @code{default}, @code{ada}, @code{c}, @code{c++}, @code{d},
@code{fortran}, @code{go}, @code{jit}, @code{lto}, @code{objc}, @code{obj-c++}.
@code{fortran}, @code{go}, @code{jit}, @code{lto}, @code{m2},
@code{objc}, @code{obj-c++}.
Building the Ada compiler has special requirements, see below.
If you do not pass this flag, or specify the option @code{default}, then the
default languages available in the @file{gcc} sub-tree will be configured.
Ada, D, Go, Jit, and Objective-C++ are not default languages. LTO is not a
Ada, D, Go, Jit, Objective-C++ and Modula-2 are not default languages.
LTO is not a
default language, but is built by default because @option{--enable-lto} is
enabled by default. The other languages are default languages. If
@code{all} is specified, then all available languages are built. An
@@ -1885,6 +1922,10 @@ be built. This can be useful for debugging, or for compatibility with
previous Ada build procedures, when it was required to explicitly
do a @samp{make -C gcc gnatlib_and_tools}.
@item --disable-libgm2
Specify that the run-time libraries and tools used by Modula-2 should not
be built. This can be useful for debugging.
@item --disable-libsanitizer
Specify that the run-time libraries for the various sanitizers should
not be built.
@@ -2854,8 +2895,8 @@ version 2.21 or later).
@item @samp{bootstrap-lto-noplugin}
This option is similar to @code{bootstrap-lto}, but is intended for
hosts that do not support the linker plugin. Without the linker plugin
static libraries are not compiled with link-time optimizations. Since
hosts that do not support the linker plugin. Without the linker plugin
static libraries are not compiled with link-time optimizations. Since
the GCC middle end and back end are in @file{libbackend.a} this means
that only the front end is actually LTO optimized.
@@ -3144,10 +3185,10 @@ on a simulator as described at @uref{https://gcc.gnu.org/simtest-howto.html}.
In order to run sets of tests selectively, there are targets
@samp{make check-gcc} and language specific @samp{make check-c},
@samp{make check-c++}, @samp{make check-d} @samp{make check-fortran},
@samp{make check-ada}, @samp{make check-objc}, @samp{make check-obj-c++},
@samp{make check-lto}
in the @file{gcc} subdirectory of the object directory. You can also
just run @samp{make check} in a subdirectory of the object directory.
@samp{make check-ada}, @samp{make check-m2}, @samp{make check-objc},
@samp{make check-obj-c++}, @samp{make check-lto} in the @file{gcc}
subdirectory of the object directory. You can also just run
@samp{make check} in a subdirectory of the object directory.
A more selective way to just run all @command{gcc} execute tests in the
@@ -3572,7 +3613,7 @@ GNU Compiler Collection on your machine.
Note that this list of install notes is @emph{not} a list of supported
hosts or targets. Not all supported hosts and targets are listed
here, only the ones that require host-specific or target-specific
information have to.
information have to.
@ifhtml
@itemize

View File

@@ -97,6 +97,9 @@ The GCC runtime library.
@item libgfortran
The Fortran runtime library.
@item libgm2
The Modula-2 runtime library.
@item libgo
The Go runtime library. The bulk of this library is mirrored from the
@uref{https://github.com/@/golang/go, master Go repository}.
@@ -184,7 +187,8 @@ The @file{gcc} directory contains the following subdirectories:
@item @var{language}
Subdirectories for various languages. Directories containing a file
@file{config-lang.in} are language subdirectories. The contents of
the subdirectories @file{c} (for C), @file{cp} (for C++),
the subdirectories @file{c} (for C), @file{cp} (for C++), @file{m2}
(for Modula-2),
@file{objc} (for Objective-C), @file{objcp} (for Objective-C++),
and @file{lto} (for LTO) are documented in this
manual (@pxref{Passes, , Passes and Files of the Compiler});

View File

@@ -25221,6 +25221,8 @@ gen_compile_unit_die (const char *filename)
}
else if (strcmp (language_string, "GNU F77") == 0)
language = DW_LANG_Fortran77;
else if (strcmp (language_string, "GNU Modula-2") == 0)
language = DW_LANG_Modula2;
else if (dwarf_version >= 3 || !dwarf_strict)
{
if (strcmp (language_string, "GNU Ada") == 0)

397
gcc/m2/COPYING.FDL Normal file
View File

@@ -0,0 +1,397 @@
GNU Free Documentation License
Version 1.2, November 2002
Copyright (C) 2000-2022 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The "Document", below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as "you". You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (Thus, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
A section "Entitled XYZ" means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled "History" in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the "History" section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications",
Preserve the Title of the section, and preserve in the section all
the substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled "Endorsements"
or to conflict in title with any Invariant Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled "History"
in the various original documents, forming one section Entitled
"History"; likewise combine any sections Entitled "Acknowledgements",
and any sections Entitled "Dedications". You must delete all sections
Entitled "Endorsements".
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an "aggregate" if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the "with...Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.

73
gcc/m2/COPYING.RUNTIME Normal file
View File

@@ -0,0 +1,73 @@
GCC RUNTIME LIBRARY EXCEPTION
Version 3.1, 31 March 2009
Copyright (C) 2009-2022 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
This GCC Runtime Library Exception ("Exception") is an additional
permission under section 7 of the GNU General Public License, version
3 ("GPLv3"). It applies to a given file (the "Runtime Library") that
bears a notice placed by the copyright holder of the file stating that
the file is governed by GPLv3 along with this Exception.
When you use GCC to compile a program, GCC may combine portions of
certain GCC header files and runtime libraries with the compiled
program. The purpose of this Exception is to allow compilation of
non-GPL (including proprietary) programs to use, in this way, the
header files and runtime libraries covered by this Exception.
0. Definitions.
A file is an "Independent Module" if it either requires the Runtime
Library for execution after a Compilation Process, or makes use of an
interface provided by the Runtime Library, but is not otherwise based
on the Runtime Library.
"GCC" means a version of the GNU Compiler Collection, with or without
modifications, governed by version 3 (or a specified later version) of
the GNU General Public License (GPL) with the option of using any
subsequent versions published by the FSF.
"GPL-compatible Software" is software whose conditions of propagation,
modification and use would permit combination with GCC in accord with
the license of GCC.
"Target Code" refers to output from any compiler for a real or virtual
target processor architecture, in executable form or suitable for
input to an assembler, loader, linker and/or execution
phase. Notwithstanding that, Target Code does not include data in any
format that is used as a compiler intermediate representation, or used
for producing a compiler intermediate representation.
The "Compilation Process" transforms code entirely represented in
non-intermediate languages designed for human-written code, and/or in
Java Virtual Machine byte code, into Target Code. Thus, for example,
use of source code generators and preprocessors need not be considered
part of the Compilation Process, since the Compilation Process can be
understood as starting with the output of the generators or
preprocessors.
A Compilation Process is "Eligible" if it is done using GCC, alone or
with other GPL-compatible software, or if it is done without using any
work based on GCC. For example, using non-GPL-compatible Software to
optimize any GCC intermediate representations would not qualify as an
Eligible Compilation Process.
1. Grant of Additional Permission.
You have permission to propagate a work of Target Code formed by
combining the Runtime Library with Independent Modules, even if such
propagation would otherwise violate the terms of GPLv3, provided that
all Target Code was generated by Eligible Compilation Processes. You
may then convey such a combination under terms of your choice,
consistent with the licensing of the Independent Modules.
2. No Weakening of GCC Copyleft.
The availability of this Exception does not imply any general
presumption that third-party software is unaffected by the copyleft
requirements of the license of GCC.

675
gcc/m2/COPYING3 Normal file
View File

@@ -0,0 +1,675 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

165
gcc/m2/COPYING3.LIB Normal file
View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

68
gcc/m2/ChangeLog-2001 Normal file
View File

@@ -0,0 +1,68 @@
2001-08-01 Gaius Mulley <gaius@glam.ac.uk>
* brought gm2 up to date with gcc-3.0
* fixed opaque handling in the new parser
* now using new parser by default
* rewritten NameKey.mod, removing any static limits on array
sizes by using dynamic data structures throughout.
* improved p2c so that it handles opaque types properly.
* modified Lists.def, SymbolKey.def to use opaque types.
2001-03-09 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug in FpuIO.mod which failed to issue a '-' when emitting
real numbers.
* added many new tests to the regression directory (autotest).
* fixed bugs in the bnf descriptions. Compiler is now using
automatically generated parser for P1, P2 and P3. Just PH
remains hand built.
* Introduced a number of small regression tests following
Olivier's extensive bug report on (m2f). Fixed a number
of bugs reported, see gm2/m2/comp/BUGS for details.
* Fixed bug in M2Lexical.mod causing mismatch between
source line numbers and gdb information.
* Fixed + - / of constant sets.
* removed tests for the interim (they exist under
bitset3.mod.breaks and string.mod.breaks respectively)
* modifications to stop overflow on max CARDINAL when converting
numbers into strings (NumberIO.mod)
2001-02-28 Gaius Mulley <gaius@glam.ac.uk>
* using new parser P1SyntaxCheck.mod and P2Build.mod
P1SyntaxCheck.mod now inserts simple missing tokens.
* both automatically generated and provide better error
recovery
* improved some error messages
2001-01-23 Gaius Mulley <gaius@glam.ac.uk>
* brought gm2 up to date with gcc-20001204
* introduced configure and moved all makefiles to Makefile.in
* tidied up p2c a little, in an attempt to reduce the compile
time warnings
2000-12-02 Gaius Mulley <gaius@glam.ac.uk>
* brought gm2 up to date with gcc-20001120
* garbage collection now working in gm2
* introduced EXPORT UNQUALIFIED as a method for writing
definition modules as interfaces for C libraries
* altered link tools to reflect EXPORT UNQUALIFIED
* started work on preprocessing source when -Wcpp is supplied
* tidied up gccgm2.c
2000-09-25 Gaius Mulley <gaius@glam.ac.uk>
* added error messages to lang-spec.h. Issued if wrong combination
of -Wuselist -Wmodules -Wmakelist and -c are supplied.
2000-09-14 Matthias Kurz <mk@baerlap.north.de>
* Many makefile portability corrections (tests for symbol links).
Made makeversion more portable via guessing email address.
Added setenv emulation in libc.c.
Inserted missing Close(fo) to gm2lgen.mod.GenMain().
Improved README,
Added QUIAT to the makefiles.
Cast EOF to (char) inside mkfor.c mklink.c.

59
gcc/m2/ChangeLog-2002 Normal file
View File

@@ -0,0 +1,59 @@
2002-12-20 Gaius Mulley <gaius@glam.ac.uk>
* added __ATTRIBUTE__ __BUILTIN__ ((Ident))
rules for obtaining target compiler constants
* fixed handling of recursive procedure type definitions
bug reported by Iztok Kobal
* improved base types to aid gdb in displaying data types
* checked in some sketchy initial ISO library implementation
modules
2002-11-03 Gaius Mulley <gaius@glam.ac.uk>
* GM2 Release 0.33
* implemented large sets
* implemented ISO complient sets
* definition modules no longer have to explicitly export
identifiers
2002-06-20 Gaius Mulley <gaius@glam.ac.uk>
* GM2 Release 0.32
* now supports building a cross compiler (strong-arm) tested
2002-06-09 Gaius Mulley <gaius@glam.ac.uk>
* brought gm2 up to date with gcc-3.2
* fixed the $(srcdir) in all Makefile.in's
* configuring and building gm2 is now recommended
to occur outside the source tree.
* many changes to gccgm2.c to reflect gcc-3.2
2002-05-04 Gaius Mulley <gaius@glam.ac.uk>
* implemented DEFINITION MODULE FOR "C"
* implemented -Wmakeall
* implemented varargs in "C" modules
* added gm2/examples directory
* updated documentation
* gm2m and gm2l are now built from ebnf descriptions
by ppg
2002-04-15 Gaius Mulley <gaius@glam.ac.uk>
* GM2 Release 0.21
* brought gm2 up to date with gcc-3.0.4
* make paranoid works on Debian GNU/Linux (Athlon)
* finally finished rewrite of a number of key modules
* Strings.mod used instead of StrLib.mod allowing for
dynamic arrays
* new flex built lexical analyser in use.
* cpp is run on all definition/implementation modules if
-Wcpp is used.
* gm2m rewritten
* gm2 and its utilities now use -I for path specification
rather than -M
* Makefiles much simplified, removed most recursive makes.
* all parsers are now mechanically generated using ppg.
* ppg built if required.

284
gcc/m2/ChangeLog-2003 Normal file
View File

@@ -0,0 +1,284 @@
2003-12-26 Gaius Mulley <gaius@glam.ac.uk>
* increased the number of regression tests to 1332
* gm2 passes 1317 and fails 15
* many bug fixes..
* improved documentation, gm2.texi. Now contains
a ebnf description of GNU Modula-2 extracted from
bnf/m2.bnf.
* completed the optional final parameter argument.
* reimplemented the CAP standard function so that it
can be used within constant expressions.
2003-11-27 Gaius Mulley <gaius@glam.ac.uk>
* fixed a bug in the handling of the -Wcpp option so that it uses
-traditional-cpp
* integrated the gm2 and m2f regression tests into the GNU GCC
dejagnu format - all the m2f tests are now used to test gm2.
* started work on a minor extension to GNU Modula-2 which allows
the last parameter to be optional. In turn this allows a
Modula-2 implementation of the ISO module COROUTINES which is
in development.
2003-11-13 Gaius Mulley <gaius@glam.ac.uk>
* modified the generated .h files to be prefixed with `G' to avoid
name clashes which in turn allows gm2 to be built under a vfat
file system.
2003-11-07 Gaius Mulley <gaius@glam.ac.uk>
* changed the flag name -Wverbose to -Wsources
2003-11-07 Gaius Mulley <gaius@glam.ac.uk>
* improved array index type debugging description in gccgm2.c
which allows gdb to understand that arrays are declared ARRAY
[low..high] rather than ARRAY [0..high-low]
2003-11-04 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug in procedure type declaration.
2003-11-03 Gaius Mulley <gaius@glam.ac.uk>
* modified ProcedureBlock rule in bnf/m2.bnf, bnf/m2-[23h].bnf
to comply with ISO syntax. The 'BEGIN' statement sequence is
optional.
* updated the gm2.texi to include a description about
the -Wextended-opaque option.
2003-10-23 Gaius Mulley <gaius@glam.ac.uk>
* fixes to opaque type (in)compatibility for expression and assignments.
2003-10-09 Gaius Mulley <gaius@glam.ac.uk>
* fixed gm2 build with ./configure --enable-checking
2003-10-07 Gaius Mulley <gaius@glam.ac.uk>
* introduced -Wextended-opaque which enables the GM2 extension
to opaque types. This allows opaque types to be non pointer
types, but requires that GM2 parse the corresponding
implementation module.
* modified GM2 to default to the standard opaque implementation
of using SYSTEM.ADDRESS as the `opaque type' outside the
module of its declaration.
* introduced -Wverbose to allow users see the source file names
for modules as they are being compiled.
2003-09-30 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug in ADDADR as reported by Iztok
* fixed bug in exported type name clashes as reported by Iztok
* fixed bug with multiple type references to a SET
* fixed Min`basetype' to contain the type `basetype'
* tidied up IsReallyPointer in M2Quads.mod
2003-09-25 Gaius Mulley <gaius@glam.ac.uk>
* fixed -Wmakeall option.
* fixed CARDINAL type to have range 0..max(unsigned int)
rather than 0..max(integer) as reported by Iztok.
* fixed set type incomparability as reported by Iztok.
* fixed README note about make gm2.paranoid as reported by
Matthias Kurz.
* fixed many of the example programs which were broken during
the migration to gcc-3.3.1.
* fixed lang-specs.h to invoke new cpp.
* removed the M2PATH environment variable usage.
* added more modules to make gm2.paranoid.
* fixed gm2->gcc declaration of arrays.
* fixed infinite loop in M2GenGCC.mod and M2Optimize.mod
* added more regression tests.
* fixed Make-file.in as suggested by Matthias Kurz.
* fixed tools-src/makeversion and tools-src/buildpg to be
more portable as suggested by Matthias Kurz.
* fixed examples/pthread
2003-09-19 Gaius Mulley <gaius@glam.ac.uk>
* GM2 release 0.40
* brought GM2 up to date with gcc-3.3.1
* introduced new files gm2-common.h, gm2-common.c,
gm2-lang.h, gm2-tree.h to reflect the new garbage collection
mechanism.
* major changes to gccgm2.c to reflect migration from gcc-3.2 to
gcc-3.3.1
* introduced gm2-compiler/M2Scope.def, gm2-compiler/M2Scope.mod
to manage the quadruples which represent a particular scope
* major recoding of M2Code and the order that quadruples are coded
into GCC trees. This in turn fixes a very serious nested
procedure bug. (gm2/m2/comp/autotest/gm2/localproc.mod and
convert.mod).
* changes to M2GCCDeclare.mod, M2GenGCC.mod, M2BasicBlock.mod
to allow quadruples to be translated via outer scope to inner
scope ordering.
* M2Code.mod is much cleaner.
* fixed a number of uninitialised variable errors and bad pointer
errors. All caught by the extremely useful x86 utility valgrind.
In turn this fixes a Redhat 9.0 build problem.
* fixed bugs in DynamicStrings.mod, ppg.mod, SEnvironment.mod
* introduced the debian package files (gm2/debian) so that .deb
package (gm2) can be built.
* fixes to gm2 so that it can compile the University of Ulm's
system modules.
2003-06-01 Gaius Mulley <gaius@glam.ac.uk>
* added the LONGCARD data type.
* fixed subrange declarations so that they can be prefixed
by a qualident.
* fixed variant record for ISO syntax
(gm2/m2/comp/autotest/gm2/caseiso.mod).
* fixed importing of an enumerated element
(gm2/m2/comp/autotest/gm2/impm.mod).
2003-05-27 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by Iztok Kobal
(gm2/m2/comp/autotest/gm2/realbitscast.mod).
Fixed cast to copy data.
* enabled SIZE to be invoked from constant expressions.
2003-05-20 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by Iztok Kobal
(gm2/m2/comp/autotest/gm2/testlength3.mod)
LENGTH is now mapped onto M2RTS.Length if the parameter is
not a constant at compile time.
2003-05-16 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by Iztok Kobal
(gm2/m2/comp/autotest/gm2/longstrimp.mod)
and also (gm2/m2/comp/autotest/gm2/imp[deghij].mod)
2003-05-08 Gaius Mulley <gaius@glam.ac.uk>
* implemented the standard function LENGTH
* allowed standard functions to be called from constant expressions
* improved cyclic data type dependancy error messages
* SIZE is now only exported from SYSTEM if the switch -Wiso is absent
SIZE is declared as a standard procedure if -Wiso is present
2003-05-07 Gaius Mulley <gaius@glam.ac.uk>
* implemented ISO BITSET as a standard type which takes
effect when -Wiso is present on the command line.
* backed out garbage collection change to m2.lex
* fixed bugs reported by Iztok Kobal
(gm2/m2/comp/autotest/gm2/[testexit.mod, bitset3.mod bits32.mod])
2003-05-06 Gaius Mulley <gaius@glam.ac.uk>
* modified Storage and SysStorage modules so that the procedure
DEALLOCATE assigns the pointer to NIL
* fixed bug reported by Iztok Kobal
(gm2/m2/comp/autotest/gm2/bitset2.mod)
2003-05-05 Gaius Mulley <gaius@glam.ac.uk>
* fixed two bugs reported by Iztok Kobal.
* fixed bug in M2GCCDeclare.mod (BITSET's subrange was undeclared).
* added BITNUM, the subrange from which BITSET is constructed,
in SYSTEM.
* added regression test case for this bug.
* also modified c.lex to use xstrdup and not strdup.
2003-05-01 Gaius Mulley <gaius@glam.ac.uk>
* added pseudo functions, CAP, ODD, ABS
* removed gm2-libs/Math.def which defined ABS
2003-04-29 Gaius Mulley <gaius@glam.ac.uk>
* examples/pthreads cleaned up
* introduced ISO SYSTEM. Limitations, TSIZE only takes one parameter,
and SHIFT, ROTATE are not implemented yet
* renamed gm2-libs/Strings to gm2-libs/DynamicStrings to avoid name
clash with gm2-iso/Strings
* p2c modified to understand DEFINITION MODULE FOR "C"
* gm2-libs/libc.def modified to use DEFINITION MODULE FOR "C"
* gm2-iso/libc.def removed
* linking references to libc (in gm2/init/*init) removed
* gm2/tools-src/def2texi finished
* gm2/gm2-libs.texi built via gm2/tools-src/def2texi
* gm2/gm2.texi now contains library definition modules and index
* added -Wiso switch to gm2 driver
2003-04-12 Gaius Mulley <gaius@glam.ac.uk>
* first cut of h2def released
* examples/pthreads introduced
* examples/vga.def generated by h2def
* fixed bug in CodeBecomes
* fixed constant set bug in M2GenGCC.mod
* updated gm2.texi to reflect introduction of h2def
* build mechanism tidied up. p2c is now built from the top level
makefile.
* some portability features of p2c fixed, so that it builds
cleanly under Apple Darwin
* many internal changes made to ppg to handle recursive ebnf
rules.
* fixed automatic export of unqualified identifiers from a
DEFINITION MODULE FOR "C"
2003-02-02 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by Iztok Kobal, the gm2-iso/ChanConsts module
failed to compile. Added a regression test to catch this.
2003-02-01 Gaius Mulley <gaius@glam.ac.uk>
* bug fixes in error handling. In particular duplicate symbols
are better handled.
* development checkin of the h2def tool and subsidiary modules.
2003-01-20 Gaius Mulley <gaius@glam.ac.uk>
* bug fixes for gm2m and link-specs.h which allow libraries
to be added with the -Wmakeall option.
* fixed a number of built-in definitions in Builtin.def
* also added MathLib0.def and MathLib0.mod to the pim libraries.
* fixed svga example test
* added long double math built-ins
2003-01-17 Gaius Mulley <gaius@glam.ac.uk>
* bug fixes to the line numbering debugging info
which is passed to gcc. Resulting in better gdb support.
2003-01-14 Gaius Mulley <gaius@glam.ac.uk>
* added the C `double' math built-ins
* fixed path in Make-lang.in which caused `file not found
error' during build
* updated documentation to show correspondance between C and
M2 data types.
* fixed bug in M2SubExp.mod shown by indirect procedure calls
* fixed bug in M2Constants.mod
* introduced SHORTREAL data type and removed the pseudo module
MATH as built-ins are handled via gcc backend.
* removed corresponding gm2-compiler/M2Math module.
2003-01-11 Gaius Mulley <gaius@glam.ac.uk>
* changed ebnf to allow empty variant clauses in a case
statement. Now complies with ISO case statement syntax.
(Bug reported by Iztok Kobal)
2003-01-09 Gaius Mulley <gaius@glam.ac.uk>
* initial checkin of complete built-in function support
to obvious C functions.
* gm2-libs/libc.c, gm2-libs/libc.def:: modified reference
to cfree to free as suggested by John Calley
2003-01-02 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by Matthias Manhart
(procedure type).

396
gcc/m2/ChangeLog-2004 Normal file
View File

@@ -0,0 +1,396 @@
2004-12-22 Gaius Mulley <gaius@glam.ac.uk>
* more fixes to enable to the Z type to work.
* introduced GetM2ZRealType which maps onto the largest
real type tree.
* 24 regression test failures out of 2148 on the Opteron LP64
9 fail within ulm libraries (Procedure/Module scope nesting).
15 fail with ISO import/export of enumeration types.
* exactly the same regression test failures on 32 bit i386
implementation.
* fixed regression test path, all tests are build and run
using gm2-harness-0.3
2004-11-29 Gaius Mulley <gaius@glam.ac.uk>
* internal changes to ordinal type which now use the Z
type (long_long_int) for internal calculations before
being converted into the actual ordinal type at assignment
to a variable or procedure parameter or return value.
* works on a 32 bit i386 but fails on the Opteron LP64 model.
2004-11-22 Gaius Mulley <gaius@glam.ac.uk>
* compiler now checks for overflow at compile time
when constructing constant expressions.
2004-11-17 Gaius Mulley <gaius@glam.ac.uk>
* fixed ppg to generate a comment for in-built rules when
producing the EBNF documentation within gm2.texi
* updated gm2/gm2.texi to reflect availability of the
gm2-harness which will build and test gm2 automatically.
2004-11-12 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by John B. Wallace, Jr <wallacjb@enter.net>
concerning negating a LONGINT constant
(see testsuite/gm2/pim/run/TestLong[34].mod).
* updated gm2/TODO list
* gm2/gccgm2.c added functions to determine the size necessary
for a Modula-2 constant.
* gm2/gm2.texi modified documentation to reflect the ISO rules
concerning importing enumerated types.
* gm2/gm2-compiler/SymbolTable.mod fixed possible buffer overflow
and integrated MakeConstLit with the changes to gccgm2.c.
* minor modifications made to gm2/gm2-libs-pim/README.texi
* moved a number of regression tests into pass/fail directories
to reflect the expected ISO enumeration behaviour. Note
that many of these now fail.
2004-11-05 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by John B. Wallace, Jr <wallacjb@enter.net>
concerning assignment of a constant to a LONGINT
(see testsuite/gm2/pim/run/TestLong.mod).
Creation of LONGINT and LONGCARD constant literals
was broken for values > MAX(INTEGER).
2004-10-29 John B. Wallace, Jr <wallacjb@enter.net>
* fixed infinite loop when calling StrToLongInt.
* contributed test code testsuite/gm2/pim/run/TestLong.mod
2004-10-26 Gaius Mulley <gaius@glam.ac.uk>
* fixed -Wpedantic-param-names option.
* added runtime tests and also parameter switch tests
* added testsuite/gm2/switches/pedantic-params
* added testsuite/gm2/pim/run and a number of old m2f tests
* made compiler check to see that opaque types are really
equivalent to a pointer type if -Wextended-opaque is absent.
* added testsuite/gm2/switches/extended-opaque/{pass,fail}
to stress this check.
2004-10-19 Gaius Mulley <gaius@glam.ac.uk>
* added -Wpedantic-param-names option to check that
parameters to procedures declared in definition modules
have identical names to their implementation module
procedure counterparts.
* fixed bug report by Iztok Kobal. The compiler would
crash when a constant was assigned to a procedure.
2004-10-18 Gaius Mulley <gaius@glam.ac.uk>
* modified gm2/lang-specs.h to make the front end run
with only the -S option. No longer requires -S -c.
Bug reported by john o goyo <jgoyo@ca.inter.net>.
2004-10-12 Diego Rodr=EDguez Rodr=EDguez <dieymir@yahoo.es>
* gm2/Make-lang.in introduced gm2.install rule so that
GNU Modula-2 can be installed without overwriting an
existing installation of gcc.
* gm2/README updated to explain how to only install gm2.
2004-10-12 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by John B. Wallace, Jr
<wallacjb@enter.net>. See testsuite/gm2/pim/run/pass/str6.mod.
2004-10-07 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by Iztok Kobal,
GNU Modula-2 now allows a RETURN statement in the
initialization section of the module.
* fixed another bug reported by Iztok Kobal,
binary and unary large set operators failed when
handling constant set values.
2004-09-20 Gaius Mulley <gaius@glam.ac.uk>
* fixed varient record bug as reported by John B. Wallace, Jr
<wallacjb@enter.net>. See testsuite/gm2/pim/pass/varient.mod.
2004-09-16 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug in gm2/gm2-compiler/Indexing.mod which
occurred after the p2c translation.
* in turn this fixed a gm2m problem. The bug resulted in
touching memory which would not have been malloced so
this fix may have cured a number of problems.
2004-09-14 Gaius Mulley <gaius@glam.ac.uk>
* fixed the ncurses definition module and WindowDevice module.
* fixed M2RTS:Termination to call termination procedures in
reverse.
2004-09-07 Gaius Mulley <gaius@glam.ac.uk>
* tidied up gm2-compiler/M2Base.mod and introduced
compatability matrices which include all the base
types.
2004-09-03 Gaius Mulley <gaius@glam.ac.uk>
* introduced SHORTINT and SHORTCARD data types.
* added ncurses.def example in examples/ncurses
2004-08-31 Gaius Mulley <gaius@glam.ac.uk>
* modified SIZE handling so that SIZE is only available
from SYSTEM when -Wpim2 is present.
* fixed bug as reported by "John B. Wallace, Jr."
<wallacjb@enter.net>. A variable which when implicitly
imported via an IMPORT module; failed.
The variable was not being declared correctly by the
GNU Modula-2 front end to the GCC back end.
2004-08-27 Gaius Mulley <gaius@glam.ac.uk>
* added new switch -Wpim2 to stipulate the Modula-2 PIM-2
dialect.
* Made SIZE pervasive for ISO Modula-2 and PIM-[34] Modula-2
As reported by Diego Rodríguez Rodríguez <dieymir@yahoo.es>.
SIZE can be imported from SYSTEM when -Wpim2 is present.
* removed the association with ".def" and "@modula-2"
inside gm2/lang-specs.h as this conflicts with shared library
file extension .def used by gcc. Bug reported by Gerrit P. Haase
<gp@familiehaase.de>.
2004-08-26 Gaius Mulley <gaius@glam.ac.uk>
* implemented type PROCESS for SYSTEM in the pim library
directory (gm2/gm2-libs-coroutines).
* SYSTEM implements NEWPROCESS, TRANSFER, IOTRANSFER.
This is achieved by using the GNU pthread library context
mechanism.
* provided an Executive and TimerHandler module in
(gm2/examples/executive).
* many bug fixes and regression tests show that 3 ulm standard
library modules fail.
* implemented MAX(REAL), MIN(REAL) and also provided access to
three more gcc builtin functions: huge_val, huge_vall, huge_valf
* started work on a Logitech 3.0 compatible library.
2004-07-06 Gaius Mulley <gaius@glam.ac.uk>
* improved error handling of unknown objects in EXPORT lists.
* added regression test
* implemented a few procedures in the ISO libraries.
2004-07-02 Gaius Mulley <gaius@glam.ac.uk>
* fixed many IMPORT bugs in inner modules
2004-06-30 Gerrit Haase <gp@familiehaase.de>
* cygwin patch for gm2/Make-lang.in
2004-06-29 Gaius Mulley <gaius@glam.ac.uk>
* fixed EXPORT of an object from an inner module into an
implementation module which EXPORTs the same object.
* fixed EXPORT of a procedure from an inner module into an
outer module which is not exported but is assigned to a
variable.
2004-06-28 Gaius Mulley <gaius@glam.ac.uk>
* made flex lexical analysers ignore carriage return
* fixed bug in M2Quads.mod checking parameter of
a const var before value was known.
* fixed local MODULEs so that they can FROM mod IMPORT
* tidied up some ulm implementation modules in ulm-lib-gm2/std
2004-06-22 Gaius Mulley <gaius@glam.ac.uk>
* allowed LONGCARD compatibility with INTEGER
* allowed LONGINT compatibility with CARDINAL
* allowed LONGCARD compatibility with CARDINAL
* allowed LONGINT compatibility with INTEGER
2004-06-21 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug in constant set declaration
(see ulm library ulm-lib-gm2/std/Calendar.mod and
testsuite/gm2/pim/pass/setconst.mod and
testsuite/gm2/pim/pass/setconst2.mod)
* all regression tests pass on the Opteron port of gm2.
2004-06-18 Gaius Mulley <gaius@glam.ac.uk>
* implemented nested module within procedures.
This allows a few more ulm library modules to compile.
2004-06-07 Gaius Mulley <gaius@glam.ac.uk>
* renamed the -Wunbounded-by-reference option to
-funbounded-by-reference as suggested by Waldek Hebisch.
* finished ISO SYSTEM implementation.
* ROTATE, SHIFT now work with smaller than WORD sized sets,
WORD sized sets and larger than WORD sized sets.
* gm2-iso/SYSTEM.mod is called by the back end if larger than
WORD sized sets are ROTATEd or SHIFTed.
* updated gm2.texi to include new sections describing ISO and PIM
versions of the SYSTEM module.
* renamed m2.lex as m2.flex, c.lex as c.flex to fix a bug
reported by Gerrit Haase while attempting the cygwin port.
* renamed gm2-compiler/m2lex.def as gm2-compiler/m2flex.def
* modified gm2-compiler/M2Comp to use m2flex
* modified Make-lang.in to use m2.flex and c.flex
* modified init/h2definit, init/gm2linit to use m2flex
2004-05-10 Gaius Mulley <gaius@glam.ac.uk>
* gm2 now builds on FreeBSD 5.2.1
* removed to_upper and to_lower in p2c
* made gm2/gm2-libs/configure and friends test for `strsignal'
* fixed initialization bug (missing memset)
in gm2/gm2-compiler/Indexing.mod
2004-05-06 Gaius Mulley <gaius@glam.ac.uk>
* added SHIFT and ROTATE into ISO SYSTEM and
made the compiler shift and rotate word and multi-word
set types. Multi-word set rotate and shifts are implemented
by calling ISO SYSTEM runtime procedures. Word sized sets or
smaller are implemented inline using shift/rotate instructions.
2004-05-05 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug report by Paul Whittington <pwhittington@nitrodata.com>
(see testsuite/gm2/link/pim/fail/import.mod).
2004-04-30 Gaius Mulley <gaius@glam.ac.uk>
* updated gm2.texi to reflect new options and changes to the
run-time system.
2004-04-28 Gaius Mulley <gaius@glam.ac.uk>
* introduced -Wunbounded-by-reference option which will make a
reference to non VAR unbounded data providing it is not written to
within the callee procedure.
* introduced -Wverbose-unbounded option which displays names of
unbounded parameters which the compiler will implement as
references even though they were specified as non VAR parameters.
2004-04-27 Gaius Mulley <gaius@glam.ac.uk>
* introduced -Wcase, -Wnil runtime checks
* introduced -Wcheck-all to enable all runtime flags
* updated documentation to refect new options
2004-04-19 Gaius Mulley <gaius@glam.ac.uk>
* added more address regression tests
* fixed address arithmetic bugs as reported by Waldek Hebisch
* fixed record referencing bug as reported by Waldek Hebisch
2004-04-08 Gaius Mulley <gaius@glam.ac.uk>
* tagged CVS using gm2_0_43
2004-04-07 Gaius Mulley <gaius@glam.ac.uk>
* GM2 Release 0.43
* The opteron port is finally integrated into CVS
* fixed bug in vararg parameter declaration which in turn..
* fixed varargs within the opteron port
* checked in "work in progress" gm2/gm2-iso/COROUTINES.mod
2004-04-06 Gaius Mulley <gaius@glam.ac.uk>
* removed gm2-compiler/M2Stack.def gm2-compiler/M2Stack.mod
* made bnf/h2def.bnf 64 bit clean, but not fixed any bugs in h2def.
2004-04-05 Gaius Mulley <gaius@glam.ac.uk>
* fixed gm2.paranoid and all regression tests for the Opteron port
* checked in the opteron port which includes many changes
* int/word based types are now separated from pointer based types.
* modified p2c to use int for INTEGER and unsigned int for
CARDINAL rather than int and unsigned long.
* added gm2-compiler/M2StackWord and gm2-compiler/M2StackAddress
* added gm2-compiler/Indexing to handle arbitary sized arrays of
pointers.
* removed many INTEGER/CARDINAL <-> ADDRESS coersions
* fixed compiler to use new modules above (many changes)
* have moved away from M2Printf using WORD parameters to ARRAY OF
BYTE as this was not 64 bit clean
* fixed p2c to handle ARRAY OF BYTE correctly
* fixed gm2 to handle ARRAY OF BYTE correctly
2004-04-01 Gaius Mulley <gaius@glam.ac.uk>
* fixed record parameter equivalence bug as reported by Waldek
(see testsuite/gm2/pim/pass/record4.mod)
2004-03-26 Gaius Mulley <gaius@glam.ac.uk>
* fixed array type equivalence bug as reported by Waldek
(see testsuite/gm2/pim/pass/array2.mod)
2004-03-25 Gaius Mulley <gaius@glam.ac.uk>
* Implemented __FUNCTION__ keyword which is translated
into a string containing the name of the current visible
function.
* Retrofitted a function name into many of the runtime
procedures within M2RTS and added a new
procedure Halt to M2RTS.
2004-03-18 Gaius Mulley <gaius@glam.ac.uk>
* Implemented MIN and MAX for types LONGINT and LONGCARD
2004-03-17 Gaius Mulley <gaius@glam.ac.uk>
* GM2 Release 0.42
* MinGW cross compilation port entered into CVS
* added -Wtarget-ar to gm2lcc.mod, gm2specs.c lang-specs.h
* added gm2/configure and associated files to determine
the whereabouts of target `ar'.
* added gm2/gm2-libs/configure and associated files to
test for target libraries, header files and C functions.
Required to implement the gm2-libs.
2004-02-13 Gaius Mulley <gaius@glam.ac.uk>
* GM2 Release 0.41
* native sparc port passes make gm2.paranoid and make check-gm2
* native i386 port passes make gm2.paranoid and make check-gm2
* fixed bug in M2GenGCC.mod, coerced constant set parameter
values to correct set type.
* fixed bug in M2GenGCC.mod when assigning constant to an ISO WORD
2004-02-10 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug in gccgm2.c CompareTrees should be tested for <= 0
when testing for small set sizes.
* fixed Make-lang.in so that we only link gm2-compiler-boot/clex.o
during stage1. This build error showed up during cross building.
2004-02-05 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug as demonstrated in
testsuite/gm2/pim/pass/subrange4.mod
* all regression tests now pass on the *86 platform
under Debian Woody.
2004-02-05 Gaius Mulley <gaius@glam.ac.uk>
* fixed more constant subrange bugs.
* added new quad to delimit the start of declaration
scope of a procedure.
* regression test failures reduced from 9 to 3.
2004-01-03 Gaius Mulley <gaius@glam.ac.uk>
* fixed bugs in forward and previous references within gm2.texi
* fixed more constant set conversion bugs which reduces
the number of regression failures from 15 to 9.

535
gcc/m2/ChangeLog-2005 Normal file
View File

@@ -0,0 +1,535 @@
2005-12-29 Gaius Mulley <gaius@glam.ac.uk>
* corrections made to gm2/gm2.texi
2005-12-24 Gaius Mulley <gaius@glam.ac.uk>
* joined lines in gm2/tools-src/createUlmSys as
requested by Christoph <modula2@myrealbox.com>
so that gm2 will build on netbsd 2.1.
* added time and tm to gm2/gm2-libs/libc.def.
* added partial implementation of
gm2/gm2-libs-pim/TimeDate.def
gm2/gm2-libs-pim/TimeDate.mod
2005-12-22 Gaius Mulley <gaius@glam.ac.uk>
* added gm2/gm2-libs-pim/Random.def and
gm2/gm2-libs-pim/Random.mod and
* modified gm2/Make-lang.in to install new module.
* remove Random from the TODO list.
2005-12-21 Gaius Mulley <gaius@glam.ac.uk>
* added gm2/gm2-libs-pim/Strings.def and
gm2/gm2-libs-pim/Strings.mod
* modified gm2/Make-lang.in to install new module.
2005-12-19 Gaius Mulley <gaius@glam.ac.uk>
* implemented logitech compatible library
gm2/gm2-libs-pim/RealConversions.def and
gm2/gm2-libs-pim/RealConversions.mod
* added regression test for RealConversions
testsuite/gm2/pimlib/logitech/run/pass/realconv.mod
* fixed regression test expect script to set the
library path correctly.
* updated gm2/gm2-libs.texi to reflect addition of
RealConversions.mods
* added gm2/gm2-libs-pim/FloatingUtilities.def
* added gm2/gm2-libs-pim/FloatingUtilities.mod
* increased number of builtin functions accessible to GNU Modula-2.
2005-12-13 Gaius Mulley <gaius@glam.ac.uk>
* gm2/gccgm2.c:default_conversion now checks the base type.
* gm2/gm2-compiler/M2GCCDeclare.mod: add Subrange types onto the
to do list, if they are not yet resolved.
2005-12-10 Gaius Mulley <gaius@glam.ac.uk>
* fixed Copyright in gm2/gm2-libs-pim library modules
* gm2/gm2-compiler/M2Quads.mod:BuildForToByDo allowed Z type by value.
* gm2/gm2-compiler/M2Quads.mod:BuildPseudoBy converted by value if type
is known.
* fixes a bug reported by: James V. Cox example given in
testsuite/gm2/pim/run/pass/EnumTest.mod
2005-12-10 Gaius Mulley <gaius@glam.ac.uk>
* fixed Copyright in gm2/gm2-libs-pim library modules
2005-12-06 Gaius Mulley <gaius@glam.ac.uk>
* fixed Copyright in University of Ulm modules and also p2c.
* heavily tidied up the p2c source tree.
2005-12-05 Peter P. Eiserloh <peter@eiserloh.org>
* contributed the gm2 manual page and associated Makefile
in the new subdirectory: gm2/man.
2005-11-29 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by John Wallace and Juan Reyes
concerning FOR loops with negative step values.
* added new runtime regression tests gm2/pim/run/pass/For[78].mod
to test these new changes.
* changes to gm2/gm2-compiler/M2Base.mod, gm2-compiler/M2Code.mod,
gm2/gm2-compiler/M2GenGCC.mod, gm2/gm2-compiler/M2Quads.mod
to ensure that the Negate operator works on large data types
LONGCARD contants are changed into LONGINT and overflow is
checked.
2005-11-22 Gaius Mulley <gaius@glam.ac.uk>
* modified ppg to take an extra parameter -f which emits the
Free Documentation License header when producing texinfo
ebnf rules.
* fixed many dates on source files.
2005-11-21 Gaius Mulley <gaius@glam.ac.uk>
* fixed many Copyright dates and GPL, LGPL and FDL license
issues.
* replaced gm2/ulm-lib-gm2/std/Storage.mod with an implementation
which uses malloc and free. This in turn fixes a runtime regression
test (hello world) now works with the Ulm libraries.
* fixed gm2/gm2.texi to include FDL notice and also fixed all
included texi files in the same way.
* added GPL, Modula-2 and Copyright notices to all gm2/tools-src
files.
2005-11-15 Gaius Mulley <gaius@glam.ac.uk>
* added more regression tests and
* completed the printing of set types within gdb
* completed the printing of array and subrange types within gdb
* made gdb print Modula-2 style CHARs and improved type printing
within gdb.
* rationalised the gdb and gcc patches within the gm2/patch
subdirectories.
* modified gm2-harness-0.6 to apply patches in order.
* minor fixes to gm2/gccgm2.c to give better type information.
* improved gdb section within gm2/gm2.texi
2005-11-11 Gaius Mulley <gaius@glam.ac.uk>
* fixed minor node bugs in gm2/gm2.texi, gm2/gpl.texi, gm2/gnu.texi
2005-11-10 Gaius Mulley <gaius@glam.ac.uk>
* added gm2/COPYING.LGPL
* changed all references of the old FSF address to the new address.
* fixed bugs reported by John Wallace (MAX(INTEGER), MAX(LONGINT),
MIN(INTEGER) and MIN(LONGINT)) were not correctly converted in
gm2/gm2-libs-pim/InOut.mod, gm2/gm2-libs/FpuIO.mod,
gm2/gm2-libs/NumberIO.mod.
* added new regression tests in
gm2/switches/pim4/run/pass/InOutBug.mod and
gm2/switches/pim4/run/pass/FpuIOBug.mod which perform regression
runtime tests.
2005-11-07 Gaius Mulley <gaius@glam.ac.uk>
* added gm2/COPYING and included licence information
inside gm2/gm2.texi
* added gm2/gnu.texi and gm2/gpl.texi and referenced
them from gm2/gm2.texi
2005-11-06 Gaius Mulley <gaius@glam.ac.uk>
* improved the gdb patches
2005-11-03 Gaius Mulley <gaius@glam.ac.uk>
* fixes to set types and subranges which in turn
when applied with the patches made to ../../gcc/dwarf2out.c
and also gdb/gdb/dwarf2read.c allow subranges and
set types to be debugged when using the dwarf2 format.
* included the patches to gcc-3.3.6 and gdb-6.3 under the
new directory gm2/patches
* fixed patch for gdb-6.3
* updated gm2/gm2.texi
* released gm2-harness-0.6 which will automatically patch
gcc-3.3.6 and gdb-6.3, build and install these components.
* fixed warnings from within the gcc patch
2005-10-14 Gaius Mulley <gaius@glam.ac.uk>
* fixed set type debugging information.
Many changes to gm2/gccgm2.c and
minor changes to gm2/gm2-compiler/M2GenGCC.mod.
Debugging set types with gdb now works if -gstabs
are used on the command line of gm2 and also the
modified gdb-6.3 is used.
2005-10-13 Gaius Mulley <gaius@glam.ac.uk>
* fixed call to ranlib in gm2/gm2-compiler/gm2lcc.mod
2005-10-10 Gaius Mulley <gaius@glam.ac.uk>
* introduced an invocation to ranlib after producing the
archive to fix a linking bug on MacOS OS 10.3.9 reported
by: Thomas Ahn <TAhnMaple@gmx.de>.
* propagated ranlib though the various subcomponents of
gm2: gm2/gm2spec.c gm2/lang-specs.h gm2/Make-lang.in
gm2/gm2-compiler/gm2lcc.mod gm2/gm2-compiler/M2Options.mod
2005-10-07 Gaius Mulley <gaius@glam.ac.uk>
* replaced MathLib.mod onto the list of ULM modules
which prior to installation.
* fixed ggc bug so that types are remembered and marked.
These types are declared in M2GCCDeclare.mod before
code generation takes place and do not experience the
`push_decl' function.
2005-10-03 Michael H Lambert <lambert@psc.edu>
* removed $(LIBS) from the dependancies of cc1gm2 in
stage1, stage2 and stage3.
2005-09-30 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug in gm2/gm2-libs/FpuIO.mod so that the sign is
not prepended to the string if the number is positive.
* fixed gm2/gm2-libs-pim/Break.c to use HAVE_STDLIB_H and
HAVE_MALLOC_H as detected by the configure script.
* removed ulm-lib-gm2/std/MathLib.mod from the build
process as a temporary work around to get gm2 working
under opendarwin.
2005-09-27 Gaius Mulley <gaius@glam.ac.uk>
* finally fixed _toupper porting problem in p2c as reported
by Thomas Ahn <TAhnMaple@gmx.de>, Ed Smith-Rowland
<3dw4rd@verizon.net>, John o goyo <jgoyo@ca.inter.net>,
Eduardo Abela <eabela@mac.com>, John Calley
<calleys@iquest.net> and many others.
* finally fixed the linking problem when building under
opendarwin. I suspect this will fix the same problems
under MacOS.
2005-09-16 Gaius Mulley <gaius@glam.ac.uk>
* implemented -Wpositive-mod-floor-div option
* updated gm2/gm2.texi and added many switch testing
regression tests.
2005-09-13 Gaius Mulley <gaius@glam.ac.uk>
* implemented REM
* implemented MOD, DIV, / as per ISO, PIM2, PIM3, PIM4
* updated gm2/gm2.texi documentation to reflect the rules
2005-09-12 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by John B. Wallace, Jr <wallacjb@enter.net>
testsuite/gm2/pim/options/bounds/fail/IdentifierBug.mod
* fixed bug reported by John B. Wallace, Jr <wallacjb@enter.net>
testsuite/gm2/testsuite/gm2/pim/pass/ABSBug.mod
* fixed bug reported by John B. Wallace, Jr <wallacjb@enter.net>
testsuite/gm2/pim/run/pass/FpuIOBug.mod
2005-09-06 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by John B. Wallace, Jr <wallacjb@enter.net>
gm2-libs/StringConvert.mod incorrect assumption of negative valued
modulus operator.
* added testsuite/gm2/pimlib/{logitech, ulm} with tests to check
that programs can be linked against logitech and the ulm libraries.
* added testsuite/gm2/pim/run/pass/modulus.mod which tests for
various division and modulus cases.
2005-09-01 Gaius Mulley <gaius@glam.ac.uk>
* implemented -Wdef=extension and -Wmod=extension switches
into GNU Modula-2 compiler and subcomponents (gm2l and gm2m).
* documented the new switches in gm2/gm2.texi
2005-08-09 Gaius Mulley <gaius@glam.ac.uk>
* fixed nested WITH statement bug and added
* testsuite/gm2/pim/run/pass/nestedwith.mod to regressively
check the fix.
2005-08-08 Gaius Mulley <gaius@glam.ac.uk>
* fixed many bugs in gm2/gm2-libs-coroutines/SysVec.mod
* minor updates to gm2/gm2-libs-coroutines/TimerHandler.mod
2005-07-26 Gaius Mulley <gaius@glam.ac.uk>
* modified debian directory so that 0.49 can be built as
a debian package
2005-07-25 Michel Derosa <derosa@videotron.ca>
* fixed malloc.h include for BSD based systems in
gm2/gm2-libs-pim/Break.c
2005-07-21 Gaius Mulley <gaius@glam.ac.uk>
* moved gm2/examples/executive/Executive, TimerHandler, Debug,
SysVec to gm2/gm2-libs-coroutines and
* made gm2/Make-lang.in install these modules
* removed the -Wulm option and replaced it with -Wlibs=ulm
* added -Wlibs=logitech, -Wlibs=pim, -Wlibs=iso,
-Wlibs=pim-coroutine
* altered gm2/Make-lang.in so that the correct library modules
are placed into the correct directories during install.
2005-07-20 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug exposed by: testsuite/gm2/pim/pass/maxlongint.mod
* modified IsMathType in gm2/gm2-compiler/M2Base.mod accordingly.
2005-07-18 Gaius Mulley <gaius@glam.ac.uk>
* updated gm2/gm2.texi and gm2/gm2-libs.texi
* introduced modules Delay, ErrorCode, DebugTrace
and Break into gm2/gm2-libs-pim
* modified gm2/Make-file.in so that these modules
are built and installed.
2005-07-14 Gaius Mulley <gaius@glam.ac.uk>
* GM2 Release 0.49
* tagged CVS using gm2_0_49
* introduced SHORTCARD into p2c
* added gm2/gm2-libs-pim/CardinalIO.def and
gm2/gm2-libs-pim/CardinalIO.mod
* added a number of procedures to implement CardinalIO.mod
in gm2/gm2-libs/StringConvert.mod
* improved gm2/gm2.texi
* modified gm2/Make-file.in so that the library modules
in gm2/gm2-libs-pim are also built and installed
2005-07-10 Gaius Mulley <gaius@glam.ac.uk>
* constant literal string array assignment of smaller sizes to
array variables and parameters.
2005-07-09 Gaius Mulley <gaius@glam.ac.uk>
* implemented MAX(ADDRESS) and MIN(ADDRESS)
2005-07-08 Gaius Mulley <gaius@glam.ac.uk>
* finally all ulm modules compile under GM2
* fixed negative integer bug which was exposed in the 32 bit port
of gm2 when compiling testsuite/gm2/pim/pass/setoverflow.mod
and also gm2/ulm-lib-gm2/std/TimeIO.mod
2005-07-06 Gaius Mulley <gaius@glam.ac.uk>
* fixed a number of bugs relating to gm2 failuring to compile
gm2/ulm-lib-gm2/std/TimeIO.mod. Nested modules within
procedures exporting variables.
* alterations include correct type declaration ahead of
variable creation.
* creating all variables in the outer most procedure scope
if these variables are exported from inner modules.
* also fixed gm2/gccgm2.c so that pointer to sets are cast
into a generic ptr
* also fixed offset into sets (which had assumed sets started
with an element value zero).
2005-06-22 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by John O Goyo <jgoyo@ca.inter.net>
multiple indexed arrays were internally defined incorrectly
and did not allow users to mix array indices by a[x,y,z] and
a[x][y,z] etc as per PIM and ISO specification.
see testsuite/gm2/pim/pass/index.mod and
testsuite/gm2/pim/pass/index2.mod and
testsuite/gm2/pim/run/pass/index3.mod
2005-06-20 Gaius Mulley <gaius@glam.ac.uk>
* added code to treat LOC as a system type in parameter
passing.
2005-06-17 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by John O Goyo <jgoyo@ca.inter.net>
CAST of different sized variables would fail.
* added new switch -Wpedantic-cast which warns if a cast
is converting a variable of a different size to the type.
2005-06-08 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug which occurred if a constant set was created
in a procedure through the CONST construct.
* fixed a number of -Wextended-opaque issues in gm2/bnf/m2-h.bnf
* modified gm2/Make-lang.in to use -Wextended-opaque (for testing)
2005-06-07 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug which occurred if an enumerated type field
was imported by another module.
(See testsuite/gm2/pim/pass/set10.mod)
* fixed circular dependancy bug in record generation.
2005-06-03 Gaius Mulley <gaius@glam.ac.uk>
* reverted some of the changes made to the ulm libraries
in the light of fixing arrays with huge indices.
* mofified gm2/bnf/m2-h.bnf so that expressions within
statement sequences are ignored.
2005-06-02 Gaius Mulley <gaius@glam.ac.uk>
* gm2/gccgm2.c fixed BuildArrayIndexType so that gm2 can build
arrays which have huge indices. This removes a failure from
the regression tests on systems which have a 32 bit long.
2005-06-01 Gaius Mulley <gaius@glam.ac.uk>
* gm2/Make-file.in altered grep -e to aid portability under
Solaris (as reported by john o goyo <jgoyo@ca.inter.net>).
* gm2/examples/server added example of a threaded server
which uses the executive, transfer and iotransfer.
* gm2/examples/executive/Executive added KillProcess.
* gm2/gm2-libs-coroutines/SysVec.mod fixed vector selection
bug.
2005-05-27 Gaius Mulley <gaius@glam.ac.uk>
* gm2/gccgm2.c fixed to detect array indices which exceed
sizetype.
* gm2/lang-specs.h fixed to propagate the -Wcpp flags though
to gm2 subcomponents.
2005-05-25 Michel Derosa <derosa@videotron.ca>
* applied patches to gm2/gm2.texi which describe FreeBSD
build instructions.
2005-05-19 Gaius Mulley <gaius@glam.ac.uk>
* rebuilt gm2/gm2-libs/configure
* gm2/gm2.texi added section heading for advice on building
GNU Modula-2 under FreeBSD 5.3
2005-05-19 Michel Derosa <derosa@videotron.ca>
* applied patches to make gm2 build on FreeBSD 5.3
* gm2/gm2-libs/configure.in test for signal.h and direct.h
* gm2/gm2-libs/gm2-libs-host.h.in test for signal.h and direct.h
* gm2/tools-src/createUlmSys test for signal.h and direct.h
2005-05-18 Gaius Mulley <gaius@glam.ac.uk>
* testsuite/gm2/types/run/pass/varient5.mod introduced to stress
variant records (equivalent to a C union for casting BYTES
into a CARDINAL). Based on an idea from Michel Derosa.
2005-05-17 Gaius Mulley <gaius@glam.ac.uk>
* gm2/gm2-compiler/M2Quads.mod modified to accept zero length strings
as compatible with type CHAR.
* gm2/gm2-compiler/M2GenGCC.mod many modifications/refactoring to enable
strings of 1 or 0 characters to be type compatible with CHAR.
* these fixes allow Iztok's ISO library to compile cleanly.
2005-05-16 Gaius Mulley <gaius@glam.ac.uk>
* gm2/gm2-compiler/M2GenGCC.mod fixed to allow HIGH(ch) where ch is
of type CHAR.
* gm2/gm2-compiler/M2GenGCC.mod fixed to allow comparison of literals
against subrange types.
* gm2/gm2-compiler/M2GenGCC.mod fixed to allow automatic conversion
of strings of 1 or 0 characters to be passed to a parameter of
type CHAR.
* these fixes allow more of the third party tests (from Iztok)
to pass.
2005-05-13 Gaius Mulley <gaius@glam.ac.uk>
* gm2/Make-lang.in shell invocation to use $(SHELL) and also
converted bashisms into pure sh as suggested by
Michel Derosa <derosa@videotron.ca>
2005-05-12 Gaius Mulley <gaius@glam.ac.uk>
* gm2/gm2-compiler/SymbolTable.mod and gm2/gm2-compiler/P2SymBuild.mod
modified to detect double declaration on import and produce useful
error messages.
* gm2/Make-lang.in fixes to the gm2.install rule.
* gm2/gm2-compiler/M2Quads.mod fixed BuildStaticArray to calculate
indices using INTEGER data type.
2005-05-11 Gaius Mulley <gaius@glam.ac.uk>
* P2SymBuild.mod added call to CheckForEnumerationInCurrentModule
to fix 5 regression tests and allow enumeration types to be
visible when aliased via TYPEs and later IMPORTed.
(see testsuite/gm2/pim/pass/impf.mod)
2005-05-10 Gaius Mulley <gaius@glam.ac.uk>
* major changes which now allow GM2 to compile nested varient records
(such as found in gm2/ulm-lib-gm2/std/RTErrors.def)
* added runtime regression test in testsuite/types/run/pass
* gm2/Make-lang.in modified to include RTErrors.mod to be built with
the ulm libraries. Grammer files are built without the -l option to pge.
* gm2/gccgm2.c new functions gccgm2_BuildOffset1 determinePenultimateField
which implement modifications to record/varient field calculation.
* gm2/gm2.texi contains gm2 internal documentation on how the front end
symbol table represents records, field and varient records.
* gm2/bnf/m2-2.bnf removed commented out code.
* gm2/examples/map/Makefile builds the utility semantic.
* gm2/gm2-compiler/M2Base.mod modifications to reflect change in PutFieldRecord
* gm2/gm2-compiler/M2GCCDeclare.mod added debugging procedures PrintVerbose
and PrintSymbol, which can be called interactively from gdb. Also fixed
varient record declaration.
* gm2/gm2-compiler/M2GenGCC.mod fixed varient record field calculation.
* gm2/gm2-compiler/M2Quads.mod changed operands to OffsetOp.
* gm2/gm2-compiler/M2SubExp.mod changes to reflect OffsetOp change.
* gm2/gm2-compiler/P2SymBuild.mod changed to allow nested varient records.
* gm2/gm2-compiler/SymbolTable.[def, mod] changes to varient record
representation. Fixed memory leak.
* gm2/gm2-compiler/gccgm2.def changed BuildOffset and added BuildOffset1
* gm2/ulm-lib-gm2/std/RTErrors.def changed parameter name to match
implementation module.
* gm2/ulm-lib-gm2/std/RTErrors.mod fixed pointer/integer constant type clash.
2005-04-11 Gaius Mulley <gaius@glam.ac.uk>
* fixed examples/executive
2005-03-24 Gaius Mulley <gaius@glam.ac.uk>
* included the keyword MODULE as an stop set element
in gm2m and gm2l.
2005-03-15 Gaius Mulley <gaius@glam.ac.uk>
* GM2 Release 0.44
* tagged CVS using gm2_0_44
2005-03-14 Gaius Mulley <gaius@glam.ac.uk>
* finished tools-src/createUlmSys which builds a SYSTEM.c
(from ./configure results) ULM library compatible interface.
* modified Make-lang.in to install the ULM libraries.
* added new switch -Wulm which modifies the default search
path so that the ULM libraries are included.
2005-01-05 Gaius Mulley <gaius@glam.ac.uk>
* fixed bug reported by john o goyo <jgoyo@ca.inter.net>.
(testsuite/gm2/pim/run/pass/Countdown.mod)
* for loops are now implemented as per ISO description.
GNU Modula-2 now calculates the last iteration value
before the start of a loop. It then initializes the
iteration value and works towards the final value,
rather than testing to see whether the iteration value
exceeds or preceeds the limit value (this fails when using
a CARDINAL iterator and stopping at 0).
* added a number of run tests to exercise these changes.

388
gcc/m2/ChangeLog-2006 Normal file
View File

@@ -0,0 +1,388 @@
2006-12-25 Gaius Mulley <gaius@gnu.org>
* gm2/Make-file.in: fixed conditional building of library files.
Bug reported by Michael Lambert <lambert@psc.edu>.
2006-12-21 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: fixed manual page installation.
* gm2/lang-options.h: include -Wlibs=min option.
* gm2/gm2-libs-min/libc.c: added parameters to functions.
* gm2/gm2-libs-min/libc.def: added.
2006-12-20 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-min: added
* gm2/gm2spec.c: modified to relect introduction of -Wlibs=min
* gm2/gm2.texi: document -Wlibs=min
* gm2/config-lang.in: include gm2cc to be installed
* GNU Modula-2 can be built as a cross compiler for the avr
microprocessor.
2006-12-18 Gaius Mulley <gaius@gnu.org>
* gm2/www/index.ms: updated web page to reflect G5 successful
make gm2.paranoid using gcc-3.3.6 and CVS
tag D2006.06.23.04.00.00
* gm2/gccgm2.c: use integer_type_node instead of boolean_type_node
as the size of boolean_type_node can differ from the
size of an integer_type_node.
* make gm2.paranoid works on LP64 opteron with a patched gcc-4.1.0
2006-12-17 Gaius Mulley <gaius@gnu.org>
* fixed line number debugging information at the end of a
function.
2006-12-05 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2Quads.mod: BuildCastFunction allow arrays
to be cast.
* testsuite/gm2/iso/stringchar.mod: fixed typos.
* gm2/gm2-compiler/M2Quads.mod: BuildDynamicArray,
BuildStaticArray, BuildDesignatorArray all SkipType to allow
type equivalence between arrays.
2006-11-02 Gaius Mulley <gaius@gnu.org>
* gm2/lang-specs.h: use gm2cc rather than the gcc driver.
* gm2/gm2-compiler/gm2lcc.mod: also use gm2cc rather
than gcc.
* gm2/gm2-compiler/gm2lcc.mod: corrected extern
declaration of exit.
* gm2/Make-lang.in: generate gm2cc from xgcc and install
it correcly.
* testsuite/gm2/pim/options/optimize/run/pass/gm2.exp: fixed
library module build.
2006-10-20 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: fixed building of constants strings.
Constants are also placed into the global scope so
that they are not garbage collected.
* gm2/M2GenGCC.mod: CodeXIndr handle special case of
null string.
* gm2/Make-lang.in: add automatically generated modules
to the verify12 rule.
* added a string assignment regression test.
2006-10-19 Gaius Mulley <gaius@gnu.org>
* www/index.ms: updated gm2-harness release to 0.96.
* gm2/gm2-compiler/SymbolConversion.mod: Poison must
not check for gcc poisoning as it is called after a
function has been emitted and potentially poisoned.
2006-10-18 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-config.in: added.
* gm2/Make-lang.in: include gm2/gm2-config.
* gm2/configure.in: generate gm2/gm2-config.
* backed out above changes
2006-10-17 Gaius Mulley <gaius@gnu.org>
* gm2/aclocal.m4: added.
* gm2/configure: rebuilt.
2006-10-14 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: minor fixes to build manual pages.
2006-10-13 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: call gimplify_function on all
functions.
* gm2/Make-lang.in: added ability to optionally build
the ulm libraries which matches gm2-harness-0.94.
2006-10-12 Gaius Mulley <gaius@gnu.org>
* gm2/patches/gcc/4.1.1/01.gaius_patch_gcc: added.
2006-10-07 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm.2c: fixed conditional goto expressions.
2006-10-04 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm.2c: added debugging stub.
2006-10-03 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: fixed BuildEnd
to use IsProcedureGccNested in CodeKillLocalVar.
* gm2/gm2-compiler/M2GCCDeclare.def:
export IsProcedureGccNested.
2006-10-01 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: modified BuildEnd
to taken an extra parameter, nested, and set it
accordingly.
2006-09-30 Waldek Hebisch <hebisch@math.uni.wroc.pl>
* gm2/gccgm2.c: (gccgm2_BuildEndFunctionCode) only
call gimplify_function_tree and cgraph_finalize_function
if the procedure is not nested.
2006-09-29 Gaius Mulley <gaius@gnu.org>
* removed execute permissions for source files.
* gm2/patches/gcc/4.1.0/01.gaius_patch_gcc: improved.
* gm2/gccgm2.c: fixed comment.
2006-09-20 Gaius Mulley <gaius@gnu.org>
* gm2/patches/4.1.0/01.gaius_patch_gcc: added.
2006-09-19 Gaius Mulley <gaius@gnu.org>
* huge amount of changes to bring gm2 up to gcc-4.1.0 and
also make it build with gcc-4.1.0.
* modified gm2/
Make-lang.in config-lang.in configure.in gccgm2.c
gm2-common.h gm2-lang.c gm2-lang.h gm2-tree.h gm2.texi
gm2builtins.c gm2spec.c lang-specs.h bnf/m2-3.bnf
examples/server/sckt.c examples/server/sckt.def
gm2-compiler/M2Comp.mod gm2-compiler/M2GCCDeclare.mod
gm2-compiler/M2GenGCC.mod gm2-compiler/M2Options.def
gm2-compiler/M2Options.mod gm2-compiler/M2Preprocess.mod
gm2-compiler/gccgm2.def gm2-compiler/gm2.mod
gm2-compiler/gm2lgen.mod gm2-libs/ASCII.def gm2-libs/ASCII.mod
gm2-libs/Args.def gm2-libs/Debug.def gm2-libs/IO.mod
gm2-libs/SYSTEM.mod gm2-libs/StdIO.mod gm2-libs/StrLib.mod
gm2-libs/StringConvert.def gm2-libs/libc.def
gm2-libs-coroutines/KeyBoardLEDs.c
gm2-libs-coroutines/Makefile gm2-libs-coroutines/SysVec.mod
gm2-libs-coroutines/TimerHandler.mod p2c/p2c.h
p2c/p2c-src/src/makeproto.c p2c/p2c-src/src/p2c-config.h
p2c/p2c-src/src/p2clib.c tools-src/mklink.c www/index.ms
* added files:
gm2/gm2-common.c gm2/gm2-tree.def gm2/lang.opt
2006-08-31 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs/ASCII.def: changed EOL to equal to nl rather
than cr.
2006-08-10 Gaius Mulley <gaius@gnu.org>
* fixed ASM statement.
* gm2/bnf/m2-3.bnf: fixed Pass3 and Pass2 const
* gm2/gccgm2.c: modified gccgm2_BuildAsm to use add_stmt
rather than expand_asm_expr.
2006-08-09 Gaius Mulley <gaius@gnu.org>
* GM2 Release 0.53
* changed release number in configure.in, gm2.texi, Make-lang.in
* builds with gcc-4.1.0
2006-08-08 Gaius Mulley <gaius@gnu.org>
* GM2 Release 0.52
* tagged CVS using gm2_0_52
* gm2/NEWS updated
* changed release number in configure.in, gm2.texi, Make-lang.in
* rebuilt configure
2006-08-07 Gaius Mulley <gaius@gnu.org>
* gm2/www/index.ms: updated to reflect release of gm2-harness-0.9
2006-06-23 Gaius Mulley <gaius@gnu.org>
* gm2/www/index.ms: updated to reflect release of gdb-6.5 which
contains enhanced Modula-2 language support. It also
documents that gm2-harness-0.8 has been released.
2006-05-22 Gaius Mulley <gaius@gnu.org>
* gm2/www/index.ms: updated to reflect sparc build success from
John O Goyo <jgoyo@ca.inter.net>
2006-05-04 Gaius Mulley <gaius@gnu.org>
* implemented __INLINE__
* gm2/gccgm2.c: modified to inline procedures if requested.
* gm2/m2.flex: added new keyword __INLINE__
* gm2/gm2-compiler/M2Reserved.def
* gm2/gm2-compiler/M2Reserved.mod: added new keyword __INLINE__
* gm2/gm2-compiler/P1SymBuild.mod: builds inlined procedure
* gm2/gm2-compiler/M2GenGCC.mod: passes front end inlined procedure
to gccgm2.
2006-04-24 Gaius Mulley <gaius@gnu.org>
* GM2 Release 0.51
* tagged CVS using gm2_0_51
* gm2/NEWS updated
* rebuilt configure
* finished implementing declaration of variables at addresses.
* modified gm2/bnf/m2-3.bnf, gm2/gm2-compiler/M2Quads,
gm2/gm2-compiler/SymbolTable.mod, gm2-compiler/P3SymBuild.mod
2006-04-22 Gaius Mulley <gaius@gnu.org>
* implemented the declaration of a variable at an address.
* modified gm2/bnf/m2-3.bnf, gm2/bnf/m2-2.bnf, gm2/gm2-compiler/M2Quads.mod
2006-04-21 Gaius Mulley <gaius@gnu.org>
* added testsuite/gm2/pim/pass/varaddress.mod
* modified gm2/bnf/m2.bnf, gm2/bnf/m2-2.bnf, gm2/bnf/m2-3.bnf,
gm2/bnf/m2-h.bnf to allow parsing of variables declared at addresses.
2006-04-19 Gaius Mulley <gaius@gnu.org>
* added testsuite/gm2/pim/pass/sets5.mod
* fixed bug report by John O Goyo <jgoyo@ca.inter.net>
* (testsuite/gm2/pim/pass/sets5.mod and testsuite/gm2/pim/pass/sets4.mod)
2006-04-19 Gaius Mulley <gaius@gnu.org>
* added testsuite/gm2/pim/pass/sets5.mod
* fixed bug report by John O Goyo <jgoyo@ca.inter.net>
* (testsuite/gm2/pim/pass/sets5.mod and testsuite/gm2/pim/pass/sets4.mod)
2006-03-25 Gaius Mulley <gaius@gnu.org>
* added testsuite/gm2/pim/pass/sets4.mod
* gm2/gm2-compiler/P2SymBuild.mod: added more robust error detection
* gm2/gm2-compiler/M2GenGCC.mod: added more robust error detection
2006-03-17 Gaius Mulley <gaius@gnu.org>
* added successful build reports to the web page
2006-02-21 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: fixed new urls and added missing escaped @
* gm2/gm2-libs.texi: rebuilt
* gm2/gm2-iso/README.texi: fixed typo
2006-02-20 Gaius Mulley <gaius@gnu.org>
* gm2/NEWS updated
2006-02-13 Gaius Mulley <gaius@gnu.org>
* GM2 Release 0.50
* tagged CVS using gm2_0_50
* gm2/NEWS: added, which contains news of user visible changes.
* gm2/Make-lang.in: updated version number
* gm2/gm2.texi: updated gm2 release number to 0.50 and gm2-harness number to 0.7
and improved install section.
* gm2/www: added homepage documents
2006-02-10 Gaius Mulley <gaius@gnu.org>
* gm2/ulm-lib-gm2/std/GetPass.mod: modified to work with:
* gm2/ulm-lib-gm2/sys/termios.def: new definition module for C
* gm2/ulm-lib-gm2/sys/termios.c: portable implmentation module for termios
interface
* gm2/ulm-lib-gm2/sys/SysTermIO.def: Modula-2 interface to the underlying
termios library.
* gm2/ulm-lib-gm2/sys/SysTermIO.mod: Modula-2 interface to termios.c.
* all regression tests pass on LP64
2006-02-07 Gaius Mulley <gaius@gnu.org>
* fixed copyright notices for all ISO definition modules in
gm2/gm2-iso.
2006-01-23 Gaius Mulley <gaius@glam.ac.uk>
* gm2/gm2-compiler/M2Options.mod: allow -p option.
* gm2/gm2-compiler/M2Quads.mod: remove call to stress stack during
Initialization
2006-01-17 Michael H Lambert <lambert@psc.edu>
* testsuite/gm2/iso/pass/realbitscast.mod: modified to detect whether
it is being run under alpha and 64 bit architecture.
* testsuite/gm2/cpp/pass/subaddr.mod: modified to detect whether
it is being run under alpha and 64 bit architecture.
2006-01-17 Gaius Mulley <gaius@glam.ac.uk>
* gm2/gm2-compiler/M2GenGCC.mod: coerse constants passed to parameter
of SYSTEM types. Fixes the make gm2.paranoid on ppc architecture.
* testsuite/gm2/iso/pass/realbitscast.mod: modified to detect whether
it is being run under ia64 architecture.
* testsuite/gm2/cpp/pass/subaddr.mod: modified to detect whether
it is being run under ia64 architecture.
2006-01-16 Gaius Mulley <gaius@glam.ac.uk>
* gm2/gccgm2.c: altered INCL, EXCL and bit tests so that they subtract the
low value of the subrange before performing the bit operation.
* testsuite/gm2/pim/run/pass/setcritical.mod to test bugfix.
* gm2/gm2-compiler/gm2lcc.mod: added -B option
* gm2/lang-specs.h: pass -B option to gm2lcc
2006-01-10 Gaius Mulley <gaius@glam.ac.uk>
* fixed INTEGER, SHORTINT and LONGINT so that they all
call upon gccgm2_GetM2<type> rather than their C counterparts.
* fixed constant overflow on 32 bit address architectures when
compiling arrayhuge.mod and arrayhuge2.mod (as reported by
Michael H Lambert <lambert@psc.edu>)
* M2Code.mod::Code: call FlushWarnings and FlushErrors after StartDeclareScope
which flushes errors before code generation starts. This fixes
a timeout bug in the regression tests reported by
(John B Wallace Jr <wallacjb@enter.net>).
* M2GenGCC.mod::CodeSavePriority: introduced PriorityDebugging and turned
off debugging messages
* M2GenGCC.mod::CodeRestorePriority: introduced PriorityDebugging and turned
off debugging messages
* all regression tests now pass on GNU/Linux i386 (Debian Sarge)
* gm2/gm2-compiler/M2Quads.mod::LoopAnalysis:fixed bug in while loop
* corrected testsuite/gm2/errors/fail/testimport.mod to include a double import.
2006-01-09 Gaius Mulley <gaius@glam.ac.uk>
* fixed LONGINT/LONGCARD bugs so that
testsuite/gm2/switches/pim4/run/pass/FpuIOBug.mod now passes.
LONGINT and LONGCARD are declared as long long int and
long long unsigned int respectively.
* updated gm2/gm2.texi to reflect changes in LONGINT and LONGCARD.
2006-01-08 Gaius Mulley <gaius@glam.ac.uk>
* modified examples to utilize the module priority mechanism.
2006-01-06 Gaius Mulley <gaius@glam.ac.uk>
* improved implementation of module priorities so that
only externally accessible procedures save and restore
interrupts.
* added testsuite/gm2/pimlib/coroutines/pass/priority3.mod and
testsuite/gm2/pimlib/coroutines/pass/priority3.def to test exporting
of procedures which need to save and restore interrupt priorities.
2006-01-05 Gaius Mulley <gaius@glam.ac.uk>
* gm2/Make-lang.in: removed GM2_DIRS from the dependancies of
various rules, which in turn removed a number of "build loops"
* gm2/config-lang.in: removed reference to gm2/p2c/p2c-src/examples/Makefile
2006-01-04 Gaius Mulley <gaius@glam.ac.uk>
* implemented module priorities.
* implemented gm2/gm2-libs-pim/TimeDate.mod
* added testsuite/gm2/pimlib/coroutines/pass/priority.mod,
testsuite/gm2/pimlib/coroutines/pass/priority2.mod and
testsuite/gm2/pimlib/logitech/run/pass/timedate.mod
* included TimeDate to be installed as part of the pim
libraries.
2006-01-03 Michael H Lambert <lambert@psc.edu>
* fixed typo in gm2/gm2.texi
* added __ppc__ ifdefs into testsuite/gm2/iso/pass/realbitscast.mod
so that it ignores the REAL96 test on the G5
* added __ppc__ ifdefs into testsuite/gm2/switches/pim4/run/pass/FpuIOBug.mod

378
gcc/m2/ChangeLog-2007 Normal file
View File

@@ -0,0 +1,378 @@
2007-12-10 Gaius Mulley <gaius@gnu.org>
* gm2/NEWS: updated.
* gm2/tools-src/def2texi.py: modified so that references
to types, variables and constants are added to the index
at the end of the documentation.
* gm2-libs-pim/RealInOut.def: all long procedures are also
exported.
2007-12-07 Gaius Mulley <gaius@gnu.org>
* gm2/NEWS: updated.
* gm2/gm2.texi: documented new -fxcode option and minor
fixes.
* gm2/lang-options.h: added -fxcode to list of options.
* gm2/lang.opt: added -fxcode to list of options.
* gm2/m2.flex: added m2flex_GetColumnNo.
* gm2/gm2-compiler/M2Error.mod: OutString modified to
use column and produce GNU and Xcode format errors.
* gm2/gm2-compiler/M2LexBuf.def: export column
related procedures.
* gm2/gm2-compiler/M2LexBuf.mod: introduced recording
of the column position. GetColumnNo, TokenToColumnNo
new procedures.
* gm2/gm2-compiler/M2Options.def: added Xcode.
* gm2/gm2-compiler/M2Options.mod: set Xcode accordingly.
* gm2/gm2/gm2-compiler/M2Students.mod: fixed spelling
mistake.
* gm2/gm2-compiler/P1SymBuild.mod: tidied up error
message.
* gm2/gm2-compiler/SymbolTable.mod: ditto.
* gm2/gm2-compiler/m2flex.def: added GetColumnNo
procedure.
* gm2/gm2-libs-pim/BitBlockOps.mod: intemediate checkin.
2007-12-06 Gaius Mulley <gaius@gnu.org>
* gm2/tools-src/gensum.py: new file.
2007-11-14 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: corrected urls and last edit.
* gm2/gm2-libs.texi: recreated.
2007-11-10 Gaius Mulley <gaius@gnu.org>
* gm2/m2.flex: added explicit cast.
* gm2/Make-lang.in: now build h2def during stage2.
* gm2/gm2/c.flex: modified so that it ignores tabs.
* gm2/bnf/h2def.bnf: many bugfixes, still broken though.
* gm2/gm2-compiler/CLexBuf.mod: improved Debugging support.
* gm2/gm2-compiler/gm2lcc.mod: refactored comment handling
code to use the RemoveComment, RemoveWhiteSuffix and
RemoveWhitePrefix procedures in DynamicStrings module.
* gm2/gm2-compiler/gm2lgen.mod: likewise handle comments.
* gm2/gm2-libs/DynamicStrings.def: export
RemoveWhitePrefix, RemoveWhitePostfix, RemoveComment.
* gm2/gm2-libs/DynamicStrings.mod: implement above.
2007-11-07 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: updated version to 0.63
* gm2/gm2.texi: updated version to 0.63 and updated
unbounded-by-reference documentation.
* gm2/gm2-compiler/M2GenGCC.mod: modified optimization
of unbounded addresses to test the memory range of
each unbounded parameter against a type compatible
var parameter, any overlapping addresses results in
a alloca and memcpy of the non var unbounded array.
2007-11-02 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: completed the further
optimization of unbounded addresses. It checks to
see if the contents of a type compatible unbounded
ARRAY matches the contents of a VAR parameter.
It checks against any VAR parameter (not just
unbounded VAR parameters - consider ARRAY OF BYTE).
* gm2/gm2.texi: documented the implementation of
the -funbounded-by-reference optimization flag
giving examples.
2007-10-30 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: fixed @xref punctuation requirement.
* gm2/gm2-compiler/M2GenGCC.mod: fixed unbounded-by-reference
so that it works out whether two parameters might contain
the same contents. Further optimization is possible via
runtime checking of unbounded addresses.
* gm2/gm2-compiler/SymbolTable.mod: factored out some code.
2007-10-26 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs/sckt.def: moved here from examples/server.
* gm2/gm2-libs-ch/sckt.c: moved here from examples/server.
* gm2/examples/ncurses/Makefile: changed switches from -W
to -f
* gm2/gm2-libs-coroutines/Makefile: changed switches from -W
to -f
* gm2/gm2-libs-coroutines/SysVec.mod: added many Asserts and
fixed some bugs relating to microseconds.
* gm2/gm2-libs-coroutines/TimerHandler.mod: fixed bug relating
to time vector.
2007-10-25 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: CHAR is now declared as an unsigned char.
* testsuite/gm2/pimlib/logitech/run/pass/bbits.mod: new file.
* testsuite/gm2/pimlib/logitech/run/pass/intb.mod: new file.
2007-10-23 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: more building documentation fixes.
* gm2/www/index.ms: updated documentation to reflect
changes to the gm2.texi building instructions.
2007-10-22 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-pim/BitBlockOps.{def,mod}: added.
* gm2/Make-lang.in: added BitBlockOps to the Logitech list
of modules.
* gm2/gm2.texi: improved building documentation which now
relates to the daily CVS snapshot held on
http://floppsie.comp.glam.ac.uk/download/c
2007-10-18 Gaius Mulley <gaius@gnu.org>
* gm2/www/index.ms: rationalised the building instructions
between the web page and gm2/gm2.texi
* gm2/gm2.texi: updated the building instructions.
2007-10-14 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: fixed bug in gm2/gm2-libs/gm2-libs-host.h
target so that configure uses the correct CC and CPP.
2007-10-09 Gaius Mulley <gaius@gnu.org>
* gm2/README: updated to reflect new homepage and mailing
list address.
2007-10-07 Gaius Mulley <gaius@gnu.org>
* fixed bug reported by Dmitry Shatrov <shatrov@gmail.com>
* gm2/gm2-compiler/M2Quads.mod: added CheckNotConstAndVar
procedure. BuildAssignment use CheckNotConstAndVar.
* gm2/testsuite/gm2/pim/fail/constvar.mod: added new
regression test.
* gm2/gm2.texi: updated the last update field.
2007-10-05 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: updated version to 0.62
* gm2/Make-lang.in: altered all -W options to their new
-f counterparts
* gm2/README: modified the advised build command
* gm2/gccgm2.c: removed all section of code inside #if 0
blocks (which were not part of the orig gcc source).
* gm2/gccgm2.c: modified OPT_W to OPT_f to reflect change
of -W flags to -f flags.
* gm2/gccgm2.c: reintroduced the -fcpp handling code.
* gm2/gm2.texi: updated version number to 0.62
* gm2/gm2.texi: altered all -W options to -f options
for code generation options. Left warning options
to use -W to mirror the gcc paradigm.
* gm2/gm2/gm2builtins.c: memmove introduced.
* gm2/gm2spec.c: changed all -W options to -f.
* gm2/lang-specs.h: changed all -W options to -f.
* gm2/lang.opt: changed all -W options to -f.
* gm2/bnf/gm2l.bnf: changed all -W options to -f.
* gm2/bnf/gm2m.bnf: changed all -W options to -f.
* gm2/gm2-libs-pim/BlockOps.{def,mod}: added to repository.
* gm2/examples/map/Makefile: changed all -W options to -f and
added -O3.
* gm2/gm2/gm2-compiler/M2Options.def: changed comments.
* gm2/gm2-compiler/M2Options.mod: changed all -W options to -f.
* gm2/gm2-compiler/M2Quads.mod: changed all -W options to -f.
* gm2/gm2-compiler/SymbolTable.mod: changed all -W options to -f.
* gm2/gm2-compiler/gm2.mod: changed all -W options to -f.
* gm2/gm2-compiler/gm2lcc.mod: changed all -W options to -f.
* gm2/gm2/gm2-compiler/ppg.mod: modified compile-command.
* gm2/gm2-libs/Builtins.def: added memmove to the list of
builtins.
* gm2/gm2-libs/Builtins.mod: implemented M2 wrapper for memmove.
* gm2/gm2-libs/cbuiltin.def: added access to C memmove.
* gm2/man/gm2.man: changed all -W options to -f.
2007-09-27 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs/SYSTEM.mod: added SHIFT, ROTATE and their
support counterparts.
* gm2/gm2-libs-pim/BitByteOps.{def,mod}: added.
* gm2/gm2-libs-pim/BitWordOps.{def,mod}: completed.
* gm2/gm2.texi: updated to reflect the addition of SHIFT,
ROTATE procedures in PIM SYSTEM.mod.
* gm2/gm2/Make-lang.in:
* gm2/gm2/README:
* gm2/gm2/gccgm2.c:
* gm2/gm2/gm2.texi:
* gm2/gm2/gm2spec.c:
* gm2/gm2/lang-options.h:
* gm2/gm2/lang-specs.h:
* gm2/gm2/lang.opt:
* gm2/gm2/bnf/gm2l.bnf:
* gm2/gm2/bnf/gm2m.bnf:
* gm2/gm2/gm2-compiler/M2Options.def:
* gm2/gm2/gm2-compiler/M2Options.mod:
* gm2/gm2/gm2-compiler/M2Quads.mod:
* gm2/gm2/gm2-compiler/SymbolTable.mod:
* gm2/gm2/gm2-compiler/gm2.mod:
* gm2/gm2/gm2-compiler/gm2lcc.mod:
* gm2/gm2/gm2-compiler/ppg.mod: all changed to reflect moving
-W switches to -f switches as per gcc. Only using -W for
compile time warnings, -f for language features including
runtime checking.
2007-09-14 Gaius Mulley <gaius@gnu.org>
* www/index.ms: updated web pages to reflect 0.60 release
and availability of debian packages.
2007-08-14 Gaius Mulley <gaius@gnu.org>
* gm2/patches/gcc/4.1.2/02.gaius_rs6000_lang: new patch to
enable gm2 to build on the PS3 (ppc) based machines.
2007-08-08 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: fixes to enable avr cross compile to
build (use cross gcc and add -B./ when building libraries).
2007-07-23 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: gccgm2_BuildSubrangeType switched over to using
the implementation of the subrange type as opposed to the base
INTEGER type.
* gm2/gm2-compiler/M2Quads.mod: CheckSubrange converts the
Exp into an INTEGER type before generating the range checking
quadruples. This in turn allows M2SubExp.mod to be built with
optimization. make gm2.paranoid with -O works against gcc-4.1.2.
2007-07-06 Gaius Mulley <gaius@gnu.org>
* added gm2/gm2-harness.
* gm2/Make-lang.in: added interactive debugging module
gm2/m2pp.o to link targets.
* gm2/gccgm2.c: rewritten pushdecl and friends and vastly
simplified and reduced the code. Modified all parameters
to use ANSI C rather than K&R C. Rewritten create
gccgm2_BuildStartFunctionCode and gccgm2_BuildEndFunctionCode.
Also ensured that all variables are added to the statement list
via DECL_EXPR and ensured that BIND_EXPR and BLOCKs are created
in exactly the same way as their C counterparts.
Fixed important bug in creating TREEs which represent parameters.
* gm2/m2pp.c: new interactive debugging module will print a GCC
tree using Modula-2 syntax.
* gm2/m2pp.h: prototype for the above.
* gm2/gm2-compiler/M2GCCDeclare.mod: unbounded types are now uniquely
created from their basic type. Improved debugging of unbounded type.
* gm2/gm2-compiler/M2GenGCC.mod: DoCopyString new function which is
used by CodeBecomes and CodeXIndr. Simplified CodeIndrX and CodeXIndr
in light of bugs fixed in gm2/gccgm2.c.
* gm2/gm2-compiler/M2Quads.mod: made the type following more accurate
during the construction of array arithmetic and indirection. This
in turn allows -O to be used in GCC's backend.
* gm2/gm2-compiler/SymbolTable.def: modified interface to unbounded
symbols.
* gm2/gm2-compiler/SymbolTable.def: implemented above.
* GM2 now builds when -O is suppled to stage2 or stage3.
* GM2 now builds with (a patched) gcc-4.1.2
2007-05-28 Gaius Mulley <gaius@gnu.org>
* gm2-compiler/M2Quads.mod: replaced PutVarTypeAndSize with
PutLeftValueFrontBackType.
* gm2-compiler/SymbolTable.mod: implemented
PutLeftValueFrontBackType and GetLeftValueFrontBackType.
* gm2/gm2-compiler/M2GCCDeclare.mod: rationalised variable
creation by introducing function: DoVariableDeclaration.
All variables are created via this function.
Use GetLeftValueFrontBackType.
2007-05-18 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: removed -O for paranoid
2007-05-11 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: added -O for paranoid
* gm2/gccgm2.c:
* gm2/gm2-compiler/M2Base.def: removed generic Unbounded type
* gm2/gm2-compiler/M2Base.mod: removed generic Unbounded type
creation.
* gm2/gm2-compiler/M2Code.mod: tidied up comments and semicolon.
* gm2/gm2-compiler/M2GCCDeclare.def: export DeclareParameters.
* gm2/gm2-compiler/M2GCCDeclare.mod: implement
DeclareParameters and new unbounded type mechanism.
* gm2/gm2-compiler/M2GenGCC.mod: modified references
to unbounded fields. Fixed two major optimization bugs
in CodeXIndr and CodeIndrX pointer types
now use generic pointer types when building indirect GCC
trees.
* gm2/gm2-compiler/M2Quads: now create a specific unbounded type
rather than cast to a generic unbounded record. Again this fixes
bugs in Tree construction which were exposed by the back end
when -O was enabled.
* gm2/gm2-compiler/SymbolTable.def: declared Unbounded record and
field operators.
* gm2/gm2-compiler/SymbolTable.mod: implement Unbounded record and
field operators.
2007-04-25 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs: regenerated configure
2007-02-16 Gaius Mulley <gaius@gnu.org>
* gm2/bnf/gm2m.bnf: fixed string deallocation bug.
* gm2/gm2-libs-pim/FileSystem.{def,mod}: exported Reset
and fixed filename and string conversion.
2007-02-07 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GCCDeclare.mod: added FindOuterModule
to determine whether a symbol should be declared in the
GCC global scope.
* fixes ulm library building problem introduced by the previous
interim checkin.
2007-02-06 Gaius Mulley <gaius@gnu.org>
* interim checkin, due to optimization fixes.
* gm2/gccgm2.c: changes to the way variables are declared.
Removed calls to expand_decl.
* gm2-compiler/M2GCCDeclare.mod: passes boolean to
DeclareKnownVariable indicating whether the variable was
declared in the outer global scope.
2007-01-26 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: mark_function_addresses_referenced added.
* gm2/gccgm2.c: gccgm2_MarkFunctionReferenced added.
* gm2/gccgm2.c: gccgm2_SetFlagUnitAtATime added.
* gm2/gm2-compiler/M2Code.mod: MarkExported used.
* gm2-compiler/M2GCCDeclare.def: MakeExported defined.
* gm2-compiler/M2GCCDeclare.mod: MakeExported added.
* gm2/gm2-compiler/gccgm2.def: SetFlagUnitAtATime,
MarkFunctionReferenced, defined.
2007-01-19 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-pim/FileSystem.mod: added.
* gm2/Make-lang.in: introduced GM2_O_S3 variable so that
optimization can be introduced into stage3 only.
* gm2/gccgm2.c: added gccgm2_FinishBackend.
* gm2/gm2-compiler/M2Code.mod: use gccgm2_FinishBackend.
2007-01-18 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: use gm2_mark_addressable rather than
the TREE_ADDRESSABLE macro for consistency.
2007-01-05 Gaius Mulley <gaius@gnu.org>
* gm2/Make-file.in: added FileSystem.mod to the gm2-libs-pim
set of libraries.
* gm2/TODO: removed FileSystem.mod from the list
* gm2/gm2-compiler/P1SymBuild.mod: added error message
* gm2/gm2-libs/FIO.mod: fixed copyright message
* gm2/gm2-libs/M2RTS.def: fixed typo.
* gm2/gm2-libs/libc.def: added rename function.
* gm2/gm2-libs/wrapc.def: modified filesize so that it modifies
two unsigned ints as the size, rather than return a long unsigned.
* gm2/gm2/gm2-libs-ch/libc.c: added unlink function.
* gm2/gm2/gm2-libs-ch/wrapc.c: implemented filesize.
* gm2/gm2/gm2-libs-pim/FileSystem.def: improved comments and added
more file state to the File record.

1994
gcc/m2/ChangeLog-2008 Normal file

File diff suppressed because it is too large Load Diff

1720
gcc/m2/ChangeLog-2009 Normal file

File diff suppressed because it is too large Load Diff

3680
gcc/m2/ChangeLog-2010 Normal file

File diff suppressed because it is too large Load Diff

493
gcc/m2/ChangeLog-2011 Normal file
View File

@@ -0,0 +1,493 @@
2011-12-01 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: added ServerSocket.mod to be compiled and
installed in the iso library.
* gm2/gm2-libs-iso/ServerSocket.c: added dummy return value so
that this incomplete module compiles.
2011-11-30 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/SymbolTable.mod: fixed a poor error message
bug reported by <doug@dougtelford.com>. Arrays are now checked
for a correct subscript type before M2GCCDeclare is called.
2011-11-18 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2Range.mod: removed calls to FlushErrors
to allow the compiler to issue many more error messages before
exiting.
2011-11-16 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2CaseList.def: add TypeCaseBounds to the
definition module.
* gm2/gm2-compiler/M2CaseList.mod: GetVariantTagType, checkTypes,
inRange, TypeCaseBounds (New procedure functions). Check to
see that case bounds are of the correct type.
* gm2/gm2-compiler/M2MetaError.mod: fix internal error message.
* gm2/gm2-compiler/M2Options.def: new boolean VariantValueChecking
which is set if -fiso is used. FinaliseOptions new procedure.
* gm2/gm2-compiler/M2Quads.mod: reverse PopT(r1) and PopT(r2)
to correct range bug.
* gm2/gm2-compiler/M2Range.mod: only check missing values
in variant record case bounds if VariantValueChecking is enabled.
We always check for overlapping bounds.
* testsuite/gm2/pim/fail/variant.mod: new file.
* testsuite/gm2/pim/fail/variant2.mod: new file.
* testsuite/gm2/pim/fail/variant3.mod: new file.
2011-11-08 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: altered bnf rules to depend upon
gm2/pge$(exeext).
* gm2/bnf/m2-c.bnf: reimplemented Qualident and PushQualident
to fix a bug reported by Alexandr Simon:
<http://lists.gnu.org/archive/html/gm2/2011-04/msg00002.html>
2011-11-07 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: BuildCall2, BuildCall3 (New functions).
* gm2/gm2.texi: document the new command line switch
-fdebug-builtins.
* gm2/lang.opt: define -fdebug-builtins.
* gm2/gm2-compiler/M2Base.mod: InitBuiltins (New procedure).
* gm2/gm2-compiler/M2Batch.def: Tidied up spacing.
* gm2/gm2-compiler/M2GenGCC.mod: implemented MaybeDebugBuiltinAlloca,
MaybeDebugBuiltinMemcpy and call then instead of BuiltinAlloca,
BuiltinMemcpy. Modified CanUseBuiltin to return FALSE if
DebugBuiltins is TRUE.
* gm2/gm2-compiler/M2Options.def: DebugBuiltins new boolean flag.
* gm2/gm2-compiler/M2Options.mod: set DebugBuiltins if -fdebug-builtins
is present.
* gm2/gm2-compiler/gccgm2.def: define BuildCall2, BuildCall3.
* gm2/gm2-libs/Builtins.def: alloca_trace (New procedure function).
* gm2/gm2-libs/Builtins.mod: tidied up comment and implemented
alloca_trace.
* gm2/gm2-compiler/M2GenGCC.mod: fixed GetSizeOfHighFromUnbounded
bug reported by John O Goyo
<http://lists.gnu.org/archive/html/gm2/2011-11/msg00004.html>
and Martin Kalbfuß
<http://lists.gnu.org/archive/html/gm2/2011-10/msg00023.html>.
2011-10-29 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: gccgm2_BuildAddr call gm2_mark_addressable.
* gm2/gccgm2.c: gccgm2_BuildComponentRef, convertToSizeT
(New functions).
* gm2/gm2builtins.c: gm2builtins_BuiltInAlloca call convertToSizeT.
* gm2/gm2-compiler/M2GenGCC.mod: use gccgm2_BuildComponentRef
to access high and address fields within unbounded records.
This fixes a bug reported by Scott Iverson which has been
expressed as testsuite/gm2/pim/run/pass/passparam.mod and
testsuite/gm2/pim/run/pass/passparam2.mod. Manifested
itself when attempting to take the address of a parameter.
This does not work with -O2 as parameters are passed in
registers on some architectures (x86_64). These changes
introduce no new regression test failures.
2011-10-26 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: added LMathLib0.def LegacyReal.def
MemUtils.def to the list of GM2-LIBS-DEFS and
LMathLib0.mod LegacyReal.mod MemUtils.mod to
GM2-LIBS-MODS. This corrects a bug reported by
Steve Giess.
2011-10-25 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GCCDeclare.mod: added debugging
and also fixed a bug reported by Scott Iverson.
(non-free/scott-iverson/test25/fail/WinShell.mod).
* gm2/gm2-compiler/M2Quads.mod: added error checking
to detect a nul typed constructor.
* gm2/gm2-compiler/Sets.mod: added internal debugging.
2011-10-04 Gaius Mulley <gaius@gnu.org>
* gm2/version.c: updated to 1.0.5
* gm2/gm2-libs/config-host.in: updated to 1.0.5.
* gm2/gm2-libs/config-target.in: updated to 1.0.5
2011-10-02 Gaius Mulley <gaius@gnu.org>
* tagged GM2 gcc_4_1_2_gm2_1_0_4_0 post checkin.
2011-09-30 Gaius Mulley <gaius@gnu.org>
* released GM2 1.0.4
* tagged with: gcc_4_1_2_gm2_1_0_4 prior checkin.
* gm2/version.c: updated to 1.0.4
* gm2/gm2-libs/config-host: rebuilt.
* gm2/gm2-libs/config-host.in: updated to 1.0.4.
* gm2/gm2-libs/config-target: rebuilt.
* gm2/gm2-libs/config-target.in: updated to 1.0.4
2011-07-28 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: add dependencies for the constuction of
gm2/gm2-libs.texi.
2011-07-27 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2Base.mod: allow a dataType to be
passed to ARRAY OF dataType. Bug fix for:
testsuite/gm2/pim/pass/charstring.mod.
* gm2/version.c: updated to 1.0.3
* gm2/gm2-libs/config-host: rebuilt.
* gm2/gm2-libs/config-host.in: updated to 1.0.3.
* gm2/gm2-libs/config-target: rebuilt.
* gm2/gm2-libs/config-target.in: updated to 1.0.3.
2011-07-26 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2ALU.mod: allow constant array strings
to be created with const chars. Bug fix for:
testsuite/gm2/iso/pass/constchar.mod.
* gm2/gm2-compiler/M2ALU.mod: fixed obvious bugs to previous
patch.
2011-07-25 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: corrected typo in the documentation.
2011-07-15 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-iso/StdChans.mod: allow raw operators on
stdin, stdout and stderr. Bug fix to an error reported
by Scott Iverson
(http://lists.gnu.org/archive/html/gm2/2011-07/msg00003.html).
2011-07-07 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: improved the Extended Asm section and changed
the example for the x86_64 processor.
2011-07-05 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: BuildAsm now has an extra parameter (isSimple).
Also call resolve_asm_operand_names.
* gm2/bnf/m2-2.bnf: parse full GNU asm syntax (including
operand names).
* gm2/bnf/m2-3.bnf: implement full GNU asm syntax (including
operand names). Record all asm operand names, specifiers
and trash lists. Also record whether it was a simple kind.
* gm2/bnf/m2-c.bnf: parse full GNU asm syntax (including
operand names).
* gm2/bnf/m2-h.bnf: parse full GNU asm syntax (including
operand names).
* gm2/bnf/m2.bnf: parse full GNU asm syntax (including
operand names).
* gm2/gm2-compiler/M2GenGCC.mod: correct generation of
input, output and trash values for the asm operands.
* gm2/gm2-compiler/SymbolTable.def: New procedures
(PutGnuAsmSimple) and (IsGnuAsmSimple). Added extra
parameter to (GetRegInterface).
* gm2/gm2-compiler/SymbolTable.mod: Implemented new procedures
(PutGnuAsmSimple) and (IsGnuAsmSimple). Added extra
parameter to (GetRegInterface) to correct a bug.
* gm2/gm2-compiler/gccgm2.def: modified declaration of
(BuildAsm) to include an extra parameter, IsSimple.
* These fixes allow GNU ASM syntax to behave in exactly
the same way as the other GCC front ends.
2011-07-01 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: modified gccgm2_ChainOnParamValue to contain a
name, str and value.
* gm2/bnf/m2-3.bnf: many fixes in AsmList, AsmOperands, TrashList
with respect to interface sym and gnuasm sym.
* gm2/gm2-compiler/M2GenGCC.mod: call BuildTreeFromInterface
instead of BuildTrashTreeFromInterface.
* gm2/gm2-compiler/SymbolTable.def: fix GetRegInterface so that
NulSym are returned in string and object if i exceeds number of
parameters.
* gm2/gm2-compiler/gccgm2.def: changed definition of
ChainOnParamValue.
2011-06-29 Gaius Mulley <gaius@gnu.org>
* gm2/bnf/m2-3.bnf: maintain a count of the number of asm operands
in both the AsmElement and TrashList.
* gm2/gm2-compiler/SymbolTable.def: PutRegInterface, GetRegInterface
now specify which parameter number they are manipulating.
* gm2/gm2-compiler/SymbolTable.def: modified the implementation of
PutRegInterface, GetRegInterface to use dynamic array Indexing rather
than the List.
2011-06-28 Gaius Mulley <gaius@gnu.org>
* gm2/gm2spec.c: modified default libraries to iso,pim if -fiso is
used. Fixes a bug reported by Scott Iverson
(http://lists.gnu.org/archive/html/gm2/2011-06/msg00026.html).
2011-06-22 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: specify source and build directories to def2texi.py.
* gm2/gm2.texi: modified to document the new behaviour of specifying
library ordering.
* gm2/gm2spec.c: default library is 'pim'. Large number of changes
which remove the implicit ordering of library search paths in favour
of users specifying the explicit order via -flibs=pim,iso,ulm etc.
* gm2/lang.opt: -flibs= takes a number of Joined arguments.
* gm2/examples/hello/Makefile.in: removed -fno-exceptions from the
command line build.
* fixes a bug reported by Scott Iverson
(http://lists.gnu.org/archive/html/gm2/2011-06/msg00002.html).
* gm2/gm2-libs-iso/README.texi: corrected status of copyright and
implementation modules. Removed all information about incomplete
modules.
* gm2/tools-src/def2texi.py: fixed bug in building the www pages
by adding an option to specify the build and source directory.
2011-06-15 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/PCSymBuild.mod: fixed bug in deduceTypes
so that binary constant expressions can correctly identify
their types. Fixes a bug report by Scott Iverson.
2011-06-13 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: gccgm2_GetArrayNoOfElements (New function).
* gm2/gm2-compiler/M2GenGCC.mod: checkArrayElements (New
procedure function). CodeBecomes modified to call
checkArrayElements to test whether assigned arrays contain
the same number of elements.
* gm2/gm2-compiler/M2Quads.mod: CheckBecomesMeta tidied up
error messages and added extra check to ensure that
we are not assigning from an unbounded array.
* gm2/gccgm2.def: export GetArrayNoOfElements.
Fixes a bug reported by Scott Iverson.
2011-06-11 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2ALU.mod: added a limit check to SetNegate
which fixes a bug reported by Scott Iverson
(http://lists.gnu.org/archive/html/gm2/2011-06/msg00001.html).
2011-06-10 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2Quads.mod: modified CheckNotConstAndVar
to CheckBecomesMeta so that it also checks that we are
not assigning to a unbounded array. Fixes a bug reported
by Scott Iverson
(http://lists.gnu.org/archive/html/gm2/2011-06/msg00010.html).
2011-05-04 Gaius Mulley <gaius@gnu.org>
* gm2: tagged with gcc_4_1_2_0
* gm2: created branch using "cvs tag -r gcc_4_1_2_0 -b gcc_4_1_2_gm2"
* testsuite: tagged with gcc_4_1_2_0
* testsuite: created branch using "cvs tag -r gcc_4_1_2_0 -b gcc_4_1_2_gm2"
2011-04-27 Gaius Mulley <gaius@gnu.org>
* patches/gcc/4.1.2/01-patches: corrected bug in patch.
* gm2/gm2-compiler/M2Quads.mod: fixed bug reported by
John O Goyo
(http://lists.nongnu.org/archive/html/gm2/2011-04/msg00031.html).
2011-04-22 Gaius Mulley <gaius@gnu.org>
* patches/gcc/4.1.2/ChangeLog: New file.
* patches/gcc/4.1.2/01-patches: New file.
These patches have been regenerated and rationalised. They
have also been regression tested against the C and C++
regression tests. Both these sets of regression tests are
unaffected by these patches.
2011-04-09 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: modified to build O2 versions of gm2-libs-min.
2011-04-06 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: modified to allow gm2 to coexist with
gcc as the linker support rather than g++. Useful for
embedded targets which don't yet support g++. Separated
target from host when building libraries and use separate
configure scripts for both.
* gm2/README: removed warning about development code.
* gm2/config-lang.in: added gm2lorder.
* gm2/gm2.texi: updated documentation to reflect release 1.0.
Corrected statements such as GNU Modula-2 is fully ISO
compliant.
* gm2/gm2spec.c: only include -lstdc++ if -fno-exceptions is
not present.
* gm2/gm2-libs/README.texi: tidied up dates.
* gm2/gm2-libs-iso/README.texi: corrected status of modules
given release of 1.0.
* gm2/gm2-libs-iso/Strings.mod: fixed performance bug reported
by Scott Iverson
(http://lists.nongnu.org/archive/html/gm2/2011-03/msg00035.html).
* gm2/p2c/p2c.h: test BUILD_GM2_LIBS_TARGET and include appropriate
configure header.
* gm2/tools-src/makeversion: added another consistency test.
* gm2/gm2-libs/config-host.in: new file.
* gm2/gm2-libs/config-target.in: new file.
* gm2/gm2-libs/configure: removed.
* gm2/gm2-libs/configure.in: removed.
* gm2/gm2-libs/config-host: new file.
* gm2/gm2-libs/config-target: new file.
* gm2/gm2-libs/gm2-libs-target.h.in: new file.
2011-02-24 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: changed lenny to squeeze in repository
definitions.
2011-02-23 Gaius Mulley <gaius@gnu.org>
* gm2/www/tools/texi2tr/src/texi2tr.py: implemented
section alphabetically sorted index. Also implemented
@ifhtml.
2011-02-22 Gaius Mulley <gaius@gnu.org>
* www/tools/texi2tr/src/outputdev.py: added no_tag so
table elements can easily be added - fixes a bug
with enumerate.
* gm2/www/tools/texi2tr/src/texi2tr.py: fixed pushSpecifier
and fixed 'enum' with 'enumerate'. Enumerations work
for integer and alphabetical values.
2011-02-19 Gaius Mulley <gaius@gnu.org>
* gm2/gm2spec.c: ensure that the prev
value is reset before each include path is added.
* gm2/examples/gravity/Makefile.in: changed python version
and fixed exec prefix.
2011-02-18 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: changed node About to Overview.
* gm2/www/tools/texi2tr/src: added function index.
2011-02-17 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: many bug fixes to nodes.
* gm2/www/tools/texi2tr: added html, png subdirs.
* gm2/www/tools/texi2tr/src: many bug fixes applied.
2011-02-15 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: incorporated the contents of the
web page gm2/www/index.ms into gm2.texi.
2011-02-10 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: modified gm2.html rule.
* gm2/gm2.texi: changed Function Index to Indices.
* gm2/examples/texi2tr/src/outputdev.py: added
templatePath.
* gm2/examples/texi2tr/src/texi2tr.py: added
rootName, templatePath, baseName options.
* gm2/www/Makefile.in: new building instructions
for the web site now that texi2tr is useable.
* gm2/www/index.ms: minor changes.
2011-02-09 Gaius Mulley <gaius@gnu.org>
* texi2tr is now able to translate the gm2.texi
into html. First usable version.
* gm2/examples/texi2tr/src/config.py: many changes.
* gm2/examples/texi2tr/src/outputdev.py: many changes.
* gm2/examples/texi2tr/src/navigate.py: many changes.
* gm2/examples/texi2tr/src/texi2tr.py: many changes.
2011-02-04 Gaius Mulley <gaius@gnu.org>
* gm2/examples/texi2tr: new directory.
* gm2/examples/texi2tr/src: new directory.
* gm2/examples/texi2tr/src/config.py: new file.
* gm2/examples/texi2tr/src/outputdev.py: new file.
* gm2/examples/texi2tr/src/navigate.py: new file.
* gm2/examples/texi2tr/src/texi2tr.py: new file.
2011-01-30 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: fixed some typos and corrected the
python version number. Also foxed some texinfo variable
references.
* gm2/gm2/gm2spec.c: tided up code. Also modified the
driver to add easily maintainable ordered lists of
object paths and library paths.
* gm2/el/g-mode.el: updated the dates.
* gm2/gm2/Make-lang.in: use the new tool texi2tr to
generate the html documentation which is currently
under development.
2011-01-22 Gaius Mulley <gaius@gnu.org>
* fixed a bug reported by Steve Giess.
* testsuite/gm2/pim/pass/constcast.mod: New file.
* testsuite/gm2/pim/pass/constmax.mod: New file.
* gm2/gm2-compiler/PCSymBuild.mod: WalkLeaf detect
if the symbol is a type in which case copy the
type rather than get the type of a type.
2011-01-14 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: modified the stage2 and Modula-2
library objects built from C sources to use XGCC.
Define XGCC to the locally built ./xgcc -B./
This allows gm2 to build under Darwin OS X
Snow Leopard.
2011-01-12 Gaius Mulley <gaius@gnu.org>
* released version 1.0.1 of gm2.
* gm2/version.c: updated to version 1.0.1
* gm2/www/index.ms: updated news of 1.0.1 release.
* gm2/gm2-libs/configure.in: updated to 1.0.1
* gm2/gm2-libs/configure: rebuilt.
* gm2/configure: rebuilt.
2011-01-11 Gaius Mulley <gaius@gnu.org>
* fixed many bug reported by
Dragiša Durić (dragisa-duric/testcase20).
* gm2/gm2-compiler/SymbolTable.mod: new procedure
SanityCheckConstants which checks to see types
are used in formal parameters.
* gm2/gm2-compiler/SymbolTable.def: export new procedure
SanityCheckConstants.
* gm2/gm2-compiler/M2Comp.mod: call SanityCheckConstants
after Pass C.
* gm2/gm2-compiler/M2Quads.mod: skip types in CheckParameters
* gm2/gm2-compiler/M2MetaError.def: add ebnf comments.
2011-01-10 Gaius Mulley <gaius@gnu.org>
* fixed many constant type related bugs reported by
Dragiša Durić (dragisa-duric/testcase18 and
dragisa-duric/testcase19).
* gm2/Make-lang.in: modified texi2html build rule.
* gm2/bnf/m2-c.bnf: major number of changes to incorporate
parsing const expressions to deduce their types.
* gm2/gm2-compiler/M2Base.mod: added return types to the
builtin procedure functions so that if they are used in
constant expressions m2-c can determine their types.
* gm2/gm2-compiler/M2Comp.mod: ResolveConstType is now
exported from PCSymBuild rather than P2SymBuild.
* gm2/gm2-compiler/M2GenGCC.mod: allow procedures to be
assigned to constants.
* gm2/gm2-compiler/M2Quads.def: export new procedure
function Top.
* gm2/gm2-compiler/M2Quads.mod: implement new procedure
function Top.
* gm2/gm2-compiler/M2StackAddress.mod: fixed bug in
M2StackAddress.NoOfItemsInStackAddress.
* gm2/gm2-compiler/M2StackWord.mod: fixed same bug in
M2StackWord.NoOfItemsInStackAddress.
* gm2/gm2-compiler/P2SymBuild.def: removed many of the
constant type resolution procedures and moved them to
PCSymBuild.
* gm2/gm2-compiler/PCSymBuild.def: export many constant
type related procedures.
* gm2/gm2-compiler/PCSymBuild.mod: major reimplementation
to allow constant expression trees to be built so that
types can be deduced.
* gm2/init/gm2-gccinit: added new M2Const.
* gm2/www/index.ms: web page now contains info relating
to release 1.0.

310
gcc/m2/ChangeLog-2012 Normal file
View File

@@ -0,0 +1,310 @@
2012-12-10 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-pim/Random.mod: fixed bug in RandomLongReal
report by Steve Giess. Incorrect data type was used which
caused a NaN to be generated.
2012-12-08 Gaius Mulley <gaius@gnu.org>
* gm2/examples/gravity/twoDsim.mod: (added semicolon).
* gm2/gm2-libs-pim/InOut.def: improved comment to
OpenOutput.
* gm2/gm2-libs-pim/InOut.mod: fixed so that the file
can only be written to if it does not already exist.
2012-12-03 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-iso/RandomNumber.def: (added file).
* gm2/gm2-libs-iso/RandomNumber.mod: (added file).
2012-11-26 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-pim/Random.def: fixed declaration of
RandomBytes to use VAR parameter.
* gm2/gm2-libs-pim/Random.mod: fixed declaration of
RandomBytes to use VAR parameter. Also improved
implementation of RandomReal and RandomLongReal.
* gm2/gm2-libs-iso/RandomNumber.def: (New module).
* gm2/gm2-libs-iso/RandomNumber.mod: (New module).
* gm2/Make-lang.in: add RandomNumber.mod to the list
of ISO modules.
* gm2/gm2-libs-iso/RandomNumber.def: Fixed description.
2012-11-21 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-pim/Random.def: export RandomLongReal and
RandomBytes. Fixes a bug reported by Steve Giess.
2012-09-19 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/SymbolTable.mod: bug fix to fix up all
unbounded parameter types if they are produced via partial
unbounded symbols. Fixes a bug exposed by macroObjects.mod
in a new example directory.
2012-06-28 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: CodeAddr can now obtain the
address of CHAR constants. Fixes a bug reported by Scott
Iverson.
* gm2/gm2-compiler/M2GenGCC.mod: corrected CodeAddr to ensure
that the address of a char is only converted into address of
a string for constants.
2012-05-04 Gaius Mulley <gaius@gnu.org>
* gm2/gm2spec.c: detect -fonlylink. Ensure that -fonlylink is
present on the command line if -fmakeall is used. Otherwise
the driver will compile and link the main module object together
with the main module compiled via the make. Fixes a bug reported
by Scott Iverson, linking a shared library.
2012-05-03 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: (BinaryOperands) New procedure function.
Used by FoldAdd, CodeAdd, FoldSub, CodeSub, FoldMult, CodeMult,
FoldDivTrunc, CodeDivTrunc, FoldModFloor, CodeModFloor.
2012-05-02 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: (convert_for_comparison) New function.
gccgm2_BuildEqualTo, gccgm2_BuildNotEqualTo use
convert_for_comparison. This fixes comparison between a
WORD operand. Bug reported by Scott Iverson.
* gm2/gccgm2.c: applied fix for all WORD sizes.
2012-05-01 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: (CodeStandardFunction) implement
TBITSIZE. (FoldStandardFunction) implement TBITSIZE.
* gm2/gm2-compiler/M2Quads.mod: (BuildTBitSizeFunction) New
procedure function.
* gm2/gm2-compiler/M2System.def: (TBitSize) define and export.
Tidied up formatting (sym used instead of Sym).
* gm2/gm2-compiler/M2System.mod: initialise TBitSize.
Tidied up formatting (sym used instead of Sym).
(IsPseudoSystemFunction) includes TBitSize.
2012-04-30 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GCCDeclare.mod: (BuildRecord) fixed bit
field calculation.
2012-04-28 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2Range.mod: (firstmention) New field
in Range. (FirstMention) New procedure function.
FoldTypeAssign, FoldTypeParam, FoldTypeExpr, CodeTypeAssign,
CodeTypeParam, CodeTypeExpr call FirstMention before
emitting an error message. Multiple related messages have
been chained. This fixes a bug report by Scott Iverson
(duplicate error messages).
* gm2/Make-lang.in: tidied up formatting and added a commented
out short cut used during development.
* gm2/gccgm2.c: tidied up formatting of gccgm2_GetSizeOf.
gccgm2_GetSizeOf now detects COMPONENT_REF.
gccgm2_GetSizeOfInBits now detects COMPONENT_REF.
* gm2/gm2.texi: added new example of how bit field packing
can be achieved.
* gm2/bnf/m2-3.bnf: removed call to dummy
CheckOuterScopeProcedureVariable procedure.
* gm2/bnf/m2-h.bnf: removed import CheckOuterScopeProcedureVariable.
* gm2/gm2-compiler/M2GCCDeclare.mod: (WalkComponentDependants)
New procedure. (IsValueDeendants) New procedure function.
* gm2/gm2-compiler/M2GenGCC.mod: (FoldRecordField, CodeRecordField)
New procedures. CodeUnbounded simplified.
* gm2/gm2-compiler/M2Quads.def: Removed
CheckOuterScopeProcedureVariable.
* gm2/gm2-compiler/M2Quads.mod: many changes to allow
record accesses to be achieved via the GCC Tree
COMPONENT_REF. To this end we use a front end symbol
component which mirrors the eventual GCC Tree.
BuildAdrFunction altered to obtain the address of
Components and the WITH statement has been rewritten.
(CheckOuterScopeProcedureVariable) removed.
New quadruple operator RecordFieldOp introduced to
generate components. All unbounded accesses use the
new component record mechanism.
* gm2/gm2-compiler/SymbolTable.def: (MakeComponentRecord),
(MakeComponentRef), (IsComponent) New procedure functions.
* gm2/gm2-compiler/SymbolTable.mod: (MakeComponentRecord),
(MakeComponentRef), (IsComponent), (GetNthFromComponent),
(buildTemporary). MakeTemporary use buildTemporary.
New procedure functions.
2012-04-11 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GCCDeclare.mod: (DeclarePackedSet) New
procedure.
* gm2/gm2-compiler/SymbolTable.mod: (MakeSet) creates an
equivalent packedInfo placeholder. (MakeEquivalent)
and (GetPackedEquivalent) modified to handle set type.
2012-04-07 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: (calcNbits) New function.
* gm2/m2pp.c: (ptc), (m2pp_getaligned),
(m2pp_recordfield_alignment) New functions.
* gm2/gm2-compiler/M2GCCDeclare.mod: fixes to DeclarePackedType.
* gm2/gm2-compiler/P2SymBuild.mod: fixes to HandleRecordFieldPragmas.
* gm2/gm2-compiler/SymbolTable.mod: fixes to
GetDefaultRecordFieldAlignment.
2012-03-27 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GCCDeclare.mod: added missing RETURN
statement.
* gm2/examples/gravity/twoDsim.mod: added debugging procedure
to display the definition of the polygon.
2012-03-17 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/SymbolTable.mod: record when an unknown
symbol is reported and ensure that we only report unknown
symbols once. Fixes a bug reported by Scott Iverson.
Procedure UnknownSymbolError uses IsUnreportedUnknown and
populates ReportedUnknowns whenever an error message is
generated. New procedure function (IsUnreportedUnknown).
* gm2/gm2-compiler/M2GCCDeclare.mod: renamed MaybePackField
by MakebeAlignField.
* gm2/gm2-compiler/SymbolTable.mod: GetAlignment modified
to return the alignment of Varient and VarientFields.
2012-02-23 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: (gccgm2_BuildStartFieldVarient,
gccgm2_BuildEndFieldVarient) New functions.
* gm2/m2pp.c: detect FIELD_DECL in m2pp_type.
* gm2/gm2-compiler/M2GCCDeclare.mod: use
BuildStartFieldVarient rather than BuildStartVarient.
Use BuildEndFieldVarient rather than BuildEndVarient.
This fixes a number of regression test bugs including:
testsuite/gm2/extensions/run/pass/align8.mod.
* gm2/gm2-compiler/gccgm2.def: define BuildStartFieldVarient
and BuildEndFieldVarient.
2012-02-15 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: (gccgm2_BuildTBitSize) detect if TYPE_DECL is passed.
2012-02-14 Gaius Mulley <gaius@gnu.org>
The following changes are a change to the type declaration system
which is necessary to implement bit alignment of record fields.
* gm2/gm2-compiler/M2DebugStack.def: New file.
* gm2/gm2-compiler/M2DebugStack.mod: New file.
* gm2/Make-lang.in: tidied up the file and introduced a commented
rule which allows stage2 to be built from a prebuilt stage1. This
is only ever used during heavy development and allows debugging in
Modula-2 to occur rather than in the translated, C, files.
* gm2/gccgm2.c: gccgm2_BuildStartEnumeration, gccgm2_BuildEndRecord,
start_enum (new parameter ispacked). New functions
(gccgm2_SetTypePacked, gccgm2_SetDeclPacked,
gccgm2_GetPackedBooleanType, gccgm2_SetRecordFieldOffset,
gccgm2_GetTBitSize, noBitsRequired, gccgm2_BuildStartVarient,
gccgm2_BuildEndVarient, gccgm2_BuildSmallestTypeRange,
gccgm2_BuildTBitSize).
* gm2/lang.opt: introduce debugging option -fd.
* gm2/m2.flex: introduce <* *> into the set of lexical tokens.
* gm2/m2pp.c: pretty print union types and also whether records and their
fields are aligned, packed, offset values and addressible.
* gm2/bnf/gm2l.bnf: introduce <* *> into the set of lexical tokens.
* gm2/bnf/gm2m.bnf: introduce <* *> into the set of lexical tokens.
* gm2/bnf/m2-2.bnf: introduce <* *> into the set of lexical tokens.
extended the ebnf to include a default record alignment using pragmas.
Also extended the ebnf to include field alignment and packing using
pragmas.
* gm2/bnf/m2-3.bnf: introduce <* *> into the set of lexical tokens.
extended the ebnf to include a default record alignment using pragmas.
Also extended the ebnf to include field alignment and packing using
pragmas.
* gm2/bnf/m2-c.bnf: introduce <* *> into the set of lexical tokens.
extended the ebnf to include a default record alignment using pragmas.
Also extended the ebnf to include field alignment and packing using
pragmas.
* gm2/bnf/m2-h.bnf: introduce <* *> into the set of lexical tokens.
extended the ebnf to include a default record alignment using pragmas.
Also extended the ebnf to include field alignment and packing using
pragmas.
* gm2/bnf/m2.bnf: introduce <* *> into the set of lexical tokens.
extended the ebnf to include a default record alignment using pragmas.
Also extended the ebnf to include field alignment and packing using
pragmas.
* gm2/el/g-mode.el: removed PACKED as a keyword.
* gm2/gm2-compiler/M2GCCDeclare.mod: huge number of changes and
many aspects have been rewritten. The main changes occur from
delaying a records declaration into a GCC Tree until its alignment
is known. Varient records are also handled in this way. Much
debugging code added as well. Simple types can also be declared
as packed (Subranges, Boolean) and enumeration types.
* gm2/gm2-compiler/M2Quads.def: new procedures BuildBitLength,
BuildPragmaField, BuildDefaultFieldAlignment, OperandAnno,
Annotate).
* gm2/gm2-compiler/M2Quads.mod: implement all of the above.
Provide a useful internal debugging procedure function 'ds'
which display the quadruple stack.
* gm2/gm2-compiler/M2Reserved.def: add LDirectiveTok and
RDirectiveTok.
* gm2/gm2-compiler/M2Reserved.mod: implement above.
* gm2/gm2-compiler/P2SymBuild.def: new procedure functions
P2BuildDefaultFieldAlignment, BuildPragmaConst.
* gm2/gm2-compiler/P2SymBuild.mod: implement above.
* gm2/gm2-compiler/Sets.mod: no longer import BITSET from SYSTEM.
* gm2/gm2-compiler/SymbolTable.def: new procedures
(GetDefaultRecordFieldAlignment, PutDeclaredPacked,
IsDeclaredPacked, IsDeclaredPackedResolved,
GetPackedEquivalent, GetNonPackedEquivalent,
PutDefaultRecordFieldAlignment, PutUnused, IsUnused).
* gm2/gm2-compiler/SymbolTable.mod: implement above.
* gm2/gm2-compiler/gccgm2.def: remove procedure function
BuildStartVarientRecord and add procedure functions
BuildStartVarient, BuildEndVarient, BuildSmallestTypeRange,
GetPackedBooleanType, SetDeclPacked, SetTypePacked,
SetRecordFieldOffset, BuildTBitSize.
* gm2/gm2-compiler/ppg.mod: remove BITSET from SYSTEM
import list.
* gm2/gm2-libs-iso/SYSTEM.def: define new builtin procedure
function TBITSIZE.
2012-02-05 Gaius Mulley <gaius@gnu.org>
* gm2/gccgm2.c: fixed bug reported by Scott Iverson.
The bug occurred when a procedure was used in a constructor.
The solution is to take the address of the FUNCTION_DECL.
2012-01-13 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GCCDeclare.mod: declare procedures in
topological order with constants and types. This fixes a bug
reported by Scott Iverson.
2012-01-12 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/Indexing.mod: removed import of BITSET from SYSTEM.
* gm2/gm2-compiler/M2Base.mod: BITSET is now declared as a pervasive
type.
* gm2/gm2-compiler/M2Error.mod: removed import of BITSET from SYSTEM.
* gm2/gm2-compiler/M2Printf.mod: removed import of BITSET from SYSTEM.
* gm2/gm2-compiler/M2System.mod: removed BITSET from being declared.
* gm2/gm2-libs/SYSTEM.def: removed BITSET from export list.
* gm2/gm2-libs-min/SYSTEM.def: removed BITSET from export list.
* gm2/gm2-libs-coroutines/SYSTEM.def: removed BITSET from export list.
* gm2/gm2-libs/Indexing.mod: BITSET is now a pervasive type.
* gm2/gm2-libs/M2RTS.mod: BITSET is now a pervasive type.
* gm2/gm2.texi: added new section on packed records and also BITSET
is no longer exported from SYSTEM but is a pervasive type.
* gm2/ulm-lib-gm2/std/M2RTS.mod: no longer import BITSET.
* gm2/ulm-lib-gm2/std/MathLib.mod: no longer import BITSET.
* gm2/ulm-lib-gm2/std/Plot.mod: no longer import BITSET.
* gm2/ulm-lib-gm2/sys/SYSTEM.def: no longer export BITSET.
* gm2/ulm-lib-gm2/sys/SysStat.def: no longer import BITSET.
* gm2/ulm-lib-gm2/sys/SysStat.mod: no longer import BITSET.
* gm2/ulm-lib-gm2/std/Archive.def: no longer import BITSET.
* gm2/ulm-lib-gm2/sys/SysIoctl.def: no longer import BITSET.
* gm2/gm2-libs-pim/BitBlockOps.mod: no longer import BITSET.
* gm2/gm2-libs-pim/BitBlockOps.mod: no longer import BITSET.
* gm2/gm2-libs-pim/BitByteOps.mod: no longer import BITSET.
* gm2/gm2-libs-pim/BitWordOps.mod: no longer import BITSET.
* gm2/gm2/examples/map/AdvMap.def: no longer import BITSET.

810
gcc/m2/ChangeLog-2013 Normal file
View File

@@ -0,0 +1,810 @@
2013-12-25 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GCCDeclare.mod: PushNoOfBits (New
procedure). DeclareLargeSet use PushNoOfBits.
* gm2/gm2-compiler/SymbolKey.def: import WORD from SYSTEM.
2013-12-24 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/m2convert.c: doOrdinal (New function).
m2convert_BuildConvert call doOrdinal is value
is a STRING_CST and its length <= 1. Refactor
type computation.
* gm2/gm2-gcc/m2statement.c:
m2statement_BuildUnaryForeachWordDo remove p1, p2
pointer calculations and use m2treelib_get_set_field_rhs
and m2treelib_get_set_field_des instead.
m2statement_BuildExcludeVarConst remove p1 and use
m2treelib_get_set_field_des and m2treelib_get_set_field_rhs
instead. m2statement_BuildIncludeVarConst use
m2treelib_get_set_field_des instead of
m2treelib_get_set_field_rhs.
2013-12-20 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/m2builtins.c: (builtin_function) use
add_builtin_function and set source line appropriately.
2013-12-11 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-coroutines/SYSTEM.def: added commented
internal procedure function definitions.
* gm2/gm2-lang.c: remove the Go defaults in
gm2_langhook_init_options_struct. No longer attempt
to split the stack, which fixes regression test failures
in gm2/coroutines/pim/run/pass/testiotransfer.mod
and gm2/coroutines/pim/run/pass/testtransfer.mod.
2013-12-09 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-coroutines/SYSTEM.def: added definition
of the internal procedure functions
ShiftVal, ShiftLeft, ShiftRight, RotateVal,
RotateLeft, RotateRight to handle large sets.
* gm2/gm2-libs-coroutines/SYSTEM.mod: added implementation
of the internal procedure functions
ShiftVal, ShiftLeft, ShiftRight, RotateVal,
RotateLeft, RotateRight to handle large sets.
* gm2/gm2-compiler/M2GenGCC.mod: fixed type change
bug which occurred if a large bitset is compared to
an empty set. Use ConvertBinaryOperands for the
special case as well.
* gm2/gm2-gcc/m2expr.c: corrected function indirect
prototype to include location_t.
* gm2/gm2-gcc/m2expr.h: corrected function indirect
prototype to include location_t.
2013-12-06 Gaius Mulley <gaius@gnu.org>
* testsuite/gm2/pimcoroutes/pass/gm2.exp:
* testsuite/gm2/pimcoroutes/pass/exports.mod:
* testsuite/gm2/pimcoroutes/pass/exports2.mod:
(New files)
* gm2/gm2-libs-coroutines/SYSTEM.def: corrected
export list taking care to only have data types on the
(* @SYSTEM_DATATYPES@ *) line.
* gm2/Make-lang.in: add
gm2/Make-lang.in to be a dependant of gm2/gm2-libs.texi.
Add new rule to build $(objdir)/gm2/gm2-libs-coroutines/SYSTEM.def.
Add $(objdir)/gm2/gm2-libs-coroutines/SYSTEM.def to build-system.
2013-12-05 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: added information on
how to build a gcc-4.1.2 based gm2 under a multiarch
linux system.
* gm2/gm2.texi: changed configure
examples to reflect new source tree layout.
2013-12-01 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/deviceGroff.mod: (newFrame)
emit leading .ll 8i.
* gm2/examples/pge/foo.mod: (regenerated).
* gm2/gm2-gcc/m2builtins.c: (m2builtins_BuildBuiltinTree)
corrected formatting.
* testsuite/gm2/pim/pass/builtin.def: corrected sinf
to use and return SHORTREAL types.
* testsuite/gm2/pim/pass/builtin.mod: corrected sinf
to use and return SHORTREAL types.
* testsuite/gm2/pim/pass/testsinf.mod: corrected test
to use REAL rather than SHORTREAL with sinf.
2013-11-20 Gaius Mulley <gaius@gnu.org>
* gm2/config-lang.in: added target-libgm2
to the list of target_libs.
* gm2/examples/pge/foo.fig: new example.
* gm2/examples/pge/foo.mod: regenerated.
* gm2/gm2-compiler/M2GenGCC.mod: change
type to Address if lvalue is used, this fixes the
regression test failure in
testsuite/gm2/iso/run/pass/unbounded.mod.
* gm2/gm2spec.c: remove extern int force_no_linker.
Changed variable name force_no_linker to allow_linker and
switched boolean value. allow_linker now exported via gcc.h.
* gm2/patches/gcc/4.7.3/0[0-9]-patches:
regenerated.
* gm2/patches/gcc/4.7.3/10-patches:
regenerated.
2013-11-15 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-iso/LongWholeIO.mod: (ReadInt)
* gm2/gm2-libs-iso/ShortWholeIO.mod: (ReadInt)
* gm2/gm2-libs-iso/WholeIO.mod: (ReadInt)
catch overflow and set the read result accordingly.
* gm2/gm2-libs-iso/LongWholeIO.mod: (ReadInt)
* gm2/gm2-libs-iso/ShortWholeIO.mod: (ReadInt)
* gm2/gm2-libs-iso/WholeIO.mod: (ReadInt)
reference SetReadResult correctly via IOChan.
2013-11-14 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: (FoldBinary)
convert left and right operands to the result type.
* gm2/gm2-libs-iso/ShortWholeIO.mod: (ReadInt)
handle negative value without overflowing.
* gm2/gm2-libs-iso/WholeIO.mod: (ReadInt)
handle negative value without overflowing.
2013-11-13 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2ALU.mod: (InitialiseArrayWith)
convert low and high bounds into integers when creating array
constants.
* gm2/gm2-gcc/m2expr.c: (m2expr_BuildAdd),
(m2expr_BuildSub), (m2expr_BuildDivTrunc), (m2expr_BuildModTrunc),
(m2expr_BuildDivFloor), (m2expr_BuildModFloor), (m2expr_BuildLSL),
(m2expr_BuildLSR), (m2expr_BuildLRL), (m2expr_BuildLRR),
(m2expr_BuildMask) all fold operands and also their results.
(m2expr_BuildLRotate) New function. (m2expr_BuildRRotate)
New function.
2013-11-12 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/m2expr.c: (m2expr_BuildCmplx) check
to see that the expressions are REAL_CST before calling
build_complex.
* gm2/gm2-compiler/M2Options.def: (FinaliseOptions)
exported.
* gm2/gm2-gcc/m2options.h: (FinaliseOptions)
declared extern.
* gm2/gm2-lang.c: (gm2_langhook_post_options)
call M2Options_FinaliseOptions.
2013-11-10 Gaius Mulley <gaius@gnu.org>
* gm2/gcc-gm2/m2expr.c: (m2expr_BuildCap) fold results of each
subexpression to ensure a constant is returned if a constant
parameter is given.
2013-11-08 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/fig.py: added abiltity to set a default velocity.
* gm2/examples/pge/foo.fig: changed default demo.
* gm2/examples/pge/foo.fig: changed default demo.
* gm2/tools-src/makeversion: simplified to use 'cat'.
Necessary as the top level directory name no longer contains
the release number.
* gm2/www/tools/texi2tr/html/download.html: changed to
reflect change from cvs to git.
2013-10-28 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/m2block.c: iterate over the tree chain adding declaration
statements (of variables) to the statement list.
2013-10-17 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: added new section (Building gcc-4.7
under Debian), added new section (Building gcc-4.7
under Solaris).
* gm2/examples/pge/Fractions.mod: updated dates.
* gm2/examples/pge/circles.mxm: added comments and rewritten to use
max2code syntax.
* gm2/examples/pge/mxmmaxima.py: corrected getPolynomials.
* gm2/examples/pge/mxmparser.py: many changes to allow stdout as a filename
specified by '-'.
* gm2/examples/pge/mxmtree.py: many changes and additions.
* gm2/examples/pge/ramps2.mod: useGroff (New constant).
* gm2/examples/pge/rotating-line.mxm: added comments and rewritten to
use max2code syntax.
* gm2/examples/pge/snooker.mod: added a boundary to the snooker table.
* gm2/examples/pge/test.mxm: rewritten to use max2code syntax.
* gm2/examples/pge/twoDsim.mod: minor changes to allow circle on circle
collision to be calculated from a max2code included source file.
2013-10-02 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/circles.mxm: (New file).
* gm2/examples/pge/debugt: (New file).
* gm2/examples/pge/max2code.py: (New file).
* gm2/examples/pge/mxmmaxima.py: (New file).
* gm2/examples/pge/mxmout.py: (New file).
* gm2/examples/pge/mxmparser.py: (New file).
* gm2/examples/pge/mxmstack.py: (New file).
* gm2/examples/pge/mxmtree.py: (New file).
* gm2/examples/pge/mxmutils.py: (New file).
* gm2/examples/pge/pge.py: (New file).
* gm2/examples/pge/rotating-circles.mxm: (New file).
* gm2/examples/pge/rotating-line.mxm: (New file).
* gm2/examples/pge/runt: (New file).
* gm2/examples/pge/test.mxm: (New file).
2013-09-27 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: (CodeHigh) convert high value into
a cardinal. (FoldHigh) convert high value into cardinal. Fixes
a bug exposed when compiling ulm-lib-gm2/std/StrSpec.mod.
* gm2/gm2-compiler/M2GenGCC.mod: (FoldHigh) convert constant into
a cardinal.
2013-09-26 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-iso/LongWholeIO.def: (Re-added).
* ShortIO.def: (Re-added).
* ShortWholeIO.def: (Re-added).
* SLongWholeIO.def: (Re-added).
* SShortIO.def: (Re-added).
* SShortWholeIO.def: (Re-added).
* LongWholeIO.mod: (Re-added).
* ShortIO.mod: (Re-added).
* ShortWholeIO.mod: (Re-added).
* SLongWholeIO.mod: (Re-added).
* SShortIO.mod: (Re-added).
* SShortWholeIO.mod: (Re-added).
2013-09-25 Gaius Mulley <gaius@gnu.org>
* gm2/patches/gcc/4.7.3/[01-10] (New patches created).
Added configure which fixes the absence of libgm2 being built.
2013-09-24 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2ALU.mod: (BuildBitset) now return a
BITSET type rather than an integer.
* gm2/gm2-compiler/M2GenGCC.mod: (CodeInclude) do not convert the IntegerTree.
(CodeExclude) do not convert the IntegerTree.
* gm2/gm2-gcc/m2expr.c: (m2expr_BuildLogicalShift) convert op2 and op3
ToWord. (m2expr_BuildIfConstInVar) use varset rather than p1.
(m2expr_BuildComponentRef) call m2tree_skip_reference_type.
(m2expr_BuildBinaryForeachWordDo) call m2treelib_get_set_field_des.
* gm2/gm2-gcc/m2statement.c: (m2statement_BuildIncludeVarConst)
use op1, rather than p1 in m2treelib_get_set_field_rhs.
* gm2/gm2-gcc/m2tree.c: (m2tree_skip_reference_type) New function.
* gm2/gm2-gcc/m2tree.h: (m2tree_skip_reference_type) New declaration.
* gm2/gm2-gcc/m2treelib.c: (m2treelib_get_set_field_des) New function.
* gm2/gm2-gcc/m2treelib.h: (m2treelib_get_set_field_des) New declaration.
2013-09-20 Gaius Mulley <gaius@gnu.org>
* gm2/patches/gcc/4.7.3: remade patch set which now includes toplevel
Makefile.def.
2013-09-18 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GCCDeclare.mod: (SkipModuleScope) New procedure
function. PushBinding use SkipModuleScope. PopBinding use
SkipModuleScope.
* gm2/gm2-compiler/M2GenGCC.mod: CodeAddr checks whether
op3 IsConstString.
* gm2/gm2-gcc/m2convert.c: (m2convert_ToBitset) New function.
* gm2/gm2-gcc/m2convert.h: (m2convert_ToBitset) New function.
* gm2/gm2-gcc/m2expr.c: many changes to use m2expr_FoldAndStrip
for binary operands. Also many changes to set operators so
that COMPOUND_REF are used whenever possible and that operands
to binary operators are converted to the same types.
Use m2expr_BuildAddAddress instead of BuildAdd for address
arithmetic.
* gm2/gm2-gcc/m2expr.h: fix header for m2expr_BuildAddAddress.
* gm2/gm2-gcc/m2statement.c: many changes to set operators so
that COMPOUND_REF are used whenever possible and that operands
to binary operators are converted to the same types.
Use m2expr_BuildAddAddress instead of BuildAdd for address
arithmetic.
* gm2/gm2-gcc/m2treelib.c: use COMPOUND_REF whenever possible.
Convert all set return values to BITSET. Use m2expr_BuildAddr
rather than m2expr_build_unary_op.
2013-09-14 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/m2block.c: more fixes for nested procedures
in finishFunctionDecl. Also enabled three asserts.
2013-09-10 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: convert all operands for
comparison operators.
2013-09-06 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/m2block.c: (cosmetic changes).
* gm2/gm2-gcc/m2statement.c: (m2statement_BuildEndFunctionCode)
call cgraph_get_create_node for a nested function otherwise
call cgraph_finalize_function and gm2_gimplify_function_code.
Fixes allow nested procedures to be compiled.
2013-08-14 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-lang.c: (gm2_langhook_init_options) New function.
(is_cpp_filename) New function. gm2_langhook_post_options
call M2Options_SetCC1Quiet. gm2_parse_input_files only call
init_PerCompilationInit if filename is not a cpp filename argument.
* gm2/gm2spec.c: corrected comment typo. (get_B_or_prefix)
New function. add_exec_name use find_executable_path.
(lang_register_spec_functions). New function.
(add_exec_dir) modified to create the argument -fcppprog=.
* gm2/lang-specs.h: add %:exec_prefix(cc1) to all -fcpp options.
* gm2/lang.opt: added imultilib to Modula-2.
* gm2/gm2-compiler/M2DriverOptions.def: (CppCommandLine) New function.
* gm2/gm2-compiler/M2DriverOptions.mod: (CppCommandLine) implemented
new function.
* gm2/gm2-compiler/M2Options.def: (SetCC1Quiet) New function.
* gm2/gm2-compiler/M2Options.mod: (ScanCppArgs) Removed function.
(CppCommandLine) New function. (CppProg) New function.
(CppArg) New function. (SetCC1Quiet) New function.
* gm2/gm2-compiler/M2Preprocess.mod: removed hack inside PreprocessModule.
* gm2/gm2-gcc/m2options.h: New definitions for M2Options_SetCC1Quiet,
M2Options_CppProg and M2Options_CppArg.
* gm2/patches/gcc/4.7.3/01-patches: rebuilt.
* gm2/patches/gcc/4.7.3/02-patches: rebuilt.
* gm2/patches/gcc/4.7.3/03-patches: rebuilt.
* gm2/patches/gcc/4.7.3/04-patches: rebuilt.
* gm2/patches/gcc/4.7.3/05-patches: rebuilt.
* gm2/patches/gcc/4.7.3/06-patches: rebuilt.
* gm2/patches/gcc/4.7.3/07-patches: rebuilt.
* gm2/patches/gcc/4.7.3/08-patches: rebuilt.
2013-07-20 Gaius Mulley <gaius@gnu.org>
* gm2/configure.in: corrected dates.
* gm2/gm2spec.c: (add_B_prefix) now calls insert_option. (add_library)
calls insert_option. (insert_option) New function.
* gm2/bnf/gm2l.bnf: corrected dates and also emit full path to the
source file in the comment section. Also exit(1) if no source file
can be found.
* gm2/gm2-compiler/gm2lcc.mod: allow -B to either take a concatenated
argument or use the next argument.
2013-07-15 Gaius Mulley <gaius@gnu.org>
* gm2/gm2spec.c: (fe_generate_option) fixed cast to XCNEWVEC.
(printOption) moved function earlier in the file.
(add_library) position is now declared as unsigned int.
(add_library) more debugging, also copy arguments correctly
into the new array. (lang_specific_driver) corrected strncmp
count.
2013-07-12 Gaius Mulley <gaius@gnu.org>
* gm2/gm2spec.c: get_prefix removed string literal and replaced it with
PREFIX. Fix to call add_link_from_include swapped parameters. Use
unsigned int as a comparison. Removed unused variable.
* gm2/Make-lang.in: add -DPREFIX to the build rule for gm2spec.o.
* gm2/gm2.texi: removed item about limitation to link as this is now fixed.
2013-07-11 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-lang.c: gm2_langhook_getdecls return value from m2block_GetGlobals().
gm2_langhook_write_globals call write_global_declarations.
* gm2/gm2spec.c: (purge_include_options) New function. Call ge_generate_option
if -I is found.
* gm2/gm2-compiler/M2GenGCC.mod: corrected dates.
* gm2/gm2-gcc/m2block.c: assert_global_names (New function). m2block_GetGlobals
call assert_global_names and return global_binding_level->names.
* gm2/gm2-gcc/m2block.def: GetGlobals (New procedure function).
* gm2/gm2-gcc/m2block.h: GetGlobals (New procedure function).
* gm2/gm2-gcc/m2decl.c: added debugging hooks to detect variables being declared.
* gm2/gm2spec.c: convert_include_into_link (New procedure function).
2013-07-08 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: removed installation rules for library modules.
* gm2/gm2.texi: added information on how to build gm2 grafted onto gcc-4.7.3.
* gm2/gm2spec.c: many changes which reintroduce the gm2 linking mechanism and
via specs. Many changes due to the differences between gcc-4.7.3 and gcc-4.1.2.
* gm2/lang-specs.h: corrected dates.
* gm2/gm2-compiler/M2Defaults.def: corrected dates.
* gm2/gm2-compiler/M2Defaults.mod: corrected dates.
* gm2/gm2-compiler/M2FileName.def: corrected dates.
* gm2/gm2-compiler/M2FileName.mod: corrected dates.
* gm2/gm2-compiler/M2Options.mod: added Debugging and printf1.
* gm2/gm2-compiler/M2Search.def: corrected dates.
* gm2/gm2-compiler/M2Search.mod: corrected dates.
* gm2/gm2-compiler/gm2lcc.mod: corrected dates.
* gm2/www/Makefile.in: commented out texisrc subcomponents and fixed path for
TEXI2HTML.
* gm2/patches/gcc/4.7.3/01-patches: (Re-made patch).
* gm2/patches/gcc/4.7.3/02-patches: (Re-made patch).
* gm2/patches/gcc/4.7.3/03-patches: (Re-made patch).
* gm2/patches/gcc/4.7.3/04-patches: (Re-made patch).
* gm2/patches/gcc/4.7.3/05-patches: (New file).
2013-06-14 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: removed many of the library building rules.
* gm2/Makefile.in: added description comment.
* gm2/gm2.texi: updated dependencies for building gm2 on the gcc-4.7.x.
* gm2/examples/pge/rotating-line.asc: rebuilt the .asc.
* gm2/gm2-libs-ch/termios.c: include correct target/host configure header file.
* gm2/gm2-libs-min/libc.c: updated copyright dates.
* gm2/p2c/p2c.h: tidied formatting.
* gm2/p2c/p2c-src/include/system.h: remove include <varargs.h>. Add
include of <stddef.h>.
2013-04-30 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2ALU.def: (ConvertToType) New procedure.
* gm2/gm2-compiler/M2ALU.mod: (ConvertToType) New procedure
implemented.
Call ToInteger to change internal GCC types when computing bitsets.
* gm2/gm2-compiler/M2GenGCC.mod: GetFieldNo converts M2ALU gcc trees
using ToCardinal.
* gm2/gm2-compiler/M2Quads.mod: (GetProtection) New procedure function.
(CheckNeedPriorityBegin) create variable of PROTECTION type rather than
CARDINAL.
* gm2/gm2-gcc/m2convert.c: (ToInteger) New function.
* gm2/gm2-gcc/m2convert.def: (ToInteger) New procedure function.
* gm2/gm2-gcc/m2convert.h: (ToInteger) New procedure function.
* gm2/gm2-gcc/m2expr.c: (m2expr_BuildLogicalShift) convert binary
operands to the same type.
* gm2/gm2-gcc/m2statement.c: (m2statement_BuildUnaryForeachWordDo)
convert binary operands to the same type and correct the call to
(*unop).
* gm2/gm2-gcc/m2statement.h: corrected parameter (*unop) to
include the location_t parameter.
2013-04-25 Gaius Mulley <gaius@gnu.org>
* gm2/c.flex: changed variable names try into ctry to avoid compiler
warning.
* gm2/gm2-lang.c: (gimplify_expr_stmt) New function.
(gm2_langhook_gimplify_expr) reimplemented to gimplify THROW_EXPR
and EXPR_STMT.
* gm2/gm2-tree.def: fixed dates.
* gm2/m2pp.c: (m2pp_simple_expression) added CLEANUP_POINT_EXPR
handling. Check issue begin before exception related nodes to aid
pretty printing.
* gm2/gm2-gcc/m2except.c: huge rewrite to bring it into line with
the exception handling schema used in gcc-4.7.1. Use
m2statements to call the exception handling helper functions.
* gm2/gm2-gcc/m2statement.c: fixed typo in comment.
* gm2/gm2spec.c: change fseen_no_exceptions into fseen_exceptions
and invert logic.
* gm2/lang.opt: use fexceptions rather than fno-exceptions
and use the option value which by default is TRUE.
2013-04-18 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs/config-host: rebuilt.
* gm2/gm2-libs/config-host.in: fix to generate SIZEOF_long and
presence of struct timeval.
* gm2/gm2-libs/config-target: rebuilt.
* gm2/gm2-libs/config-target.in: fix to generate SIZEOF_long and
presence of struct timeval.
* gm2/gm2-libs/gm2-libs-host.h.in: add define for SIZEOF_LONG and
HAVE_TIMEVAL.
* gm2/gm2-libs/gm2-libs-target.h.in: add define for SIZEOF_LONG and
HAVE_TIMEVAL.
* gm2/Make-lang.in: (gm2.maintainer-reconfigure)
(gm2.maintainer-help) New rules.
* gm2/configure.in: fixed release number to 1.0.5.
* gm2/configure: rebuilt.
2013-04-11 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/m2type.c: (m2type_GetArrayNoOfElements) call
m2expr_FoldAndStrip to ensure array bounds are defined by
constants. (m2type_BuildArrayIndexType) call
m2expr_FoldAndStrip to ensure array bounds are defined by
constants. This fix allows DynamicStrings.mod to compile.
* gm2/gm2-gcc/m2type.c: (m2type_BuildEndRecord) removed call
to m2block_pushDecl.
2013-04-10 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-lang.c: comment out definition for LANG_HOOKS_GIMPLIFY_EXPR.
* gm2/gm2-compiler/M2ALU.mod: Convert top of stack to Integer type.
* gm2/gm2-compiler/M2GenGCC.mod: ensure that the global scope is in use in CodeEndFile,
CodeStartDefFile, CodeStartModFile. ConvertForComparison convert pointer types to
ADDRESS. Fix calls to BuildThrow to use a location initial parameter.
* gm2/gm2-compiler/M2Range.mod: (CodeWholeZero) convert const lit zero into the same
type as, e.
* gm2/gm2-gcc/m2block.c: added DEBUGGING macro and debugging prints.
* gm2/gm2-gcc/m2convert.c: (m2convert_BuildConvert) added more steps to aid debugging.
* gm2/gm2-gcc/m2convert.h: (m2convert_BuildConvert) changed parameter names.
* gm2/gm2-gcc/m2except.def: (BuildThrow) added missing initial parameter.
* gm2/gm2-gcc/m2expr.c: (gm2/gm2-gcc/m2expr.c) added conversion between
pointer types for MINUS_EXPR.
* gm2/gm2-gcc/m2statement.c: (m2statement_BuildEndFunctionCode) call
gm2_gimplify_function_node.
* gm2/gm2-gcc/m2treelib.c: (m2treelib_do_jump_if_bit) use m2expr_GetWordZero
rather than m2expr_GetIntegerZero.
* gm2/gm2-gcc/m2type.c: (m2type_InitBaseTypes) call m2expr_init.
2013-03-27 Gaius Mulley <gaius@gnu.org>
* gm2/gm2spec.c: intemediate checkin. With enough changes to allow the
libraries to compile.
* gm2/lang-specs.h: intemediate checkin. With enough changes to allow the
libraries to compile.
* gm2/lang.opt: changed help strings for options which are shared by C into
comments.
* gm2/gm2-compiler/M2GCCDeclare.mod: convert resolved constants into a
specific type.
* gm2/gm2-compiler/M2GenGCC.mod: (ConvertBinaryOperands) New procedure.
Convert binary operands into same types.
* gm2/gm2-compiler/M2Options.mod: Quiet default to TRUE.
* gm2/gm2-compiler/M2Range.mod: convert operands to IfOutsideLimits to
the same type.
* gm2/gm2-gcc/m2expr.c: convert operands to BuildLessThan to the same types.
* gm2/gm2-gcc/m2expr.def: (BuildAddAddress) New procedure function.
* gm2/gm2-gcc/m2expr.h: (BuildAddAddress) New procedure function.
* gm2/gm2-gcc/m2statement.c: BuildIndirectProcedureCall use TREE_VALUE (t)
rather than, t.
2013-03-22 Gaius Mulley <gaius@gnu.org>
* gm2/gm2spec.c: many bug fixes relating to using (*in_options)[]
rather than options[].
2013-03-20 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: added gm2/gm2-gcc/m2assert.o to list
of objects.
* gm2/TODO: added new future change request.
* gm2/gm2-lang.c: added -flocation= flag for internal debugging.
Tidied up file by removing some of the #if 0 code.
* gm2/gm2spec.c: re-written comment for clarity.
* gm2/lang-options.h: added -x and -flocation= options.
* gm2/lang.opt: added -flocation= and -x specifications.
* gm2/m2.flex: override the current location if -flocation is set.
* gm2/m2pp.c: add debugging code and also handle the expression node
POINTER_PLUS_EXPR.
* gm2/gm2-compiler/M2GenGCC.mod: added location to many of the build tree functions.
Also convert operands correctly in FoldBecomes. Added type checking in binary
operators.
* gm2/gm2-compiler/M2Options.def: (OverrideLocation, SetForcedLocation) New Procedures.
* gm2/gm2-compiler/M2Options.mod: (OverrideLocation, SetForcedLocation) Implemented.
* gm2/gm2-compiler/M2Quads.mod: Set types for intemediate constants when calculating
unbounded array indices.
* gm2/gm2-compiler/M2Range.mod: ensure that max min values are checked against the
same typed variable.
* gm2/gm2-compiler/M2System.def: add location to InitSystem.
* gm2/gm2-compiler/M2System.mod: add location to InitSystem.
* gm2/gm2-gcc/m2assert.h: added m2assert_AssertLocation prototype. Convert m2assert.h
to general modular style header file.
* gm2/gm2-gcc/m2block.c: ensure that all declarations are added to the BIND_EXPR_BODY.
* gm2/gm2-gcc/m2builtins.def: add location_t to many of the build tree procedure functions.
* gm2/gm2-gcc/m2convert.c: use m2assert_AssertLocation.
* gm2/gm2-gcc/m2decl.c: use m2assert_AssertLocation.
* gm2/gm2-gcc/m2except.c: use m2assert_AssertLocation.
* gm2/gm2-gcc/m2expr.c: use m2assert_AssertLocation. Fixed bugs in type conversion.
* gm2/gm2-gcc/m2expr.h: added m2expr_GetCardinalZero and m2expr_GetCardinalOne.
* gm2/gm2-gcc/m2options.h: M2Options_SetForcedLocation, M2Options_OverrideLocation (New
procedure functions).
* gm2/gm2-gcc/m2statement.c: use m2assert_AssertLocation.
* gm2/gm2-gcc/m2top.c: remove call to cgraph_finalize_compilation_unit.
* gm2/gm2-gcc/m2treelib.c: fix DoCall by using TREE_VALUE (l) rather than, l.
* gm2/gm2-gcc/m2type.c: use m2assert_AssertLocation.
* gm2/gm2-libs/FIO.mod: cast position to INTEGER before comparing it to the return
value for write.
* gm2/gm2-gcc/m2assert.c: (New file).
2013-02-21 Gaius Mulley <gaius@gnu.org>
* gm2/patches/gcc/4.7.1/01-patches: (New file).
* gm2/patches/gcc/4.7.1/02-patches: (New file).
2013-02-18 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-iso/RandomNumber.def: (New file).
* gm2/gm2-libs-iso/RandomNumber.mod: (New file).
2013-02-11 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-lang.c: removed reference to gm2-common.h.
* gm2/gm2-lang.h: include gm2_langhook_init and gm2_langhook_handle_option.
* gm2/gm2-gcc/m2options.h: corrected spelling of M2Options_setdefextension
and M2Options_setmodextension.
* gm2/gm2-compiler/M2DebugStack.def: (New file).
* gm2/gm2-compiler/M2DebugStack.mod: (New file).
* gm2/gm2-compiler/M2DriverOptions.def: (New file).
* gm2/gm2-compiler/M2DriverOptions.mod: (New file).
2013-02-09 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: build rules changed to enable gm2 to be built
with gcc-4.7.1.
* gm2/NEWS: minor version number change.
* gm2/config-lang.in: removed gcc-3.x.y version checking.
* gm2/configure: rebuilt.
* gm2/configure.in: updated as gccgm2.c is no longer used.
* gm2/gccgm2.c: (removed). The contents of this 12000 line file
have been replaced by the modular equivalent in gm2/gm2-gcc/*.[ch]
* gm2/gm2-common.h: (removed).
* gm2/gm2-common.c: (removed).
* gm2/gm2-lang.c: changed to use the gm2/gm2-gcc structure and gcc-4.7.1.
* gm2/gm2-lang.h: changed to use the gm2/gm2-gcc structure and gcc-4.7.1.
* gm2/gm2-tree.def: removed THROW_EXPR, TRY_BLOCK, HANDLER, EXPR_STMT definitions.
* gm2/gm2-tree.h: commented out the language tree code.
* gm2/gm2.texi: modified to reflect library command line switch changes between
1.0.1 and 1.0.4. Improved the assembly language example together with an explanation.
Added alignment information. Updated the Solaris building instructions.
* gm2/gm2config.h.in: (updated to reflect gcc-4.7.1).
* gm2/gm2spec.c: (updated to reflect gcc-4.7.1).
* gm2/lang-options.h: changed -fverbose-unbounded to -Wverbose-unbounded.
* gm2/lang.opt: changed so that libraries dialects can be ordered.
* gm2/m2.flex: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/m2pp.c: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/p2crc: added many more AvoidNames to avoid conflicts with C header files.
* gm2/version.c: updated to 1.0.5.
* gm2/bnf/gm2l.bnf: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/bnf/gm2m.bnf: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/bnf/m2-2.bnf: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/bnf/m2-3.bnf: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/bnf/m2-c.bnf: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/bnf/m2-h.bnf: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/bnf/m2.bnf: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/el/g-mode.el: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/examples/gravity/README: updated package versions required.
* gm2/examples/gravity/twoDsim.def: updated dates.
* gm2/examples/gravity/twoDsim.mod: updated dates and improved debugging.
* gm2/examples/gravity/doc/collision.ms: reorganised document.
* gm2/examples/hello/Makefile.in: modified build rules.
* gm2/examples/hello/hello.mod: added blank line.
* gm2/examples/map/AdvMap.def: removed BITSET import.
* gm2/gm2-compiler/Indexing.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2ALU.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2ALU.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Base.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Base.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Batch.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Batch.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Bitset.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2CaseList.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2CaseList.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Code.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Comp.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Comp.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Error.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2GCCDeclare.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2GCCDeclare.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2GenGCC.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2GenGCC.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2LexBuf.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2LexBuf.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2MetaError.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Options.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Options.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Preprocess.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Printf.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Quads.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Quads.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Range.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Range.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Reserved.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2Reserved.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2System.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/M2System.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/P2SymBuild.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/P2SymBuild.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/PCSymBuild.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/Sets.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/SymbolConversion.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/SymbolConversion.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/SymbolKey.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/SymbolKey.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/SymbolTable.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/SymbolTable.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/gccgm2.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/gm2.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/m2flex.def: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-compiler/ppg.mod: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/gm2-libs/Builtins.def: added alloca_trace for debugging.
* gm2/gm2-libs/Builtins.mod: implemented alloca_trace for debugging.
* gm2/gm2-libs/Indexing.mod: removed BITSET from imports.
* gm2/gm2-libs/M2RTS.def: removed BITSET from imports.
* gm2/gm2-libs/SYSTEM.def: removed BITSET from export list.
* gm2/gm2-libs/config-host: rebuilt.
* gm2/gm2-libs/config-host.in: updated version to 1.0.5.
* gm2/gm2-libs/config-target: rebuilt.
* gm2/gm2-libs/config-target.in: updated version to 1.0.5.
* gm2/gm2-libs-boot/SYSTEM.def: removed BITSET from export list.
* gm2/gm2-libs-coroutines/SYSTEM.def: removed BITSET from export list.
* gm2/gm2-libs-iso/README.texi: updated the list of implemented ISO Modules and GNU Modules.
* gm2/gm2-libs-iso/SYSTEM.def: export TBITSIZE.
* gm2/gm2-libs-iso/ServerSocket.mod: added missing, RETURN TRUE.
* gm2/gm2-libs-iso/StdChans.mod: changed to include 'raw' in the std file descriptors.
* gm2/gm2-libs-min/SYSTEM.def: removed BITSET from export list.
* gm2/gm2-libs-pim/BitBlockOps.mod: removed BITSET from import list.
* gm2/gm2-libs-pim/BitByteOps.mod: removed BITSET from import list.
* gm2/gm2-libs-pim/BitWordOps.mod: removed BITSET from import list.
* gm2/gm2-libs-pim/Random.def: fixed RandomBytes definition.
* gm2/gm2-libs-pim/Random.mod: fixed RandomBytes definition.
* gm2/init/gm2linit: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/init/gm2minit: updated to reflect gcc-4.7.1 and the new gm2/gm2-gcc structure.
* gm2/p2c/p2c.h: modified prototypes to use plain C.
* gm2/p2c/p2c-src/src/citmods.c: use TOUPPER rather than toupper, use TOLOWER rather than tolower.
* gm2/p2c/p2c-src/src/decl.c: test for WORD and use unsigned int.
* gm2/p2c/p2c-src/src/expr.c: use TOLOWER, ISSPACE, ISDIGIT, ISALPHA rather than their lower case
counterparts.
* gm2/p2c/p2c-src/src/funcs.c: use TOUPPER rather than the lower case counterpart.
* gm2/p2c/p2c-src/src/lex.c: register the uppercase functions: TOLOWER, TOUPPER, ISALPHA, ISDIGIT.
* gm2/p2c/p2c-src/src/p2clib.c: use ISSPACE and TOUPPER rather than their lower case counterparts.
* gm2/tools-src/def2texi.py: many changes to explicitly differentiate between the build and src directories.
* gm2/tools-src/mklink.c: modified so that the default library is NULL and new --lib specifies the library.
Also alter long options to use -- rather than -.
* gm2/ulm-lib-gm2/std/Archive.def: remove BITSET from import.
* gm2/ulm-lib-gm2/std/M2RTS.mod: remove BITSET from import.
* gm2/ulm-lib-gm2/std/MathLib.mod: remove BITSET from import.
* gm2/ulm-lib-gm2/std/Plot.mod: remove BITSET from import.
* gm2/ulm-lib-gm2/sys/SYSTEM.def: remove BITSET from import.
* gm2/ulm-lib-gm2/sys/SysIoctl.def: remove BITSET from import.
* gm2/ulm-lib-gm2/sys/SysStat.def: remove BITSET from import.
* gm2/ulm-lib-gm2/sys/SysStat.mod: remove BITSET from import.
* gm2/www/tools/texi2tr/html/download.html: modified url to reference gm2-1.0.4.
* gm2/www/tools/texi2tr/html/release.html: modified url to reference gm2-1.0.4.
2013-02-08 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/dynamicstrings.h: (New file).
* gm2/gm2-gcc/init.c: (New file).
* gm2/gm2-gcc/init.cpp: (New file).
* gm2/gm2-gcc/init.def: (New file).
* gm2/gm2-gcc/init.h: (New file).
* gm2/gm2-gcc/m2assert.h: (New file).
* gm2/gm2-gcc/m2block.c: (New file).
* gm2/gm2-gcc/m2block.def: (New file).
* gm2/gm2-gcc/m2block.h: (New file).
* gm2/gm2-gcc/m2builtins.c: (New file).
* gm2/gm2-gcc/m2builtins.def: (New file).
* gm2/gm2-gcc/m2builtins.h: (New file).
* gm2/gm2-gcc/m2convert.c: (New file).
* gm2/gm2-gcc/m2convert.def: (New file).
* gm2/gm2-gcc/m2convert.h: (New file).
* gm2/gm2-gcc/m2decl.c: (New file).
* gm2/gm2-gcc/m2decl.def: (New file).
* gm2/gm2-gcc/m2decl.h: (New file).
* gm2/gm2-gcc/m2except.c: (New file).
* gm2/gm2-gcc/m2except.def: (New file).
* gm2/gm2-gcc/m2except.h: (New file).
* gm2/gm2-gcc/m2expr.c: (New file).
* gm2/gm2-gcc/m2expr.def: (New file).
* gm2/gm2-gcc/m2expr.h: (New file).
* gm2/gm2-gcc/m2linemap.c: (New file).
* gm2/gm2-gcc/m2linemap.def: (New file).
* gm2/gm2-gcc/m2linemap.h: (New file).
* gm2/gm2-gcc/m2misc.c: (New file).
* gm2/gm2-gcc/m2misc.def: (New file).
* gm2/gm2-gcc/m2misc.h: (New file).
* gm2/gm2-gcc/m2options.h: (New file).
* gm2/gm2-gcc/m2search.h: (New file).
* gm2/gm2-gcc/m2statement.c: (New file).
* gm2/gm2-gcc/m2statement.def: (New file).
* gm2/gm2-gcc/m2statement.h: (New file).
* gm2/gm2-gcc/m2top.c: (New file).
* gm2/gm2-gcc/m2top.def: (New file).
* gm2/gm2-gcc/m2top.h: (New file).
* gm2/gm2-gcc/m2tree.c: (New file).
* gm2/gm2-gcc/m2tree.def: (New file).
* gm2/gm2-gcc/m2tree.h: (New file).
* gm2/gm2-gcc/m2treelib.c: (New file).
* gm2/gm2-gcc/m2treelib.def: (New file).
* gm2/gm2-gcc/m2treelib.h: (New file).
* gm2/gm2-gcc/m2type.c: (New file).
* gm2/gm2-gcc/m2type.def: (New file).
* gm2/gm2-gcc/m2type.h: (New file).
* gm2/gm2-gcc/README: (New file).
2013-01-09 Gaius Mulley <gaius@gnu.org>
* gm2/gm2.texi: updated the building process for OpenBSD
and NetBSD.
2013-01-07 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-iso/SShortWholeIO.def: (added file).
* gm2/gm2-libs-iso/SShortWholeIO.mod: (added file).
* gm2/gm2-libs-iso/SShortIO.def: (added file).
* gm2/gm2-libs-iso/SShortIO.mod: (added file).
* gm2/gm2-libs-iso/SLongWholeIO.def: (added file).
* gm2/gm2-libs-iso/SLongWholeIO.mod: (added file).
* gm2/gm2-libs-iso/ShortIO.def: (added file).
* gm2/gm2-libs-iso/ShortIO.mod: (added file).
* gm2/gm2-libs-iso/LongWholeIO.def: (added file).
* gm2/gm2-libs-iso/LongWholeIO.mod: (added file).
* gm2/gm2-libs-iso/ShortWholeIO.def: (added file).
* gm2/gm2-libs-iso/ShortWholeIO.mod: (added file).
* gm2/gm2/Make-lang.in: added the following modules
to be built and installed as part of the ISO libraries:
SShortIO.mod, SShortIO.def, SLongWholeIO.mod, SLongWholeIO.def,
ShortWholeIO.def, ShortIO.def, LongWholeIO.def, SShortWholeIO.mod
ShortWholeIO.mod, ShortIO.mod, LongWholeIO.mod
* gm2/gm2-compiler/M2Base.mod: fixed bug, which omitted to declare
MaxShortInt, MinShortInt, MaxShortCard, MinShortCard.
* gm2/gm2-libs-iso/README.texi: updated list of ISO style modules
and their respective copyrights. Minor documentation added.

936
gcc/m2/ChangeLog-2014 Normal file
View File

@@ -0,0 +1,936 @@
2014-12-24 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/pge.py: interim checkin.
* gm2/gm2-compiler/SymbolTable.mod: corrected declaration of
PutDeclaredModule as reported by Christoph Schlegel.
* gm2/gm2-libs-ch/sckt.c: added conditional import of
stdio.h as reported by Christoph Schlegel.
2014-12-22 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/run: changed name of python script.
* gm2/examples/swig/strlen/MyStrLib.i: deleted.
* gm2/tools-src/createUlmSys: added SYSTEM_UNIXFORK and
SYSTEM_UNIXSIGNAL.
2014-12-09 Gaius Mulley <gaius@gnu.org>
* gm2/config-lang.in: added new gm2/examples/shared,
gm2/examples/full-strlib and gm2/examples/strio examples to the
list of Makefiles to be generated via configure.
* gm2/examples/swig/exceptions/Makefile.in: rewritten to use
libtool.
* gm2/examples/swig/exceptions/stresstiny.py: removed unnecessary
qualification.
* gm2/examples/swig/exceptions/testtiny.py: removed unnecessary
qualification.
* gm2/examples/swig/exceptions/tiny.def: renamed to libtiny.def.
* gm2/examples/swig/exceptions/tiny.mod: renamed to libtiny.mod.
* gm2/examples/swig/strio/Makefile: deleted.
* gm2/examples/swig/strlib/Makefile.in: rewritten to use libtool.
* gm2/examples/swig/strlib/MyStrLib.def: renamed as libStrLib.def.
* gm2/examples/swig/strlib/MyStrLib.mod: renamed as libStrLib.mod.
* gm2/gm2.texi: rewritten sections on building shared libraries
and interface to python using swig given that gm2 now uses libtool.
2014-12-06 Gaius Mulley <gaius@gnu.org>
* gm2/examples/swig/dual/Makefile.in: removed unnecessary $(RM).
* gm2/examples/swig/tiny/Makefile.in: removed unnecessary $(RM).
* gm2/lang-specs.h: changed invocation of -fswig, -fmakelist, -fmakeinit which
can only be issued with -c and none of them will generate a .s (or .o) file.
The compiler is disabled from producing an output file using %V.
2014-12-05 Gaius Mulley <gaius@gnu.org>
* gm2/config-lang.in: added entry for new test example dual.
* gm2/examples/hello/Makefile.in: fixed example to build, added
reference to stdc++.
* gm2/examples/pge/Makefile.in: changed name of pge.py to pgepygame.py.
* gm2/examples/pge/pge.py: first cut of a python interface to pge.
* gm2/examples/pge/twoDsim.def: moved whereHit back to the definition
module.
* gm2/examples/pge/twoDsim.mod: moved whereHit back to the definition
module.
* gm2/examples/swig/tiny/Makefile.in: rewrote build rules as shared libraries
are now built using libtool.
* gm2/examples/swig/tiny/libtiny.def: rename tiny.def as libtiny.def to comply
with libtool.
* gm2/examples/swig/tiny/libtiny.mod: rename tiny.def as libtiny.def to comply
with libtool.
* gm2/examples/swig/tiny/testtiny.py: import libtiny instead of tiny.
* gm2/gm2-compiler/gm2lcc.mod: shared libraries are built using libtool changes
to allow this tool to deal with .lo, la files. Separate -L from -l as ar
does not understand -L. Long options now require --. (--main, --exec,
--ignoremain, --startup).
* gm2/gm2-compiler/gm2lgen.mod: Long options now require -- (--terminate,
--initial, --exit, --main).
* gm2/gm2-libs/FIO.mod: corrected dates.
* gm2/gm2-libs/libc.def: corrected dates.
* gm2/gm2spec.c: corrected formatting. gen_link_path (New function).
Use gen_link_path rather than add_include.
* gm2/lang-specs.h: changed all gm2lcc and gm2lgen long options to comply
with the new -- delimiter.
2014-11-04 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/m2expr.c: (m2expr_BuildForeachWordInSetDoIfExpr) add additional
parameter to m2expr_BuildForeachWordInSetDoIfExpr (is_lvalue).
* gm2/gm2-gcc/m2treelib.c: (m2treelib_get_set_value) extra parameter,
is_lvalue, which builds a component ref using an indirect value.
* gm2/gm2-gcc/m2treelib.h: added new parameter to prototype.
* gm2/m2pp.c: (m2pp_bit_ior_expr) New function.
2014-10-30 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/popWorld.def: tidied up comment.
* gm2/examples/pge/popWorld.mod: tidied up comment.
* gm2/examples/pge/twoDsim.def: tidied up comment and moved a type definition
into the implementation module.
* gm2/examples/pge/twoDsim.mod: added type definition.
* gm2/gm2-compiler/M2GCCDeclare.mod: (AlignProcedureWithSource) removed procedure.
(DeclareProcedureToGccWholeProgram), (DeclareProcedureToGccSeparateProgram)
call GetProcedureBeginEnd to obtain the position of the BEGIN END tokens for
accurate debugging info.
* gm2/gm2-compiler/M2GenGCC.mod: (CodeNewLocalVar) and (CodeKillLocalVar)
also obtain the position of the BEGIN END tokens for accurate debugging info.
* gm2/gm2-compiler/M2Quads.mod: (BuildProcedureBegin) call PutProcedureBegin to
save the BEGIN location. (BuildProcedureEnd) call PutProcedureEnd to
save the END location.
* gm2/gm2-compiler/SymbolTable.def: (PutProcedureBegin) define new procedure.
(PutProcedureEnd) define new procedure.
* gm2/gm2-compiler/SymbolTable.mod: (PutProcedureBegin) implement new procedure.
(PutProcedureEnd) implement new procedure.
* gm2/gm2-libs-iso/IOChan.mod: (Look) fix bug to ensure the result is set to the
result of the look.
* gm2/gm2-libs-iso/RTfio.def: changed specification of iseoln to avoid having to
read ahead an extra character.
* gm2/gm2-libs-iso/RTfio.mod: use FIO.WasEOLN rather than FIO.EOLN.
(checkPostRead) corrected comment. (setReadResult) changed order of
if statements (check worst condition first).
* gm2/gm2-libs-iso/RTgen.mod: (doLook) restore old result, but return newer
result in r.
* gm2/gm2-libs/FIO.def: (WasEOLN) new procedure function.
* gm2/gm2-libs/FIO.mod: (WasEOLN) new procedure function implemented. Introduced
new state endofline which is set appropriately.
2014-10-23 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GCCDeclare.mod: (BuildEndFunctionDeclaration) introduce
begin, end locations. (finishFunctionDecl) add location parameter.
* gm2/gm2-compiler/M2GenGCC.mod: (finishFunctionDecl) extra parameter.
* gm2/gm2-compiler/M2Quads.mod: (BuildProcedureBegin) and (BuildProcedureEnd)
record the tokenno of the BEGIN or END respectively.
* gm2/gm2-gcc/m2block.c: (finishFunctionDecl) sets location in the bind_expr.
* gm2/gm2-gcc/m2block.def: (finishFunctionDecl) additional parameter.
* gm2/gm2-gcc/m2block.h: (finishFunctionDecl) additional parameter.
* gm2/gm2-gcc/m2decl.c: (BuildEndFunctionDeclaration) begin and end
location parameters.
* gm2/gm2-gcc/m2decl.def: (BuildEndFunctionDeclaration) begin and end
location parameters.
* gm2/gm2-gcc/m2decl.h: (BuildEndFunctionDeclaration) begin and end
location parameters.
* gm2/gm2-gcc/m2except.c: pass additional parameter for builtin functions.
* gm2/gm2-gcc/m2statement.c: (SetBeginLocation), (SetEndLocation) New procedures.
* gm2/gm2-gcc/m2statement.def: (SetBeginLocation), (SetEndLocation) New procedures.
* gm2/gm2-gcc/m2statement.h: (SetBeginLocation), (SetEndLocation) New procedures.
* gm2/gm2-gcc/m2top.c: tidied up spacing.
* gm2/gm2spec.c: remember_link_arg extra parameter.
* gm2/m2pp.c: added debugging stub.
2014-10-14 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-iso/RTgen.mod: (setReadResult) New procedure.
Modified doLook to use setReadResult.
* gm2/gm2spec.c: started refactoring. Introduced and used AS and GM2CC
macros. Use cc1 or cc1plus rather than gm2cc. gm2cc is no longer needed.
* gm2/Make-file.in: removed all references to gm2cc.
2014-10-10 Gaius Mulley <gaius@gnu.org>
* testsuite/gm2/pim/pass/gm2.exp: added more paths.
* testsuite/lib/gm2.exp: refactored gm2_init_pim and friends.
2014-10-09 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2ALU.mod: use GetDeclaredMod as a replacement for GetDeclared.
* gm2/gm2-compiler/M2Base.mod: use GetDeclaredMod as a replacement for GetDeclared.
* gm2/gm2-compiler/M2GCCDeclare.mod: use GetDeclaredMod as a replacement for GetDeclared.
* gm2/gm2-compiler/M2GenGCC.mod: use GetDeclaredMod as a replacement for GetDeclared.
* gm2/gm2-compiler/M2MetaError.def: provide %1M as a formatting specification.
* gm2/gm2-compiler/M2MetaError.mod: implement %1M as a formatting specification.
* gm2/gm2-compiler/M2Optimize.mod: use GetDeclaredMod as a replacement for GetDeclared.
* gm2/gm2-compiler/M2Quads.mod: use GetDeclaredMod as a replacement for GetDeclared.
Also use tokenno rather than line number in NewLocalVar and KillLocalVar.
* gm2/gm2-compiler/M2Students.mod: use GetDeclaredMod as a replacement for GetDeclared.
* gm2/gm2-compiler/P1SymBuild.mod: record location of implementation and definition module
when declaring procedures.
* gm2/gm2-compiler/P2SymBuild.mod: record location of implementation and definition module
when declaring procedures.
* gm2/gm2-compiler/PCSymBuild.mod: use GetDeclaredMod as a replacement for GetDeclared.
* gm2/gm2-compiler/SymbolTable.def: export GetDeclaredMod and GetDeclaredDef.
* gm2/gm2-compiler/SymbolTable.mod: implement GetDeclaredMod and GetDeclaredDef.
(New procedure) GetDeclaredDefinition. (New procedure) GetDeclaredModule.
* gm2/gm2-gcc/m2block.c: removed debugging traps.
* gm2/gm2-gcc/m2expr.c: tidied formatting.
* gm2/gm2-gcc/m2statement.c: removed unnecessary code.
(add_stmt) changed to record location.
* gm2/gm2-gcc/m2treelib.c: allow component refs to be deferenced by pointers.
* gm2/gm2-libs-iso/RTgen.mod: skip a character without pushing it back twice in
succession.
* gm2/m2pp.c: introduce line file numbers into the source code dump.
* testsuite/gm2/calling-c/datatypes/unbounded/run/pass/gm2.exp: many changes to
simplify the setting up of the chosen dialect and libraries. All
obvious invocations to gm2_init are replaced by gm2_init_pim, gm2_init_iso,
gm2_init_ulm, gm2_init_log, gm2_init_cor.
* testsuite/gm2/case/pass/gm2.exp: as above.
* testsuite/gm2/complex/pass/gm2.exp: as above.
* testsuite/gm2/complex/run/pass/gm2.exp: as above.
* testsuite/gm2/coroutines/pim/run/pass/gm2.exp: as above.
* testsuite/gm2/cpp/pass/gm2.exp: as above.
* testsuite/gm2/cse/fail/gm2.exp: as above.
* testsuite/gm2/cse/pass/gm2.exp: as above.
* testsuite/gm2/dynamic/pass/gm2.exp: as above.
* testsuite/gm2/embedded/pass/gm2.exp: as above.
* testsuite/gm2/errors/fail/gm2.exp: as above.
* testsuite/gm2/examples/callingC/pass/gm2.exp: as above.
* testsuite/gm2/examples/callingC/run/pass/gm2.exp: as above.
* testsuite/gm2/examples/cpp/pass/gm2.exp: as above.
* testsuite/gm2/examples/cppDef/pass/gm2.exp: as above.
* testsuite/gm2/examples/hello/pass/gm2.exp: as above.
* testsuite/gm2/examples/map/pass/gm2.exp: as above.
* testsuite/gm2/exceptions/run/pass/gm2.exp: as above.
* testsuite/gm2/extensions/pass/gm2.exp: as above.
* testsuite/gm2/extensions/run/fail/gm2.exp: as above.
* testsuite/gm2/extensions/run/pass/gm2.exp: as above.
* testsuite/gm2/imports/run/pass/gm2.exp:as above.
* testsuite/gm2/iso/fail/gm2.exp: as above.
* testsuite/gm2/iso/pass/gm2.exp: as above.
* testsuite/gm2/iso/run/pass/gm2.exp: as above.
* testsuite/gm2/isocoroutines/run/pass/gm2.exp: as above.
* testsuite/gm2/isolib/run/pass/gm2.exp: as above.
* testsuite/gm2/link/pim/fail/gm2.exp: as above.
* testsuite/gm2/link/pim/fail/import.mod: as above.
* testsuite/gm2/link/pim/pass/gm2.exp: as above.
* testsuite/gm2/linking/libarchive/pass/gm2.exp: as above.
* testsuite/gm2/pim/fail/gm2.exp: as above.
* testsuite/gm2/pim/options/bounds/fail/gm2.as above.exp:
* testsuite/gm2/pim/options/optimize/run/pass/gm2.expas above.:
* testsuite/gm2/pim/pass/gm2.exp: as above.
* testsuite/gm2/pim/run/fail/gm2.exp: as above.
* testsuite/gm2/pim/run/pass/gm2.exp: as above.
* testsuite/gm2/pimcoroutines/pass/gm2.exp: as above.
* testsuite/gm2/pimlib/coroutines/pass/gm2.exp: as above.
* testsuite/gm2/pimlib/logitech/pass/gm2.exp: as above.
* testsuite/gm2/pimlib/logitech/run/pass/gm2.exp: as above.
* testsuite/gm2/pimlib/pass/gm2.exp: as above.
* testsuite/gm2/pimlib/run/pass/gm2.exp: as above.
* testsuite/gm2/pimlib/ulm/run/pass/gm2.exp: as above.
* testsuite/gm2/quads/run/pass/gm2.exp: as above.
* testsuite/gm2/switches/check-all/run/fail/gm2.exas above.p:
* testsuite/gm2/switches/check-all/run/pass/gm2.exp:as above.
* testsuite/gm2/switches/extended-opaque/fail/gm2.exp: as above.
* testsuite/gm2/switches/extended-opaque/pass/gm2.exp: as above.
* testsuite/gm2/switches/iso/run/pass/gm2.exp: as above.
* testsuite/gm2/switches/makeall/fail/gm2.exp: as above.
* testsuite/gm2/switches/optimization/run/pass/gm2.exp: as above.
* testsuite/gm2/switches/pedantic-params/fail/gm2.exp: as above.
* testsuite/gm2/switches/pedantic-params/pass/gm2.exp: as above.
* testsuite/gm2/switches/pic/run/pass/gm2.exp: as above.
* testsuite/gm2/switches/pim2/run/pass/gm2.exp: as above.
* testsuite/gm2/switches/pim3/run/pass/gm2.exp: as above.
* testsuite/gm2/switches/pim4/run/pass/gm2.exp: as above.
* testsuite/gm2/types/run/pass/gm2.exp: as above.
* testsuite/gm2/ulmlib/pass/gm2.exp: as above.
* testsuite/gm2/ulmlib/std/pass/gm2.exp: as above.
* testsuite/gm2/ulmlib/sys/pass/gm2.exp: as above.
2014-10-03 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs/FpuIO.mod: ensure that the debugging preprocessing
directives are only turned on by a specific flag.
* gm2/gm2spec.c: remove GM2_ROOT environment variable and use
GM2_PREFIX and GM2_LIBEXEC instead. These override the --prefix
and --libexec strings used at compile time and allow users to move
the complete tree of binaries to a different directory hierarchy.
2014-10-01 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2Code.mod: tidied up text in qprintf0
* gm2/gm2-compiler/M2Comp.mod: tidied up text in qprintf0
* gm2/gm2-gcc/m2top.def: removed non needed procedure.
* gm2/gm2-gcc/m2top.h: removed non needed function.
2014-09-30 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: removed sckt.c from being built.
* gm2/bnf/gm2l.bnf: corrected import of procedures from Lists.
* gm2/bnf/gm2m.bnf: added import of DEALLOCATE.
* gm2/gm2-compiler/M2Batch.def: added export of LookupModule, LookupOuterModule.
* gm2/gm2-compiler/M2Batch.mod: added import of GetSym.
* gm2/gm2-compiler/M2Comp.mod: added descriptions for each pass.
* gm2/gm2-compiler/M2Error.def: (New procedure declarations) WarnFormat0, WarnFormat1.
* gm2/gm2-compiler/M2Error.mod: (New procedures) WarnFormat0, WarnFormat1.
* gm2/gm2-compiler/M2Pass.def: added IsPassC to export list.
* gm2/gm2-compiler/M2Range.mod: import BuildGreaterThanOrEqual.
* gm2/gm2-compiler/P1SymBuild.mod: added import of procedures from List.
* gm2/gm2-libs-ch/dtoa.c: corrected dates and tidied up spacing.
* gm2/gm2-libs-ch/wrapc.c: corrected dates and tidied up spacing.
* m2/configure: regenerated.
* m2/configure.ac: removed verbose messages.
* make gm2.paranoid now works on Wheezy.
2014-09-28 Gaius Mulley <gaius@gnu.org>
* libgm2/config.h.in: removed HAVE_GETTIMEOFDAY, added HAVE_STRUCT_TIMEVAL,
removed TIME_WITH_SYS_TIME.
* libgm2/configure: rebuilt.
* libgm2/configure.ac: removed AC_HEADER_TIME. Check for struct timeval.
Added GM2_UNDEF macro. GM2_CHECK_LIB rewritten.
* libgm2/libpim/Selective.c: use HAVE_STRUCT_TIMEVAL rather than HAVE_SELECT.
2014-09-27 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/macroObjects.def: fixed parameter names so that
implementation and definition modules match.
* gm2/examples/pge/twoDsim.mod: commented out include.
* gm2/gm2-compiler/M2Comp.mod: only attempt to parse an implementation
if the filename is found. This avoids a bug when -fcpp -fm2-whole-program
was used.
* gm2/gm2-compiler/M2Preprocess.mod: corrected dates.
* gm2/gm2-compiler/M2Preprocess.mod: tidied up formatting.
* gm2/gm2-libs/DynamicStrings.mod: guard against the #defines from being
invoked necessary as users may now use -fcpp and -fm2-whole-program and thus
turn on internal debugging of gm2 libraries.
* gm2/gm2-libs/FormatStrings.mod: as above.
* gm2/gm2-libs/FpuIO.mod: as above.
* gm2/gm2-libs/SArgs.mod: as above.
* gm2/gm2-libs/SEnvironment.mod: as above.
* gm2/gm2-libs/SFIO.mod: as above.
* gm2/gm2-libs/StringConvert.mod: as above.
* gm2/lang-specs.h: changed formatting.
2014-09-23 Gaius Mulley <gaius@gnu.org>
* gm2/config-lang.in: added entry for gm2/examples/pge/Makefile.
* gm2/gm2-compiler/M2Range.mod: rewritten CodeForLoopEnd.
(SameTypesCodeForLoopEnd) New procedure.
(DiffTypesSameForLoopEnd) New procedure.
All regression tests pass under Debian Wheezy amd64.
* gm2/examples/pge/Makefile.in: fixed post rules for world.
* gm2/gm2-libs/config-host: rebuilt.
* gm2/gm2-libs/config-host.in: 1.0.9.
* gm2/gm2-libs/config-target: rebuilt.
* gm2/gm2-libs/config-target.in: 1.0.9.
* gm2/gm2.texi: updated release map.
* gm2/gm2spec.c: removed C++ comment.
* gm2/version.c: 1.0.9.
* Released 1.0.9 Beta Release.
2014-09-17 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2Range.mod: minor fixes which solve
testsuite/gm2/pim/run/pass/For5.mod.
* gm2/gm2-libs-iso/RTgen.mod: include guards to ensure that
the do procedure functions are only called if >0 bytes are
to be read/written.
2014-09-16 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2Quads.mod: removed RangeCheck quadruples from
changing the read/write lists. Also removed PutWriteQuad
from being called inside MarkAsRead. More regression tests pass.
(testsuite/gm2/errors/fail/testfio.mod)
(testsuite/gm2/errors/fail/testinit.mod)
* gm2/gm2.texi: changed the -fstatistics entry to -fm2-statistics.
Added entry for -fm2-whole-program.
* gm2/examples/pge/Makefile: corrected rules to whole and foo
and introduced $(CHECK).
* examples/pge/history.mod: hide debugging.
* gm2/examples/pge/twoDsim.mod: hide debugging.
* gm2/gm2-compiler/M2Range.mod: fixed bug in CodeEndForLoop.
2014-09-15 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/foo.mod: added comment.
* gm2/gm2-compiler/M2Code.mod: removed references to StrIO and
NumberIO and replaced them with printf0 and printf1.
Re-introduced OptimizationAnalysis which also reports on
total source lines compiled.
* gcc/gm2/gm2-compiler/M2Options.def: SetStatistic (New procedure).
* gcc/gm2/gm2-compiler/M2Options.def: SetStatistic (New procedure)
implemented.
* gm2/gm2-gcc/m2options.h: SetStatistic (New prototype).
* gm2/gm2-lang.c: handle -fm2-statistics.
* gm2/lang-options.h: enumerate -fm2-statistics.
* gm2/lang.opt: enumerate -fm2-statistics.
* gm2/m2.flex: include timevar.h. Call timevar_push, timevar_pop
inside m2flex_GetToken.
2014-09-14 Gaius Mulley <gaius@gnu.org>
* gm2/README: corrected language (gm2) and removed enable-__cxa_atexit.
* gm2/README: fixed source to sources.
* libgm2/libpim/Selective.c: use HAVE_SELECT rather than HAVE_TIMEVAL.
2014-09-13 Gaius Mulley <gaius@gnu.org>
* the majority of these changes fix a bug reported by John O Goyo
(see testsuite/gm2/imports/run/pass/innermods.mod in cc1gm2.
* gm2/Make-lang.in: added P0SymBuild.mod into list of modules. Added
build rule for m2-1.bnf and changed m2.bnf because of new file name.
Changed calls to $(M2LINK) to include --name option.
* gm2/gm2-compiler/M2Batch.def: (LookupModule) New procedure definition.
(LookupOuterModule) New procedure definition.
* gm2/gm2-compiler/M2Batch.mod: (LookupOuterModule) New procedure function.
(LookupModule) New procedure function.
* gm2/gm2-compiler/M2Comp.mod: introduced new Pass0.
* gm2/gm2-compiler/M2GCCDeclare.mod: modified debugging.
* gm2/gm2-compiler/M2Inline.def: Removed file.
* gm2/gm2-compiler/M2Inline.mod: Removed file.
* gm2/gm2-compiler/M2Pass.def: (IsPass0) New procedure function.
* gm2/gm2-compiler/P0SymBuild.mod: New file, generate a scope tree.
* gm2/gm2-compiler/P1SymBuild.mod: changed to follow the scope tree
generated during pass0.
* gm2/gm2-compiler/P1SyntaxCheck.def: removed file.
* gm2/gm2-compiler/P2SymBuild.mod: use LookupModule instead
of MakeDefinitionSource.
* gm2/gm2-compiler/P3SymBuild.mod: use LookupModule instead
of MakeDefinitionSource.
* gm2/gm2-compiler/PCSymBuild.mod: use LookupModule instead
of MakeDefinitionSource.
* gm2/gm2-compiler/P0SymBuild.mod:
* gm2/gm2-compiler/SymbolTable.def:
(PutModuleContainsBuiltin) New procedure definition.
(IsBuiltinInModule) New procedure function definition.
(PutHiddenTypeDeclared) New procedure definition.
(IsHiddenTypeDeclared) New procedure function definition.
* gm2/gm2-compiler/SymbolTable.mod:
(ContainsBuiltin) new field in DefImp.
(PutModuleContainsBuiltin) New procedure.
(IsBuiltinInModule) New procedure function.
(PutExported) allow modules to be imported from.
* gm2/gm2-compiler/m2flex.def: (GetTotalLines)
New function definition.
* gm2/init/gm2-gccinit: added P0SymBuild.
* gm2/m2.flex: (m2flex_GetTotalLines) New function.
* gm2/tools-src/mklink.c: honour CFLAGS and LDFLAGS
(fixes a build problem on 64 bit Solaris, reported by
John O Goyo).
* testsuite/gm2/errors/fail/gm2.exp:
* testsuite/gm2/errors/fail/testfio.mod:
* testsuite/gm2/imports/run/pass/c.def:
* testsuite/gm2/imports/run/pass/c.mod:
* testsuite/gm2/imports/run/pass/gm2.exp:
* testsuite/gm2/imports/run/pass/innermods3.mod:
* m2/libmin/Makefile.am: build SYSTEM.def with -fno-exceptions
* m2/libmin/Makefile.in: regenerated.
* gm2/bnf/m2-1.bnf: new file (copied from m2.bnf with
some name changes).
* gm2/bng/m2.bnf: new contents (pass 0).
* gm2/gm2-compiler/P0SymBuild.def: New file.
* gm2/gm2-compiler/P0SymBuild.mod: New file.
2014-09-04 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/m2builtins.c: corrected spelling for huge_val, huge_valf,
huge_vall.
2014-09-03 Gaius Mulley <gaius@gnu.org>
* libgm2/config.h.in: rebuilt.
* libgm2/configure: rebuilt.
* libgm2/configure.ac: fixes to the GM2_CHECK_LIB macro to correctly
test for the existence of library functions.
* gm2/configure.in: added test for whether the pth library exists
and issue a warning if it does not.
* gm2/gm2-lang.c: new option -fno-pth. Do not link against -lpth.
* gm2/gm2.texi: document new option.
* gm2/gm2spec.c: implement the new option, by default -lpth is included
into the link process. Add the library before -lstdc++.
* gm2/lang-options.h: entry for new option.
* gm2/lang.opt: entry for new option.
2014-09-02 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: removed unnecessary SO, SO_O2, O2 library build
rules.
* gm2/gm2-compiler/SymbolTable.mod: removed unnecessary Type, Size, Offset
fields from Module, DefImp symbols. Also removed their initialisation.
2014-08-30 Gaius Mulley <gaius@gnu.org>
* gm2/bnf/gm2m.bnf: fixed bug so that nested local modules
propagate their imported modules outwards.
(see testsuite/gm2/imports/run/pass/innermods3.mod).
* gm2/bnf/m2.bnf: corrected dates.
* gm2/bnf/gm2l.bnf: commented out printfs.
* rebuild the all configure files changed by the gm2 front
end.
* rebuilt all patch files.
(gm2/patches/gcc/4.7.3/01-patches, gm2/patches/gcc/4.7.3/02-patches,
gm2/patches/gcc/4.7.3/03-patches, gm2/patches/gcc/4.7.3/04-patches,
gm2/patches/gcc/4.7.3/05-patches, gm2/patches/gcc/4.7.3/12-patches)
2014-08-29 Gaius Mulley <gaius@gnu.org>
* gm2/bnf/gm2m.bnf: fixed bug reported by John O Goyo
(see testsuite/gm2/imports/run/pass/innermods.mod and
testsuite/gm2/imports/run/pass/innermods2.mod).
Maintain a block of nested modules and allow inner modules
to import objects via FROM x statements. (BeginBlock)
New procedure. (EndBlock) New procedure. (RegisterLocalModule)
New procedure. (RegisterImport) New procedure. The ebnf
rules were extended to nearly the complete language (with the exception
of full parsing of definition modules). Similar to gm2l except
the block retains the module level.
2014-08-28 Gaius Mulley <gaius@gnu.org>
* gm2/bnf/gm2l.bnf: fixed bug reported by John O Goyo
(see testsuite/gm2/imports/run/pass/innermods.mod).
Maintain a block of nested modules and allow inner modules
to import objects via FROM x statements. (BeginBlock)
New procedure. (EndBlock) New procedure. (RegisterLocalModule)
New procedure. (RegisterImport) New procedure. The ebnf
rules were extended to nearly the complete language (with the exception
of full parsing of definition modules).
* gm2/examples/hello/Makefile.in: (pre-install-whole) New rule.
* gm2/examples/map/Makefile.in: (pre-install-whole) New rule.
* gm2/examples/pge/Makefile: (whole) New interim rule.
* gm2/gm2-compiler/M2AsmUtil.mod: import IsDefinitionForC.
2014-08-17 Gaius Mulley <gaius@gnu.org>
* gm2/examples/map/Makefile.in: (pre-install-whole) corrected rule.
* gm2/examples/pge/Indexing.def: removed file.
* gm2/examples/pge/Indexing.mod: removed file.
* gm2/gm2-libs/FIO.mod: modified so that it can be compiled under -fiso.
* gm2/gm2-libs/Indexing.mod: modified so that it can be compiled under -fiso.
2014-08-16 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: use new libgm2.a when building stage2.
* gm2/examples/map/Makefile.in: (pre-install-whole) New rule.
* gm2/gm2-compiler/M2AsmUtil.mod: (SymNeedsModulePrefix)
New procedure function. (GetModulePrefix) use SymNeedsModulePrefix.
* gm2/gm2-compiler/M2Batch.def: (ForeachSourceModuleDo) new procedure.
(IsSourceSeen) new procedure function.
* gm2/gm2-compiler/M2Batch.mod: implement ForeachSourceModuleDo
and IsSourceSeen.
* gm2/gm2-compiler/M2Code.mod: import WholeProgram and modify (Code)
and dependent procedures to behave differently if WholeProgram is
set.
* gm2/gm2-compiler/M2Comp.mod: (NeedToParseImplementation) New procedure
function.
* gm2/gm2-compiler/M2GCCDeclare.mod: import WholeProgram and modify
declaration of procedure/module/types/variables to behave differently
if WholeProgram is set.
* gm2/gm2-compiler/M2GenGCC.mod: (IsExportedGcc) New procedure function.
CodeStartModFile pushes the module scope and the global scope.
CodeStartDefFile removed unnecessary code. CodeEndFile call
popGlobalScope. CodeProcedureScope use IsExportedGcc instead of IsExported.
Change CompilingMainModule to CompilingMainModule OR WholeProgram.
* gm2/gm2-compiler/M2Options.def: (DebugTraceQuad, DebugTraceAPI) New
internal options. (SetDebugTraceQuad) New procedure definition.
(SetDebugTraceAPI) New procedure definition.
* gm2/gm2-compiler/M2Options.mod: (SetWholeProgram) remove return type.
(SetDebugTraceQuad) implemented. (SetDebugTraceAPI) implemented.
* gm2/gm2-compiler/M2Scope.def: (DisplayScope) New procedure.
* gm2/gm2-gcc/m2options.h: (SetDebugTraceQuad) exported.
(SetDebugTraceAPI) exported.
* gm2/gm2-lang.c: added case for OPT_fdebug_trace_quad and
OPT_fdebug_trace_api.
* gm2/lang-options.h: added entry for -fm2-whole-program.
* gm2/lang.opt: added entry for -fdebug-trace-quad, -fdebug-trace-api
and -fm2-whole-program.
* many testsuite scripts corrected to reflect the new library locations.
2014-07-30 Gaius Mulley <gaius@gnu.org>'
* gm2/gm2-compiler/M2Comp.mod: corrected logical expression in
NeedToParseImplementation.
2014-07-29 Gaius Mulley <gaius@gnu.org>
* gm2/README: updated preferred snapshot test release. Use git rather
than CVS. Changed configuring advice as using 4.7.3 rather than 4.1.2.
* gm2/gm2-compiler/M2Comp.mod: start of changes which allow -fwhole-program
to be effective.
* gm2/gm2-compiler/M2Options.def: (WholeProgram) new variable, define
and export. (SetWholeProgram) New procedure.
* gm2/gm2-compiler/M2Options.mod: (SetWholeProgram) New procedure implemented.
WholeProgram default to FALSE.
* gm2/gm2-compiler/M2System.mod: allow user to import SIZE from ISO SYSTEM.
Not strictly ISO but it is more flexible with -fwhole-program which will
want to compile everything in a single dialect.
* gm2/gm2-gcc/m2options.h: (M2Options_SetWholeProgram) New declaration.
* gm2/gm2-lang.c: process -fwhole-option by calling M2Options_SetWholeProgram.
* gm2/gm2-libs-iso/SYSTEM.def: add SIZE to export qualified list.
* gm2/lang.opt: add -fwhole-option to list of legal Modula-2 options.
* testsuite/gm2/calling-c/datatypes/unbounded/run/pass/gm2.exp: correct
path to retieve path and libraries from the build area and avoid
the install area.
* libgm2/config.h.in: rebuilt.
* libgm2/configure: rebuilt.
* libgm2/configure.ac: define GM2_CHECK_LIB macro and use it to
safely detect the presence of all used libc and libm functions
used by the Modula-2 libraries.
2014-07-23 Gaius Mulley <gaius@gnu.org>
* fixes to the regression testsuite gm2.exp files to pick up the
libraries from the new build locations.
* libgm2/libiso/Makefile.am: build correct iso version of SYSTEM.
* gm2/gm2.texi: updated the status of the gcc-4.7 branch of gm2.
Also removed an unnecessary --enable-libgm2 option from the
documentation.
2014-07-16 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/Makefile: remove hack rule.
* libgm2/config.h.in: rebuilt.
* libgm2/configure: rebuilt.
* libgm2/configure.ac: test for libc functions.
* libgm2/libpim/Selective.c: provide dummy KillSet procedure
function.
2014-07-15 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2Range.mod: CodeWholeNonPos, CodeWholeZero
assign location before it is used.
2014-07-14 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: overhauled to ensure that target and host are
distinct.
* gm2/gm2-compiler/M2GCCDeclare.mod: IsExternal (New procedure function).
FindContext replaces FindTreeScope. IsGlobal (New procedure function).
DeclareVariable uses IsGlobal, IsExternal and FindContext.
* gm2/gm2-gcc/init.c: can now be compiled by a C or C++ compiler.
* gm2/gm2-gcc/m2block.c: new fields to binding_level. is_global and
context. The compiler now correctly uses a translation_unit tree
node to contain the global variables. Bug fixes to correct the
context of local variables. We also ensure that all locals
are declared. Added more self checking debugging code.
* gm2/gm2-gcc/m2block.def: includeDecl (New procedure function).
GetGlobalContext (New procedure function).
* gm2/gm2-gcc/m2block.h: allow m2block.[ch] to be compiled by
a C or C++ compiler, export GetGlobalContext, finishGlobals,
and includeDecl.
* gm2/gm2-gcc/m2builtins.h: allow m2block.[ch] to be compiled by
a C or C++ compiler.
* gm2/gm2-gcc/m2convert.h: allow m2block.[ch] to be compiled by
a C or C++ compiler.
* gm2/gm2-gcc/m2decl.c: simplified and corrected declaration of a
variable. BuildParameterDeclaration simplified as it only handles
procedure/function parameters and not function/procedure types.
* gm2/gm2-gcc/m2decl.h: allow m2decl.[ch] to be compiled by
a C or C++ compiler.
* gm2/gm2-gcc/m2except.h: allow m2except.[ch] to be compiled by
a C or C++ compiler.
* gm2/gm2-gcc/m2expr.h: allow m2expr.[ch] to be compiled by
a C or C++ compiler.
* gm2/gm2-gcc/m2linemap.h: allow m2linemap.[ch] to be compiled by
a C or C++ compiler.
* gm2/gm2-gcc/m2misc.h: allow m2misc.[ch] to be compiled by
a C or C++ compiler.
* gm2/gm2-gcc/m2options.h: allow m2options.[ch] to be compiled by
a C or C++ compiler.
* gm2/gm2-gcc/m2statement.h: allow m2statement.[ch] to be compiled by
a C or C++ compiler.
* gm2/gm2-gcc/m2statement.c: call cgraph_finalize_function whenever
we finish a function. Unit at a time change.
* gm2/gm2-gcc/m2top.h: allow m2top.[ch] to be compiled by
a C or C++ compiler.
* gm2/gm2-gcc/m2type.c: specifically declares procedure types
and parameter types. Corrected a bug with procedure/function
type declaration.
* gm2/gm2-gcc/m2type.def: BuildProcTypeParameterDeclaration (New procedure
function). BuildEndFunctionType additional parameter.
* gm2/gm2-gcc/m2type.h: allow m2type.[ch] to be compiled by
a C or C++ compiler.
* gm2/gm2-lang.c: m2_write_global_declarations (New function).
gm2_langhook_write_globals for each translation unit write out globals.
* gm2/gm2-libs-pim/Break.c: corrected #include syntax. Reformatted to
conform to GNU coding standards.
* gm2/gm2-libs/config-host: rebuilt.
* gm2/gm2-libs/config-target: rebuilt.
* gm2/gm2-libs/config-target.in: use GCC_NO_EXECUTABLES.
* gm2/gm2spec.c: removed style of libraries, added new location of
libraries and new library names.
* gm2/m2pp.c: pl (New function). m2pp_decl_list (New function).
m2pp_decl_bool (New function). remember (New function).
m2pp_translation (New function). m2pp_module_block (New function).
m2pp_procedure_type modified to understand varargs.
* gm2/tools-src/createUlmSys: fixed to test for presence of include
files so that it can be run in a cross compiler for a minimal target.
* gm2/examples/pge/Makefile: remove rule hack from objects.
* gm2/gm2-compiler/M2GenGCC.mod: CodeDivTrunc, FoldDivTrunc,
CodeDivFloor, FoldDivFloor check operand types and if REAL/COMPLEX
family are used then call BuildRDiv instead. Fixes a compiler error
exposed by gm2/examples/pge/roots.mod. BinaryOperandRealFamily
(New procedure function).
* gm2/gm2-gcc/m2expr.c: m2expr_BuildRDiv (New function).
* gm2/gm2-gcc/m2expr.def: m2expr_BuildRDiv (New definition).
* gm2/gm2-gcc/m2expr.h: m2expr_BuildRDiv (New prototype).
2014-04-20 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: (CodeInitAddress) declare tokenno
and location and set them correctly.
* gm2/gm2spec.c: let the -B switch determine where the (preprocessor)
cc1 is found.
2014-04-05 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: (CodeInitAddress) New procedure.
(CodeStatement) added case clause for InitAddressOp which calls
CodeInitAddress.
* gm2/gm2-compiler/M2Quads.def: added InitAddressOp.
* gm2/gm2-compiler/M2Quads.mod: (CheckVariableAt) generate
an InitAddressOp instead of CodeBecomesOp. (WriteQuad)
new case clause for InitAddressOp. (WriteOperands) new case
clause for InitAddressOp.
* fixes variable at address bugs (see
testsuite/gm2/embedded/pass/varataddress2.mod)
2014-03-19 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/m2except.c: (do_call3) corrected number of parameters.
(build_exc_ptr) add assertion. (gm2_build_throw) add location.
* gm2/tools-src/createUlmSys: improved error message.
* libgm2/Makefile.in: build and install the Ulm libraries.
Included $(GM2_OBJ)/gm2-libs/gm2-libs-target.h as a dependant
to $(GM2_OBJ)/ulm-lib-gm2/sys/SYSTEM.c.
2014-03-18 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/m2except.c: do_call0 (New function).
do_call1 (New function). do_call3 (New function).
build_exc_ptr (rewritten to use do_call1).
do_free_exception (rewritten to use do_call1).
do_throw (rewritten to use do_call3).
do_rethrow (rewritten to use do_call0).
gm2_build_throw (removed unused local variables).
do_begin_catch (rewritten to use do_call1).
do_end_catch (rewritten to use do_call0).
* gm2/gm2-lang.c: genericize_try_block (New function).
genericize_catch_block (New function).
gm2_langhook_gimplify_expr call genericize_try_block
and genericize_catch_block.
2014-03-12 Gaius Mulley <gaius@gnu.org>
* changed persmissions to most files to remove the execute
bit.
2014-03-12 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: fixed verify flags for gm2.verifyparanoid
and gm2.verifystage12.
* gm2/gm2-libs-iso/M2RTS.mod: detect double HALT and exit with
-1.
* gm2/gm2-libs/M2RTS.mod: detect double HALT and exit with
-1.
* gm2/gm2-libs/Indexing.mod: use memmove rather than memcpy
which fixes the regression testsuite/gm2/isolib/run/pass/termfile.mod.
* gm2/gm2-libs/libc.def: provide definition for memmove.
2014-02-19 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: include the search path -I$(srcdir)/gm2/gm2-gcc
when building stage2 from the compiler sources.
* gm2/bnf/gm2l.bnf: import Dup from DynamicStrings.
* gm2/gm2-compiler/M2ALU.mod: fixed many imports so that
the module can be built during stage2, via xgm2.
* gm2/gm2-compiler/M2Base.mod: fixed many imports so that
the module can be built during stage2, via xgm2.
* gm2/gm2-compiler/M2Preprocess.mod: corrected import of
CppCommandLine from M2Options rather than M2DriverOptions.
* gm2/gm2-compiler/M2Range.mod: fixed many imports so that
the module can be built during stage2, via xgm2.
* gm2/gm2-compiler/M2System.mod: fixed many imports so that
the module can be built during stage2, via xgm2.
* gm2/gm2-compiler/SymbolConversion.mod: fixed many imports so that
the module can be built during stage2, via xgm2.
* gm2/gm2-compiler/m2flex.def: fixed many imports so that
the module can be built during stage2, via xgm2.
* gm2/Make-lang.in: added attribs.o to link stage2/gm2/cc1gm2.
Removed $(BACKENDLIBS) $(LIBSTDCXX) from the dependancies of
stage2/gm2/cc1gm2. Added -I$(srcdir)/gm2/gm2-gcc to
all gm2/gm2-compiler-paranoid rules.
* gm2/gm2-compiler/M2Options.def: added many procedures to the
list of export qualified identifiers.
* gm2/gm2-compiler/SymbolTable.mod: changed needsUnsigned
and needsLong to BOOLEAN.
2014-02-18 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: fixed many imports so that
the module can be built during stage2, via xgm2.
* gm2/gm2-compiler/M2GCCDeclare.mod: fixed many imports so that
the module can be built during stage2, via xgm2.
* gm2/gm2-gcc/m2decl.def: use BOOLEAN parameters rather than
INTEGERs.
* gm2/p2c/p2c-src/src/decl.c: tidied up formatting.
2014-02-17 Gaius Mulley <gaius@gnu.org>
* gm2/config-lang.in: added m2block.c, m2builtins.c and m2decl.c
to the list of gtfiles.
* gm2/gm2-gcc/m2block.c: changed layout of the GTY binding level
structure and use ggc_alloc_binding_level rather than xmalloc.
Include gt-gm2-m2block.h.
* gm2/gm2-gcc/m2type.c: include gt-gm2-m2decl.h.
* gm2/gm2-gcc/m2expr.c: use ggc_alloc_atomic rather than xmalloc.
Include gt-gm2-m2expr.h.
* gm2/gm2-gcc/m2statement.c: include gt-gm2-m2statement.h.
* gm2/gm2-gcc/m2type.c: layout GTY structure correctly and
use ggc_alloc_array_desc and ggc_alloc_struct_constructor
instead of xmalloc. Include gt-gm2-m2type.h.
2014-02-10 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: added -I$(srcdir)/gm2/gm2-gcc to all
the compiler build rules when building gm2/gm2-compiler via xgm2.
* gm2/gm2-compiler/M2ALU.mod: fix imports so that this file can
be built by xgm2.
* gm2/gm2-compiler/M2GenGCC.mod: fixed many (but not all) of the
imports so this file can be compiled by xgm2.
* gm2/gm2-compiler/M2LexBuf.def: add TokenToLocation to export
qualified list.
* gm2/gm2-compiler/M2Options.def: remove IsAnOption,
IsAndOptionAndArg and ParseOptions from the export list.
(SetOptimizing) correct parameter to CARDINAL.
* gm2/gm2-compiler/M2Options.mod: include Dup into export list.
* gm2/gm2-gcc/m2decl.def: import ADDRESS from SYSTEM.
* gm2/gm2-gcc/m2expr.def: import ADDRESS from SYSTEM.
(BuildBinarySetDo) added missing ';'.
* gm2/gm2-gcc/m2statement.def: import ADDRESS from SYSTEM.
* gm2/gm2-gcc/m2top.def: (SetFlagUnitAtATime) alter parameter to
BOOLEAN.
2014-02-02 Gaius Mulley <gaius@gnu.org>
* gm2/bnf/m2-2.bnf: changed rule for ByteAlignment to use the ISO
Modula-2 syntax <* *> extension.
* gm2/bnf/m2-3.bnf: changed rule for ByteAlignment to use the ISO
Modula-2 syntax <* *> extension.
* gm2/bnf/m2-c.bnf: changed rule for ByteAlignment to use the ISO
Modula-2 syntax <* *> extension.
* gm2/bnf/m2-h.bnf: changed rule for ByteAlignment to use the ISO
Modula-2 syntax <* *> extension.
* gm2/bnf/m2.bnf: changed rule for ByteAlignment to use the ISO
Modula-2 syntax <* *> extension.
* gm2/gm2-compiler/M2GenGCC.mod: pass a location as the
first parameter to BuildTryBegin, BuildCatchBegin,
BuildCatchEnd.
* gm2/gm2-compiler/M2Quads.def: changed comment to reflect
new code (bytealignment) is used instead of (ALIGNED).
* gm2/gm2-compiler/M2Quads.mod: change ALIGNED to bytealignment.
BuildAlignment, changed error message to reflect bytealignment.
* gm2/gm2-compiler/P2SymBuild.def: changed comment to reflect
new code (bytealignment) is used instead of (ALIGNED).
* gm2/gm2-compiler/P2SymBuild.mod: BuildAligned check for
the alignment word (bytealignment). BuildVarAlignment
* gm2/gm2-gcc/m2except.def: (InitExceptions) corrected to
include a parameter, location. (BuildCatchBegin) corrected
to include a parameter, location. (BuildCatchEnd) corrected
to include a parameter, location.
* gm2/gm2.texi: changed documentation to reflect new syntax
of alignment used in variable and type declaration.
* testsuite/gm2/extensions/pass/align.mod: changed test code
to reflect new syntax.
* testsuite/gm2/extensions/pass/align2.mod: changed test code
to reflect new syntax.
* testsuite/gm2/extensions/run/pass/align3.mod: changed test code
to reflect new syntax.
* testsuite/gm2/extensions/run/pass/align4.mod: changed test code
to reflect new syntax.
* testsuite/gm2/extensions/run/pass/align5.mod: changed test code
to reflect new syntax.
* testsuite/gm2/extensions/run/pass/align6.mod: changed test code
to reflect new syntax.
* testsuite/gm2/extensions/run/pass/align7.mod: changed test code
to reflect new syntax.
* testsuite/gm2/extensions/run/pass/card16p.mod: corrected test.
* testsuite/gm2/extensions/run/pass/card32p.mod: corrected test.
* testsuite/gm2/extensions/run/pass/card64p.mod: corrected test.
* testsuite/gm2/extensions/run/pass/card8p.mod: corrected test.
2014-01-24 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/foo.mod: changed demo.
* gm2/gm2-compiler/M2GenGCC.mod: no longer pass
the fifth parameter to BuildArray.
* gm2/gm2-gcc/m2expr.c: removed the fifth parameter to
BuildArray. Pass NULL_TREE to build4 of a ARRAY_REF.
* gm2/gm2-gcc/m2expr.def: removed the fifth parameter to
the definition of BuildArray.
* gm2/gm2-gcc/m2expr.h: removed the fifth parameter to
the prototype of BuildArray.
2014-01-18 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/m2expr.c: CheckAddressToCardinal (New function).
BuildAdd use CheckAddressToCardinal for both operands.
BuildSub use CheckAddressToCardinal for both operands.
BuildDivTrunc use CheckAddressToCardinal for both operands.
BuildModTrunc use CheckAddressToCardinal for both operands.
BuildDivFloor use CheckAddressToCardinal for both operands.
BuildModFloor use CheckAddressToCardinal for both operands.
BuildMult use CheckAddressToCardinal for both operands.
* gm2/gm2-gcc/m2type.c: m2_cardinal_address_type_node new
internal datatype. GetCardinalAddressType (New function).
build_m2_cardinal_address_type_node (New function).
* gm2/gm2-gcc/m2type.h: m2type_GetCardinalAddressType
(New function prototype).
2014-01-15 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: use $(LINKER) rather than $(XGCC).
use $(COMPILER) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS)
to aid building gm2 as a cross compiler.
* gm2/gm2-gcc/m2expr.c: check operand types for ADDRESS
in multiply, divide, modulus and issue appropriate errors.
* gm2/gm2-gcc/m2type.c: (IsAddress) New function.
* gm2/gm2-gcc/m2type.def: (IsAddress) New function.
* gm2/gm2-gcc/m2type.h: (IsAddress) New function prototype.
* gm2/gm2-lang.c: removed duplicate declaration of gm2_gc_root.
Added compiler directives to unused parameters in
gm2_langhook_gimplify_expr.
2014-01-14 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: substituted $(CC) for $(COMPILER) when
building gm2/gm2-lang.o, gm2/stor-layout.o and gm2/m2pp.o.
* gm2/gm2-gcc/m2builtins.c: added BT_FN_NONE to the
builtin_prototype enum. Changed fclass to enum built_in_class.
Modified compound constant constructor to contain correct types
in the terminating array element.
* gm2/gm2-gcc/m2convert.c: remove stop function.
* gm2/gm2-gcc/m2decl.c: remove stop function.
* gm2/gm2-gcc/m2expr.c: remove stop function. Comment out
default_convert_binary_operands and build_nop. Comment out
unused part of m2expr_BuildNegate.
* gm2/gm2-gcc/m2misc.c: corrected formatting.
* gm2/gm2-gcc/m2options.h: added const to the second parameter
in M2Options_CppArg.
* gm2/gm2-lang.c: added const to the declaration of opt.
* gm2/gm2-lang.h: added list of includes, added extern prototype
for gm2_langhook_init_options.
* gm2/gm2spec.c: removed prototype for get_B_or_prefix. Added
conditional compilation for printOption. Added const to
declaration of B_path. (find_executable_path) corrected
local variable declaration to include const.
(add_B_prefix) added ATTRIBUTE_UNUSED to the first parameter.
(get_B_or_prefix) removed. (add_exec_dir) corrected local
variables to include const.
* gm2/gm2version.h: added conditional compilation for the
prototype for gm2version so that it can be accessed by C and C++.
* gm2/m2pp.c: changed stack_t to m2stack_t to avoid type clash.
(pet) New function prototype. (m2pp_integer) New function
prototype. Build gm2 or C versions of m2pp_integer.
Build gm2 or C versions of m2pp_complex.

600
gcc/m2/ChangeLog-2015 Normal file
View File

@@ -0,0 +1,600 @@
2015-11-30 Gaius Mulley <gaius@gnu.org>
* gm2/examples/gravity/twoDsim.mod: fixed syntax error.
* gm2/examples/pge/bounce3.mod: use groff device.
* gm2/examples/pge/bounce4.mod: use groff device.
* gm2/examples/pge/slope.mod: use groff device.
* gm2/examples/pge/stairs.mod: use groff device and increase
simulated time.
* gm2/gm2-compiler/ppg.mod: removed white space and fixed
bug with emitting source line preprocessor symbols.
* gm2/m2.flex: fixed floating point constant bug reported
by Michael Riedl (to allow 1.E10 etc).
* testsuite/gm2/iso/constreal.mod: new file.
* gm2/el/g-mode.el: fixed comment spacing at end of sentance
in the automatically generated header and updated the dates.
2015-10-07 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/twoDsim.mod: tided up debugging.
* gm2/examples/pge/elc2.mod: New file.
* gm2/examples/pge/rboxes.mod: New file.
2015-10-06 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/Makefile.in: build rotating-circles.m.
* gm2/examples/pge/mxmparser.py: formatting change.
* gm2/examples/pge/mxmtree.py: add terms and call pent, hex,
sept, oct for powers 5..8.
* gm2/examples/pge/roots.def: findOctic new procedure function.
* gm2/examples/pge/roots.mod: findOctic new procedure function
wrapper implemented.
* gm2/examples/pge/rotating-circles.mxm: corrected terms and
renamed some of the variables.
* gm2/examples/pge/rotating-line.mxm: tidied up comments.
* gm2/examples/pge/twoDsim.mod: new procedure functions,
pent, hex, sept, oct. New procedure getObjectOrbitingValues.
New procedure maximaCircleCollisionOrbiting. New procedure
function earlierCircleCollisionOrbiting. New procedure
findCollisionCircleLineOrbiting. Removed
findCollisionCircleRLine. findCollisionCirclePolygon call
appropriate routine depending upon whether the polygon is
orbiting. New procedure function, isOrbiting.
findCollisionLineLine call appropriate routine depending
upon whether polygon is orbiting. New procedure
findCollisionLineLineOrbiting.
2015-10-05 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/Makefile.in: added new rule for elc2.mod
* gm2/examples/pge/coord.mod: tidied up formatting.
* gm2/examples/pge/twoDsim.mod: added Elasticity constant,
angularMomentum for objects. New procedure function (reflect).
collidePolygonAgainstMovingPolygon (rewritten).
Interim checkin.
2015-09-28 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/Makefile.in: new example circle added.
* gm2/examples/pge/coord.def: new procedure function
perpendicular.
* gm2/examples/pge/coord.mod: implemented new procedure
function perpendicular.
* gm2/examples/pge/polar.mod: cosmetic spaces added.
* gm2/examples/pge/popWorld.mod: cosmetic spaces added.
* gm2/examples/pge/twoDsim.mod: many cosmetic changes
and also more explicit parameters which determine if
edge or corner was in collision. First cut of the polygon
collision reaction implemented.
* gm2/gm2.texi: removed duplication switch.
* gm2/gm2-gcc/m2linemap.c: use xstrdup to preserve filename
from being garbage collected. This fixes a critical bug
in the debugging output of large source files when -fcpp
was used.
2015-09-14 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/Makefile.in: add boxes.raw and removed
dependancy output.raw from playback.
* gm2/examples/pge/bounce.mod: remove rotate.
* gm2/examples/pge/boxes.mod: changed output device.
* gm2/examples/pge/examples/exampleBoxes.py: changed sound
file examples. Changed crate example.
* gm2/examples/pge/pge.py: added poly3 method.
* gm2/examples/pge/pgeif.mod: check_range attempts to prevent
round off errors and changed to provide a better descriptive
error message.
* gm2/examples/pge/pgeplayback.py: changes to allow generation
of a movie with appropriate sounds effects.
* gm2/examples/pge/polar.def: new procedure function rotatePolar.
* gm2/examples/pge/polar.mod: implement new procedure function
rotatePolar.
* gm2/examples/pge/twoDsim.def: define new procedure function
rvel.
* gm2/examples/pge/twoDsim.mod: major changes to the definition
of the polygon data structures, now use a c of g and polar
coordinates to describe polygon. Removed rpolygon.
2015-09-09 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/examples/exampleBoxes.py: interim checkin.
* gm2/examples/pge/pge.py: get_xvel, get_yvel, get_xaccel,
get_yaccel, process_event new methods.
* gm2/examples/pge/pgeif.def: get_xvel, get_yvel, get_xaccel,
get_yaccel (New procedure functions).
* gm2/examples/pge/pgeif.i: get_xvel, get_yvel, get_xaccel,
get_yaccel (New functions).
* gm2/examples/pge/pgeif.mod: get_xvel, get_yvel, get_xaccel,
get_yaccel (Implement new procedure functions).
* gm2/examples/pge/pgeplayback.py: added -V option, added -o
option. Added ability to create a movie with sound effects
using sox and mencoder.
* gm2/examples/pge/twoDsim.def: get_xvel, get_yvel, get_xaccel,
get_yaccel (New procedure functions).
* gm2/examples/pge/twoDsim.mod: get_xvel, get_yvel, get_xaccel,
get_yaccel (Implement new procedure functions).
2015-09-04 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/Makefile.in: added -I to link rule.
* gm2/examples/pge/mxmmaxima.py: corrected unary -, + handling.
* gm2/examples/pge/mxmtree.py: corrected output and fixed bug
with class field.
* gm2/examples/pge/rotating-circles.mxm: removed quit command.
* gm2/examples/pge/rotating-line.mxm: removed equality and quit
command.
* gm2/examples/pge/twoDsim.mod: introduced comment for
getPolygonPoint.
* gm2/www/tools/texi2tr/html/download.html: updated download version.
* gm2/www/tools/texi2tr/html/release.html: updated stable release
version.
2015-09-03 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: fixed dates and gcc version number (4.7.4).
* gm2/Makefile.in: fixed dates.
* gm2/c.flex: fixed dates.
* gm2/configure.in; fixed dates and version number.
* gm2/examples/pge/Makefile.in: fixed compile rule to include machine
generated source.
* gm2/examples/pge/circles.mxm: simplified equation.
* gm2/examples/pge/mxmmaxima.py: many interim bug fixes.
* gm2/examples/pge/mxmparser.py: many interim bug fixes.
* gm2/examples/pge/mxmtree.py: many interim bug fixes.
* gm2/examples/pge/twoDsim.mod: improved debugging asserts
and include machine generated source, compare results of both.
* gm2/gm2-lang.c: handle -I option inside cpp args.
* gm2/m2.flex: corrected dates.
* gm2/gm2-compiler/M2Preprocess.mod: removed unnecessary printf
and corrected dates.
* released GM2 1.1.5
* gm2/gm2.texi: updated release map.
* gm2/version.c: 1.1.5.
* gm2/configure.in; 1.1.5.
* gm2/gm2-libs/config-host.in: 1.1.5.
* gm2/gm2-libs/config-target.in: 1.1.5.
* gm2/gm2-libs/config-host: rebuilt.
* gm2/gm2-libs/config-target: rebuilt.
2015-08-24 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/examples/exampleBoxes.py: much more debugging
added.
* gm2/examples/pge/pge.py: more debugging added. Also correct
lack of initialiser bugs. Many diagnostics added.
* gm2/examples/pge/pgeif.def: added ValueOutOfRange exception.
* gm2/examples/pge/pgeif.i: added skip_until procedure.
* gm2/examples/pge/pgeif.mod: (check_range) New function
procedure. get_xpos, get_ypos, box, poly3, poly4, poly5
and poly6 all use check_range to check parameter values.
* gm2/examples/pge/twoDsim.mod: added more trace information
and test for object deletion.
* gm2/gm2-compiler/M2Base.mod: added two more metatypes, rec
and array. Check for these meta types and add their
characteristics into the assignment and expression matrices.
This allows ARRAY and RECORD of the correct size to be compatible
with WORD, BYTE, LOC etc.
* gm2/gm2-compiler/M2GCCDeclare.mod: use BuiltinsLocation during
the construction of the base types.
* gm2/gm2-compiler/M2GenGCC.mod: added internal debugging.
(CodeIndirectCall) skip type aliases for the return type.
* gm2/gm2-compiler/M2Scope.mod: added internal debugging.
* gm2/gm2-compiler/SymbolTable.mod: added missing initialisation
for ScopeQuad. This allows cc1gm2 to be run without errors by
valgrind.
* gm2/gm2-gcc/m2convert.c: convert_char_to_array (New function).
convert_string_to_array (New function). BuildConvert changed
to detect whether a const lit char or string is required to be
converted into a fixed string length. This fixes a bug reported.
* gm2/gm2-gcc/m2statement.c: tidied up code and fixed bug in
(BuildReturnValueCode). This fixes a bug exposed by
testsuite/gm2/pim/pass/typeequiv.mod.
* gm2/gm2-gcc/m2type.c: (BuildArrayStringConstructor) now adds
multiple nuls to the end of a string if length exceeds string.
* gm2/gm2-libs/MemUtils.def: tidied up formatting.
* gm2/p2c/p2c-src/src/pexpr.c: fixed bug so that constant strings
have a LOW indice of 0 not 1.
* gm2/pim/pass/typeequiv.mod: corrected date.
* gm2/pim/pass/typeequiv2.mod: corrected date.
* gm2/pim/pass/typeequiv3.mod: corrected date.
2015-08-18 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/GC.mod: (gdbif) imported to aid debugging.
Initialised callbacks to NIL (bugfix).
* gm2/examples/pge/twoDsim.mod: removed debugging hook.
* gm2/examples/shared/Makefile.in: corrected dates.
* gm2/gm2-libs-iso/MemStream.mod: assign res to opened (bugfix).
* gm2/gm2-libs/CmdArgs.def: corrected dates.
* gm2/gm2-libs/CmdArgs.mod: corrected dates.
* libgm2/libpim/Makefile.am: added SCmdArgs.def to be installed.
* libgm2/libpim/Makefile.am: added SCmdArgs.mod to be built and
installed.
2015-08-14 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: modified debugging hooks.
* gm2/gm2-compiler/M2Quads.mod: (BuildConvert) allow record types
to be converted as they might fit into a generic type.
* gm2/gm2-gcc/m2convert.c: (same_size_types) New function.
(converting_ISO_generic) only convert using short hand generic
types if they are the correct size. (const_to_ISO_aggregate_type)
New function.
* gm2/gm2-lang.c: (convert) simplified.
2015-08-11 Gaius Mulley <gaius@gnu.org>
* gm2/README: corrected README to reflect prefered method of obtaining
tar.gz file. Also improved the text. Removed the build instructions
and replaced it with a reference to the documentation.
* gm2/examples/pge/deviceIf.mod: added DebugTrace feature.
* gm2/examples/pge/twoDsim.mod: added DebugTrace feature.
* gm2/examples/pge/world.mod: useGroff by default.
* gm2/gm2-compiler/M2Base.mod: fixed bug to allow BYTE to be parameter
compatible with any BYTE sized type (including packed RECORD).
2015-08-05 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/Makefile.in: new rule for playback and output.raw.
* the following changes fix bugs in packed enumeration types. Test code
is given in the regression testsuite.
* gm2/extensions/run/pass/packedrecord.mod: new file.
* gm2/extensions/run/pass/packedrecord2.mod: new file.
* gm2/gm2-compiler/M2GCCDeclare.mod: change call to BuildEndEnumeration
to pass three parameters.
* gm2/gm2-gcc/m2type.c: noBitsRequired bug fixed for the case where
values is a power of two. gm2_finish_enum introduce extra parameter
location so that we can generate a call to m2type_BuildSmallestTypeRange
if the enumeration is packed. m2type_BuildEndEnumeration change call
to gm2_finish_enum to include extra parameter.
* gm2/gm2-gcc/m2type.def: change definition of BuildEndEnumeration.
* gm2/gm2-gcc/m2type.h: change prototype of BuildEndEnumeration.
2015-07-01 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-gcc/m2convert.c: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
converting_ISO_generic (New procedure function).
const_to_ISO_type (New procedure function).
ConvertConstantAndCheck call const_to_ISO_type.
GenericToType (New procedure function).
These changes allow for much improved location references inside
type conversions and expressions. They also implement ISO WORD
assignment from a constant integer or constant cardinal.
* gm2/gm2-compiler/M2ALU.mod: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-compiler/M2GCCDeclare.mod: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-compiler/M2GenGCC.mod: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-compiler/M2Range.mod: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-gcc/m2convert.def: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-gcc/m2convert.h: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-gcc/m2decl.def: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-gcc/m2decl.h: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-gcc/m2except.c: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-gcc/m2expr.c: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-gcc/m2expr.def: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-gcc/m2expr.h: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-gcc/m2statement.c: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-gcc/m2treelib.c: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-gcc/m2type.c: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-gcc/m2type.def: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-gcc/m2type.h: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
* gm2/gm2-lang.c: change all calls to BuildConvert,
GetIntegerOne, GetIntegerZero, GetWordOne, GetWordZero, GetCardinalOne,
GetCardinalZero to have an extra location parameter.
2015-06-26 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: ConvertTo (New procedure function).
ConvertRHS (New procedure function). IsWord (New procedure function).
CodeConvert changed names of pararmeters and introduced call to
ConvertRHS. CodeXIndr changed names of pararmeters and introduced
call to ConvertRHS. This allows ISO WORD (an array of bytes) to
be converted into CARDINAL.
* gm2/gm2-gcc/m2block.c: allow multiple calls to pushGlobalScope
and multiple calls to popGlobalScope.
* gm2-gcc/m2convert.c: check for FUNCTION_DECL in value and if so
use its address.
* gm2/gm2.texi: updated web pages in light of the unordered list
now implemented correctly in the python translation tool.
Removed many old news entries.
* gm2/www/tools/texi2tr/src/outputdev.py: implement unordered list.
* gm2/www/tools/texi2tr/src/texi2tr.py: check for 'itemize' and
'enumerate'
* testsuite/lib/gm2.exp: corrected LD_LIBRARY_PATH calculation
by testing each library in turn.
* gm2/gm2-compiler/M2GenGCC.mod: corrected type for rhs.
2015-05-30 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: added rule to detect HAVE_STPCPY in configure output.
* gm2/configure.in: check for function stpcpy.
* gm2/gm2-libs/config-target: rebuilt.
* gm2/gm2-libs/config-host: rebuilt.
* gm2/gm2-libs/config-host.in: added check for stpcpy.
* gm2/gm2config.h.in: added check for stpcpy.
* testsuite/gm2/isolib/run/pass/testio2.mod: added debugging printf.
* gm2/gm2-libs-iso/TextIO.mod: fixed bug in ReadToken so that the token
terminates with a white space or null.
* gm2/Make-lang.in: added dynamic test to check for HAVE_STPCPY.
* gm2/gm2-libs/gm2-libs-host.h.in: added check for stpcpy.
2015-05-29 Gaius Mulley <gaius@gnu.org>
* Solaris build fixes.
* gm2/Make-lang.in: added place holder for the stpcpy rule.
Added --lib $(STPCPY) to $(M2LINK) so that the Solaris 10 build
succeeds.
* gm2/gm2-libs-ch/wrapc.c: added #if defined()
to check for the presence of SIGNBIT, SIGNBITL and SIGNBITF.
* gm2/gm2-libs/config-host: rebuilt.
* gm2/gm2-libs/config-host.in: added checks for SIGNBIT, SIGNBITL
and SIGNBITF against libm.
* gm2/gm2-libs/config-target: rebuilt.
* gm2/gm2-libs/config-target.in: added checks for SIGNBIT, SIGNBITL
and SIGNBITF against libm.
* gm2/gm2spec.c: fixed many const char issues so that it can be built
with g++.
* gm2/config.h.in: added #undefs for SIGNBIT, SIGNBITL and SIGNBITF.
* gm2/configure: rebuilt.
* gm2/configure.ac: added checks for SIGNBIT, SIGNBITL
and SIGNBITF against libm.
* gm2/libpim/dtoa.c: added conditional compilation tests for
HAVE_ERRNO_H.
* gm2/libpim/ldtoa.c: added conditional compilation tests for
HAVE_ERRNO_H.
* gm2/libpim/wrapc.c: added conditional compilation tests for
SIGNBIT, SIGNBITL and SIGNBITF.
2015-05-29 Gaius Mulley <gaius@gnu.org>
* Linking fixes (-v).
* This fixes a bug reported by Christoph Schlegel and many others.
* Linking would fail when -v was present on the command line.
* gm2/gm2-compiler/M2Options.def: new parameter to DisplayVersion
(mustExit). Necessary to ensure the -v works in the linking phase.
* gm2/gm2-compiler/M2Options.mod: implement the new parameter
to DisplayVersion (mustExit).
* gm2/gm2-gcc/m2options.h: update the prototype for DisplayVersion.
This occurred because -v was rewritten to --version by gm2spec.c
and --version called exit.
* gm2/gm2-lang.c: call DisplayVersion but request it does not
exit.
* gm2/gm2spec.c: pass TRUE when handling -fgm2-version (to force
an exit). Pass FALSE when handling --version to suppress the
exit.
* gm2/gm2version.h: updated the prototype for gm2_version.
2015-05-29 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-iso/TextIO.mod: new procedure SkipSpaces.
ReadToken calls SkipSpaces, this fixes a bug reported by:
(D.E.Evans <sinuhe@gnu.org>).
* gm2/lang-specs.h: fixed dates and tidied up the spec code so
that many rules are broken down into obvious stages with
inputs and outputs.
* gm2/tools-src/makeversion: changed to reflect the new gm2_version
which has a parameter, mustExit.
2015-05-04 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge: more interim checkins.
* gm2/gm2-compiler/M2Batch.def: IsModuleSeen (New procedure
function).
* gm2/gm2-compiler/M2Batch.mod: IsModuleSeen (New procedure
function) implemented.
* gm2/gm2-compiler/M2GCCDeclare.mod: TryFindSymbol
(New procedure function). Used to aid internal debugging.
* gm2/gm2-libs-iso/IOLink.mod: fixed bug between dids and cid
checking. Check did against dids and cid against did^.cids.
* gm2/gm2-libs-iso/ProgramArgs.mod: fixed bug reported by
(D.E.Evans <sinuhe@gnu.org>).
2015-04-27 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-iso/MemStream.mod: removed debugging printf.
* gm2/examples/pge: more changes.
2015-04-23 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: add $(TIMEVAR_H) to all m2.flex
dependant rules.
* gm2/examples/pge: more changes.
2015-04-21 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/examples: another interim checkin.
(More debugging statements added and internal checking).
* gm2/gm2-libs-iso/RawIO.mod: (Read) call FlushOutErr.
* gm2/gm2-libs-iso/TextIO.mod: (Read) call FlushOutErr.
* gm2/gm2-libs/FIO.def: export FlushOutErr.
* This fixes a bug reported by Steve Giess, which allows
iso and pim libraries to be mixed. It also fixes
the interactive behaviour of the iso libraries so that
output is flushed before data is read.
2015-04-15 Gaius Mulley <gaius@gnu.org>
* released GM2 1.1.3
* gm2/gm2-libs/config-host: rebuilt.
* gm2/gm2-libs/config-host.in: 1.1.3.
* gm2/gm2-libs/config-target: rebuilt.
* gm2/gm2-libs/config-target.in: 1.1.3.
* gm2/gm2.texi: updated release map.
* gm2/version.c: 1.1.3.
* gm2/examples/pge/examples: improved debugging log messages.
2015-04-09 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: changed path to gnu.eps to contain
$(objdir).
* gm2/examples/pge/examples/exampleBoxes.py: more intermin
changes.
* gm2/examples/pge/pge.py: more intermin changes.
* gm2/examples/pge/pgeplayback.py: more intermin changes.
* gm2/examples/pge/twoDsim.mod: more intermin changes.
2015-04-02 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-iso/ConvStringLong.mod: check to see if the
conversion generates a NAN and return accordingly.
* gm2/gm2-libs-iso/ConvStringReal.mod: check to see if the
conversion generates a NAN and return accordingly.
This fixes a bug reported by: Michael Riedl.
2015-04-01 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge: many bugfixes to the shared library example.
* gm2/gm2-compiler/M2GenGCC.mod: FoldConvert use PopKindTree.
PopKindTree new procedure function. This fixes a bug reported
by: Michael Riedl. (see
http://lists.nongnu.org/archive/html/gm2/2015-02/msg00006.html).
2015-03-28 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge: many bugfixes to the shared library example.
2015-03-16 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge: many more improvements to pgeplayback.py
and twoDsim.mod.
2015-03-15 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge: more changes to the shared library example.
* gm2/gm2-libs/gdbif.mod: New file.
* gm2/gm2-libs/gdbif.def: New file.
2015-02-25 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge: huge amount of changes to expose the frame
buffer to python/pygame.
2015-02-19 Gaius Mulley <gaius@gnu.org>
* libgm2/libiso/Makefile.in: added MemStream.def and MemStream.mod
in list of modules to be built and installed.
* gm2/gm2-libs-iso/MemStream.def: New file.
* gm2/gm2-libs-iso/MemStream.mod: New file.
2015-02-17 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-libs-iso/Storage.mod: fixed bug reported by
reported by Michael Riedl <udo-michael.riedl@t-online.de>.
DEALLOCATE should assign the pointer to NIL.
2015-02-11 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/pge.py: tidied up formatting.
* gm2/gm2-compiler/M2GenGCC.mod: CanConvert (New procedure function).
CodeCast checks to see if non same sized types can be converted
and generates an error message if they cannot.
* gm2/gm2.texi: corrected documentation to use libtool when building
shared libraries. Updated references to jessie, rather than wheezy.
Updated gcc graft to 4.7.4.
* gm2/www/tools/texi2tr/html/download.html: update to stable release
gm2-1.1.1.
* gm2/www/tools/texi2tr/html/release.html: update to stable release
gm2-1.1.1.
* testsuite/gm2/iso/pass/realbitscast.mod: simplified test code.
2015-01-26 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2Quads.mod: MakeLengthConst new procedure
function. BuildLengthFunction use MakeLengthConst.
AssignHighField check for conststring and call MakeLengthConst.
This fixes a bug reported below.
* testsuite/gm2/pim/run/pass/bytearray.mod: new test code to
detect bug reported by Michael Riedl <udo-michael.riedl@t-online.de>.
* gm2/gm2-compiler/M2DriverOptions.mod: add char to the import
list.
* gm2/gm2-compiler/M2Options.mod: add string to the import list.
2015-01-13 Gaius Mulley <gaius@gnu.org>
* Fixed bug reported by Peter Fletcher.
* gm2/bnf/gm2l.bnf: handle '-v' options and remember cpp options.
* gm2/gm2-compiler/M2DriverOptions.mod: remember cpp options.
* gm2/gm2-compiler/M2Options.def: SetVerbose new procedure function.
CppRemember new procedure.
* gm2/gm2-compiler/M2Options.mod: implement SetVerbose
procedure function and CppRemember.
* gm2/www/tools/texi2tr/html/download.html: updated to include
download reference to 4.7.x series of gcc.
* gm2 now builds when grafted onto 4.7.4.
2015-01-04 Gaius Mulley <gaius@gnu.org>
* gm2/examples/pge/Fractions.mod: removed unnecessary local
variable.
* gm2/examples/pge/Makefile.in: added extra sources and added
libraries. Added local directory to the PYTHONPATH.
* gm2/examples/pge/pge.py: many bugfixes and self checking code
added.
* gm2/examples/pge/pgeif.mod: initialise deviceIf.
* gm2/gm2-libs-iso/LowLong.mod: correct prototype for huge_val.
* gm2/gm2-libs-iso/LowReal.mod: correct prototype for huge_val.
* gm2/gm2-libs-iso/LowShort.mod: correct prototype for huge_valf.
* gm2/gm2-libs/Builtins.def: correct prototype for huge_val,
huge_valf, huge_vall.
2015-01-03 Gaius Mulley <gaius@gnu.org>
* gm2/bnf/gm2m.bnf: added debugging and verbose flag.
Also fixed bug so that it understands the -fmake-I option.
* gm2/examples/hello/Makefile.in: use $(EXE) rather than .out
* gm2/examples/ncurses/Makefile.in: corrected arguments to
gm2 -fmakeall.
* gm2/examples/pge/Makefile.in: improved clean target.
* gm2/gm2.texi: corrected typo.
* gm2/lang-specs.h: ensure that gm2m is invoked with the -B
and -fmake-I options present outside the -fgm2begin
-fgm2end delimiters.
2015-01-02 Gaius Mulley <gaius@gnu.org>
* released GM2 1.1.0
* gm2/gm2-libs/config-host: rebuilt.
* gm2/gm2-libs/config-host.in: 1.1.0.
* gm2/gm2-libs/config-target: rebuilt.
* gm2/gm2-libs/config-target.in: 1.1.0.
* gm2/gm2.texi: updated release map.
* gm2/gm2spec.c: removed C++ comment.
* gm2/version.c: 1.1.0.
* gm2/examples/pge/Makefile.in: interim checkin libpgeif uses
libtool during construction. Temporary files removed from git.

1351
gcc/m2/ChangeLog-2016 Normal file

File diff suppressed because it is too large Load Diff

1076
gcc/m2/ChangeLog-2017 Normal file

File diff suppressed because it is too large Load Diff

606
gcc/m2/ChangeLog-2018 Normal file
View File

@@ -0,0 +1,606 @@
2018-07-30 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/gm2spec.c: (fe_generate_option) do not duplicate the old
argument. free up a string after use. (build_include_path)
start the new string with a strcpy not strcat!
(insert_option) create a new vector with an extra entry.
(no_link) return a string which can be free'd.
(add_exec_name) return a string which can be free'd.
2018-07-18 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/gm2spec.c: reformatted according to GNU coding standards.
2018-07-17 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/gm2-compiler/ObjectFiles.mod: import ALLOCATE
and DEALLOCATE from Storage. Collect return results
from close and KillIndex.
* gm2/gm2spec.c: reformatted and tidied up code.
* gm2/gm2-libs/GetOpt.mod: remove declaration of PtrToInteger.
* gm2/gm2-libs/GetOpt.mod: corrected record/pointer reference.
2018-07-16 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/bnf/gm2l.bnf: reformatted to gnu standards.
* gm2/el/gm2-mode.el: minor formatting change.
* gm2/gm2-libs/DynamicStrings.mod: reformatted to gnu standards.
* gm2/gm2-compiler/ObjectFiles.def: (New file).
2018-07-14 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/Make-lang.in: remove the target configure scripts from
gm2/gm2-libs.
* gm2/configure: rebuilt.
* gm2/examples/callingC/Makefile.in: use multiple -I flags.
* gm2/examples/hello/Makefile.in: use multiple -I flags.
* gm2/gm2-compiler/gm2lcc.mod: reformatted. Archive
all object files, all Modula-2 objects and check for duplication.
* gm2/gm2-libs-ch/wrapc.c: remove unconfigured test for fileinode.
* gm2/gm2-libs/config-host: rebuilt.
* gm2/gm2-libs/config-target: removed.
* gm2/gm2-libs/gm2-libs-host.h.in: rebuilt.
* gm2/gm2-libs/gm2-libs-target.h.in: removed.
* gm2/gm2spec.c: reformatted. (add_env_option) New function.
(lang_specific_driver) call add_env_option.
* gm2/lang-specs.h: (lang_register_spec_functions) register
no_objects.
* gm2/patches/gcc/trunc/01-patches: rebuilt.
* gm2/patches/gcc/trunc/02-patches: rebuilt.
* gm2/patches/gcc/trunc/03-patches: rebuilt.
* gm2/patches/gcc/trunc/04-patches: rebuilt.
* gm2/patches/gcc/trunc/05-patches: rebuilt.
* gm2/patches/gcc/trunc/06-patches: rebuilt.
* gm2/patches/gcc/trunc/07-patches: rebuilt.
* gm2/patches/gcc/trunc/08-patches: rebuilt.
* gm2/patches/gcc/trunc/09-patches: rebuilt.
* gm2/patches/gcc/trunc/10-patches: rebuilt.
* testsuite/gm2/pim/run/pass/testaddr2.mod: reformatted.
* gm2/gm2spec.c: removed unused variable and reformatted.
* gm2/tools-src/makeversion: remove reference to config-target.in.
2018-07-10 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/gm2-compiler/ObjectFiles.def: New file.
* gm2/gm2-compiler/ObjectFiles.mod: New file.
* gm2/Make-lang.in: added ObjectFiles to be built and linked
into the compiler and tools.
* gm2/gm2-compiler/gm2lcc.mod: use ObjectFiles to remember each
object file so duplicates are not accidentally linked both in
the Modula-2 link and command line list of objects. Much code
was tidied up.
* gm2/gm2-libs-ch/wrapc.c: (fileinode) New function.
* gm2/gm2-libs/libc.def: corrected dates.
* gm2/gm2-libs/wrapc.def: (fileinode) New procedure function.
* libgm2/libpim/wrapc.c: (fileinode) New function. Tidied up
formatting.
2018-07-07 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/bnf/gm2l.bnf: import Verbose and use. (RegisterImport)
reformatted. (ScanSources) display the module name if Verbose.
(ScanArgs) handle long options and also concatenated arguments.
(-I, --verbose, --M2RTS).
* gm2/gm2-compiler/M2DriverOptions.mod: (CppArgument) New procedure
function. (ScanCppArgs) reformatted and also call CppArgument.
* gm2/gm2-compiler/M2Options.mod: updated dates.
* gm2/gm2-compiler/M2Preprocess.mod: reformatted and changed some of the
Verbose output.
* gm2/gm2-libs-ch/getopt.c: implement long options.
* gm2/gm2-libs/GetOpt.def: provide access to the long options in getopt.
* gm2/gm2-libs/GetOpt.mod: implement long option procedures necessary for getopt.
* gm2/gm2-libs/Storage.def: updated dates.
* gm2/gm2-libs/getopt.def: provide access to the long options in getopt.
* gm2/gm2.texi: corrected docuentation surrounding
* gm2/gm2spec.c: removed GM2IPATH and GM2OPATH temporarily and changed
all include and object paths to avoid using the ":" separator.
(which does not exist for -I). In turn this forces a reimplementation
of the GM2IPATH and GM2OPATH.
* gm2/lang-specs.h: changed all references to gm2l to use the GM2L macro.
Fixed many preprocessor invocation problems which occur when linking
an application which uses the preprocessor.
2018-07-02 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/Make-lang.in: changes to build stage2/gm2/gm2l
* gm2/bnf/gm2l.bnf: remove FORWARD references.
* gm2/gm2-compiler/M2GenGCC.mod: (GetAddressOfUnbounded)
reformatted. (BuildHighFromStaticArray) bug fixes
and reformatted.
* gm2/gm2-libs/GetOpt.def: introduce long options.
* gm2/iso/run/pass/constructor2.mod: reformatted.
2018-06-27 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/gm2-compiler/M2GenGCC.mod: (GetHighFromUnbounded)
check to see if the unbounded array has static array
data type and follow the dimension into the static array
to obtain the correct HIGH value.
(BuildHighFromStaticArray) New procedure function.
* gm2/gm2-compiler/M2Range.mod: add missing case clause.
2018-06-23 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/el/g-mode.el: bug fixes to the m2-tag feature.
* gm2/el/g-mode.el: allow . before a type, keyword,
function and const.
2018-06-22 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/el/g-mode.el: generate types and builtin functions
dependant upon the dialect chosen.
2018-06-21 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/el/g-mode.el: fixed m2-tag (find declaration
understands the path and also works in algol keyword mode.
* gm2/el/g-mode.el: fixed visual parenthesis balancing.
* gm2/el/g-mode.el: removed some debugging statements.
2018-06-20 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/el/g-mode.el: fixed traditional mode. Both algol
mode and traditional are now usable and user selectable.
2018-06-13 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/el/g-mode.el: added ability to turn on/off
lowercase algol style keyword transformation.
Fixed compile-command.
* gm2/el/gm2-mode.el: renamed from g-mode.el.
Changed internal variables from g-mode- to m2-auto-.
2018-06-11 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/el/g-mode.el: added defcustom declarations
and fixed some regexp bugs. Applied some defcustom
implementation features.
* gm2/el/g-mode.el: fixed electric END, ELSE and THEN.
Added more defcustoms.
* gm2/el/g-mode.el: added many more defcustoms. Also
tidied up code and also tightened up types and introduced
radio buttons for language choice. Use inbuilt booleans
for binary choices. Fixed key binding for DEL and
Backspace.
2018-06-08 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/el/g-mode.el: interim checkin, keyword editing
complete (minus delete key).
2018-06-07 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/el/g-mode.el: interim checkin.
* gm2/el/g-mode.el: another interim checkin in
the development of lowercase keywords.
2018-05-24 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/gm2-gcc/m2expr.c: (BuildNotEqualToZero)
new function. (checkWholeNegateOverflow)
re-implemented and in the process fixed bug
and the test
testsuite/gm2/switches/check-all/run/fail/intrange5.mod
passes.
(m2expr_Build4LogicalAnd) New function.
* gm2/gm2-gcc/m2expr.c: renamed BuildLogicalAndIf
to BuildTruthAndIf and renamed BuildLogicalOrIf
to BuildTruthOrIf.
2018-05-23 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* implement range checks on whole number multiply.
* gm2/gm2-compiler/M2GenGCC.mod: import BuildMultCheck.
Call CodeMultCheck in quadruple case statement.
(CodeMultChecked) New procedure. (CodeMultCheck)
New procedure.
* gm2/gm2-gcc/m2expr.c: (checkWholeNegateOverflow)
interm checkin. (checkWholeSubOverflow) corrected
comment. (m2expr_Build3LogicalAnd) New function.
(m2expr_Build4LogicalOr) New function.
(checkWholeMultOverflow) New function.
(checkWholeOverflow) New function.
(m2expr_BuildMultCheck) New function.
* gm2/gm2-gcc/m2expr.def: BuildMultCheck exported.
* gm2/gm2-gcc/m2expr.h: BuildMultCheck defined.
* gm2/gm2-gcc/m2expr.c: added missing semicolon.
2018-04-16 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/Make-lang.in: changed the plugin directory to
plugin rather than gm2/plugin. Corrected .so typeos.
* gm2/gm2.texi: Semantic checking (New section).
* testsuite/gm2/iso/analysis/fail/gm2.exp: New file.
2018-04-14 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/Make-lang.in: build plugin/m2rte.so and create
gm2/plugin directory.
* gm2/gm2-compiler/CLexBuf.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2ALU.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2AsmUtil.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2BasicBlock.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2BasicBlock.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2Batch.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2Const.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2Const.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2Depth.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2Lex.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2LexBuf.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2LexBuf.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2MetaError.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2MetaError.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2Optimize.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/M2Swig.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/NameKey.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/PCSymBuild.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/SymbolKey.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/SymbolTable.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/gm2lcc.mod: removed FORWARD prototype
definitions.
* gm2/gm2-compiler/gm2lgen.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs-ch/libc.c: removed FORWARD prototype
definitions.
* gm2/gm2-libs-coroutines/Debug.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs-coroutines/Debug.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs-min/libc.c: removed FORWARD prototype
definitions.
* gm2/gm2-libs/Args.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs/Args.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs/CmdArgs.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs/Debug.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs/DynamicStrings.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs/DynamicStrings.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs/FIO.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs/NumberIO.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs/PushBackInput.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs/RTExceptions.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs/Scan.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs/StrIO.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs/StrLib.mod: removed FORWARD prototype
definitions.
* gm2/gm2-libs/StringConvert.mod: removed FORWARD prototype
definitions.
* gm2/plugins/m2rte.c: renamed to gm2/plugin/m2rte.c.
* gm2/ulm-lib-gm2/std/RTExceptions.mod: removed FORWARD prototype
definitions.
2018-04-10 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/Make-lang.in: build m2rte plugin, install m2rte plugin.
* gm2/gm2-compiler/M2Base.def: define new exception ExceptionReturn.
* gm2/gm2-compiler/M2Base.mod: implement new exception ExceptionReturn.
* gm2/gm2-compiler/M2Quads.mod: new call to InitReturnRangeCheck.
* gm2/gm2-compiler/M2Range.def: define InitReturnRangeCheck.
* gm2/gm2-compiler/M2Range.mod: (InitReturnRangeCheck),
(FoldReturn), (CodeReturn) New procedures.
* gm2/gm2-lang.c: detect -fno-m2-plugin option.
* gm2/gm2-libs-iso/M2RTS.def: ReturnException defined.
* gm2/gm2-libs-iso/M2RTS.mod: ReturnException implemented.
* gm2/gm2-libs/M2RTS.def: ReturnException defined.
* gm2/gm2-libs/M2RTS.mod: ReturnException implemented.
* gm2/gm2spec.c: detect -fno-m2-plugin and unset boolean if
present. Later insert the -fplugin=m2rte switch if plugins are true.
* gm2/lang-options.h: allow -fm2-plugin and -fno-m2-plugin.
* gm2/lang-specs.h: update dates.
* gm2/lang.opt: define -fm2-plugin and -fno-m2-plugin.
* gm2/m2pp.c: update dates.
* gm2/tools-src/makeSystem: use -fno-m2-plugin when creating system.
* gm2/ulm-lib-gm2/std/M2RTS.mod: ReturnException implemented.
* plugins/m2rte.c: New file.
2018-03-28 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/bnf/m2-2.bnf: updated dates and trimmed end of
line spaces.
* gm2/bnf/m2-c.bnf: updated dates and trimmed end of
line spaces.
* gm2/gm2-compiler/M2Comp.mod: removed p2c forward
declarations.
* gm2/gm2-compiler/M2Quads.mod: (BuildRealFuncProcCall)
corrected comment title. Call SkipConst to skip over
a constant assigned to a procedure. Fixes a bug reported
by Michael Riedl <udo-michael.riedl@t-online.de>.
* gm2/gm2-compiler/P2SymBuild.mod: remove p2c
forward declarations.
* testsuite/gm2/iso/run/pass/constprocedure.mod:
New regression test to stress the bug reported (above).
* testsuite/gm2/iso/fail/constprocedure.mod: New
regression test to test standard functions are not
allowed to be referenced in a const expression.
(But they can be called).
2018-03-27 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/el/g-mode.el: corrected dates and changed name
to help debugging.
* gm2/gm2-compiler/Indexing.mod: removed p2c related
comment.
* gm2/gm2-compiler/M2Error.mod: removed intemediate
record type as we are no longer bootstrapping using
p2c.
* gm2/gm2-compiler/M2GCCDeclare.mod: removed intemediate
record types as we are no longer bootstrapping using
p2c.
* gm2/gm2-compiler/M2Range.mod: removed intemediate
record type as we are no longer bootstrapping using
p2c.
* gm2/gm2-compiler/ppg.mod: removed intemediate
record types as we are no longer bootstrapping using
p2c.
2018-03-26 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/gm2-lang.c: (gm2_langhook_type_for_mode) rewritten
(borrowed code from go-lang.c).
* gm2/gm2-compiler/M2Quads.mod: (BuildAdrFunction)
handle address of unbounded array and check the dimension
access.
2018-03-14 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/gm2-compiler/SymbolTable.mod: (PutUnbounded)
ensure that all dimensions prior to the requested dimension
has an entry in the array. (NulSym is added).
* gm2/gm2-compiler/M2GCCDeclare.mod: (WalkFamilyOfUnbounded)
check that unbounded is not NulSym before calling unboundedp.
* gm2/gm2-compiler/M2Quads.mod: (UnboundedVarLinkToArray)
and (UnboundedNonVarLinkToArray) ensure that all
parameters to BuildAdrFunction propagate the array
and dimension operand stack.
Fixes bugs exposed in
testsuite/gm2/iso/run/pass/adrunbounded3.mod
2018-02-19 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/gm2-compiler/M2Quads.mod: (AssignHighField)
check for ArraySym and use if actual parameter
has different number of dimensions to formal
parameter array.
* gm2/gm2-compiler/M2Quads.mod: (BuildConstHighFromSym)
only access the single dimension when building high
as the array will be referencing the desired dimension.
A temporary type will have been created.
2018-02-15 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/gm2-compiler/M2GenGCC.mod: check and use lvalue op3
which points to the data for the unbounded quadruple.
2018-02-08 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/gm2-compiler/M2Quads.mod: check open array actual
parameter which is indexed and check the dimension against
formal parameters.
2018-02-07 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2/Make-lang.in: added LDFLAGS to the link of mc.
2018-01-28 Gaius Mulley <gaius@gnu.org>
* gm2/bnf/mc-5.bnf: regenerated.
* gm2/mc-boot/GCmdArgs.c: regenerated.
* gm2/mc-boot/GFIO.c: regenerated.
* gm2/mc-boot/GStrIO.c: regenerated.
* gm2/mc-boot/GStringConvert.c: regenerated.
* gm2/mc-boot/Gdecl.c: regenerated.
* gm2/mc-boot/Gdecl.h: regenerated.
* gm2/mc-boot/GmcComp.c: regenerated.
* gm2/mc-boot/GmcLexBuf.c: regenerated.
* gm2/mc-boot/Gmcp1.c: regenerated.
* gm2/mc-boot/Gmcp2.c: regenerated.
* gm2/mc-boot/Gmcp3.c: regenerated.
* gm2/mc-boot/Gmcp4.c: regenerated.
* gm2/mc-boot/Gmcp5.c: regenerated.
* gm2/mc/decl.def: (addElseComments), (addIfEndComments),
(addWhileDoComment), (addWhileEndComment), (addRepeatComment),
(addUntilComment) defined and exported.
* gm2/mc/decl.mod: (commentPair) New record.
Used in funccallT, returnT, whileT, repeatT, ifT, elsifT,
assignmentT. (doAfterCommentC) New procedure.
(doReturnC) Use (doAfterCommentC).
(doAssignmentC) use (doAfterCommentC). (doIfC)
use (doAfterCommentC). (doRepeatC) use (doAfterCommentC).
(doWhileC) use (doAfterCommentC). (doFuncCallC) use
(doAfterCommentC). (addGenericBody) rewritten.
(addIfComments) rewritten. (addElseComments) New
procedure. (addIfEndComments) New procedure.
(addWhileDoComment) New procedure. (addWhileEndComment)
New procedure. (initPair) New procedure.
(addRepeatComment) New procedure.
(addUntilComment) New procedure.
* gm2/mc/mcLexBuf.mod: fixed an infinite loop bug hunting
for the next token on a buffer boundary case.
2018-01-26 Gaius Mulley <gaius@gnu.org>
* gm2/Make-lang.in: added extra commented definition for
bootstrapping under trunc.
* gm2/bnf/mc-1.bnf: changed comment interface.
* gm2/bnf/mc-2.bnf: removed unnecessary import.
* gm2/bnf/mc-5.bnf: rewritten the comment interface for
after and body comments.
* gm2/mc-boot/GCmdArgs.c: rebuilt.
* gm2/mc-boot/GDebug.c: rebuilt.
* gm2/mc-boot/GDynamicStrings.c: rebuilt.
* gm2/mc-boot/GFIO.c: rebuilt.
* gm2/mc-boot/GFormatStrings.c: rebuilt.
* gm2/mc-boot/GFpuIO.c: rebuilt.
* gm2/mc-boot/GIO.c: rebuilt.
* gm2/mc-boot/GIndexing.c: rebuilt.
* gm2/mc-boot/GM2EXCEPTION.c: rebuilt.
* gm2/mc-boot/GM2RTS.c: rebuilt.
* gm2/mc-boot/GM2RTS.h: rebuilt.
* gm2/mc-boot/GNumberIO.c: rebuilt.
* gm2/mc-boot/GRTExceptions.c: rebuilt.
* gm2/mc-boot/GRTint.c: rebuilt.
* gm2/mc-boot/GSFIO.c: rebuilt.
* gm2/mc-boot/GStorage.c: rebuilt.
* gm2/mc-boot/GStrIO.c: rebuilt.
* gm2/mc-boot/GStrLib.c: rebuilt.
* gm2/mc-boot/GStringConvert.c: rebuilt.
* gm2/mc-boot/GSysStorage.c: rebuilt.
* gm2/mc-boot/Gdecl.c: rebuilt.
* gm2/mc-boot/Gdecl.h: rebuilt.
* gm2/mc-boot/Gkeyc.c: rebuilt.
* gm2/mc-boot/Glibc.h: rebuilt.
* gm2/mc-boot/GmcComment.c: rebuilt.
* gm2/mc-boot/GmcComment.h: rebuilt.
* gm2/mc-boot/GmcComp.c: rebuilt.
* gm2/mc-boot/GmcComp.h: rebuilt.
* gm2/mc-boot/GmcError.c: rebuilt.
* gm2/mc-boot/GmcLexBuf.c: rebuilt.
* gm2/mc-boot/GmcLexBuf.h: rebuilt.
* gm2/mc-boot/GmcMetaError.c: rebuilt.
* gm2/mc-boot/GmcOptions.c: rebuilt.
* gm2/mc-boot/GmcPretty.c: rebuilt.
* gm2/mc-boot/GmcPrintf.c: rebuilt.
* gm2/mc-boot/GmcQuiet.c: rebuilt.
* gm2/mc-boot/GmcSearch.c: rebuilt.
* gm2/mc-boot/Gmcp1.c: rebuilt.
* gm2/mc-boot/Gmcp2.c: rebuilt.
* gm2/mc-boot/Gmcp3.c: rebuilt.
* gm2/mc-boot/Gmcp4.c: rebuilt.
* gm2/mc-boot/Gmcp5.c: rebuilt.
* gm2/mc-boot/GnameKey.c: rebuilt.
* gm2/mc-boot/GsymbolKey.c: rebuilt.
* gm2/mc-boot/Gvarargs.c: rebuilt.
* gm2/mc-boot/Gwrapc.h: rebuilt.
* gm2/mc/decl.def: (addCommentBody) New procedure.
(addCommentAfter) New procedure. (addIfComments)
New procedure. (makeCommentS) New procedure.
(getCommentCharStar) New procedure function.
(getContent) New procedure function.
(setProcedureComment) New procedure function.
(getProcedureComment) New procedure function.
(getAfterStatementComment) New procedure function.
(getInbodyStatementComment) New procedure function.
(isProcedureComment) New procedure function.
(isBodyComment) New procedure function.
(isAfterComment) New procedure function.
* gm2/mc/decl.mod: many alterations to allow per node
after and body comments.
* gm2/mc/keyc.mod: add free and malloc to the list of
names to avoid.
* gm2/mc/mc.flex: many alterations to allow per node
after and body comments.
* gm2/mc/mcComment.def: (commentDesc) New datatype.
(initComment) New procedure function. (addText)
New procedure. (getContent) New procedure function.
* gm2/mc/mcComment.h: updated with new interface.
* gm2/mc/mcComment.mod: (commentDesc) New datatype
implemented.
(initComment) New procedure function. (addText)
New procedure. (getContent) New procedure function.
* gm2/mc/mcComp.def: export getPassNo.
* gm2/mc/mcComp.mod: (getPassNo) New procedure function.
* gm2/mc/mcLexBuf.def: (getProcedureComment) New procedure
function. (getBodyComment) New procedure function.
(getAfterComment) New procedure function.
* gm2/mc/mcLexBuf.h: replicate .def functionality.
* gm2/mc/mcLexBuf.mod: (getProcedureComment) Implement new
procedure function. (getBodyComment) Implement new
procedure function.
2018-01-03 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: (BuildUnaryCheckProcedure)
imported. (BuildNegateCheck) imported. (CodeStatement)
use BuildNegateCheck. (CodeUnaryCheck) New procedure.
(CodeNegateChecked) New procedure.
* gm2/gm2-gcc/m2expr.c: (checkUnaryWholeOverflow) New
function. (m2expr_build_unary_op_check) New function.
(BuildEqualToZero) New function.
(checkWholeNegateOverflow) New function.
(BuildNegateCheck) New function. (BuildNegate)
reimplemented.
* gm2/gm2-gcc/m2expr.def: (BuildUnaryCheckProcedure)
Defined. (BuildNegateCheck) defined.
* gm2/gm2-gcc/m2expr.h: (BuildNegateCheck) added prototype.
2018-01-02 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: (CodeStatement) call
CodeAddChecked and call CodeSubChecked.
(CodeAddChecked) New procedure. (CodeSubChecked)
New procedure.
* gm2/gm2-compiler/M2Quads.mod: (BuildEndFor) suppress
overflow checking in the addition
of the loop variable. The explicit for loop check will
catch an overflow and this addition can overflow for
unsigned types counting down.
* gm2/gm2-gcc/m2expr.c: (BuildAddCheck) corrected
comments and strip results. (BuildSubCheck) corrected
comments and strip results.
* gm2/gm2-gcc/m2range.h: (New file).
* gm2/patches/gcc/trunc: (Regenerated).
2018-01-01 Gaius Mulley <gaius@gnu.org>
* gm2/gm2-compiler/M2GenGCC.mod: (CodeAddCheck) New procedure.
(CodeSubCheck) New procedure. (CodeBinaryCheck) New procedure.
Use CodeAddCheck and CodeSubCheck.
* gm2/gm2-compiler/M2Range.def: (GetMinMax) exported.
* gm2/gm2-gcc/m2expr.c: (BuildAddCheck) New function.
(BuildSubCheck) New function. (checkWholeAddOverflow)
parameters changed. (checkWholeSubOverflow) New function.
(checkWholeOverflow) updated parameters to include subrange min
and max. (build_binary_op_check) New function. (build_binary_op)
call build_binary_op_check.
* gm2/gm2-gcc/m2expr.def: (BuildBinCheckProcedure) New
definition. (BuildSubCheck) New procedure function.
(BuildAddCheck) New procedure function.
* gm2/gm2-gcc/m2expr.h: (BuildAddCheck) New prototype.
(BuildSubCheck) New prototype.
* gm2/gm2-compiler/M2GenGCC.mod: pass lowest into binop.
* gm2/gm2-gcc/m2expr.c: (BuildAddCheck) extra parameter lowest.
(BuildSubCheck) extra parameter lowest. Call build_binary_op
with extra parameter lowest. (BuildLessThanZero) New function.
(BuildGreaterThanZero) New function. (checkWholeAddOverflow)
extra parameter and use BuildLessThanZero and
BuildGreaterThanZero. (checkWholeSubOverflow)
extra parameter and use BuildLessThanZero and
BuildGreaterThanZero. (checkWholeOverflow) call
checkWholeAddOverflow and checkWholeSubOverflow with an extra
parameter.
* gm2/gm2-gcc/m2expr.def: (BuildBinCheckProcedure) extra
parameter. (BuildSubCheck) extra parameter lowest.
(BuildAddCheck) extra parameter lowest.
* gm2/gm2-gcc/m2expr.h: corrected prototype.

4637
gcc/m2/ChangeLog-2019 Normal file

File diff suppressed because it is too large Load Diff

1707
gcc/m2/ChangeLog-2020 Normal file

File diff suppressed because it is too large Load Diff

3238
gcc/m2/ChangeLog-2021 Normal file

File diff suppressed because it is too large Load Diff

945
gcc/m2/ChangeLog-2022 Normal file
View File

@@ -0,0 +1,945 @@
2022-05-30 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2-compiler/M2Options.def (cflag): New boolean.
(Setc) New procedure. (Getc) New procedure function.
* gm2-compiler/M2Options.mod (Setc): New procedure.
(Getc) New procedure function. Initialize cflag to
FALSE.
* gm2-gcc/m2options.h (Setc): New external function.
(Getc) New external function.
* gm2-lang.cc: Handle OPT_c and call M2Options_Setc.
* lang-specs.h: Remove all link rules for m2.
* lang.opt: Allow m2 to process the -c option.
* All m2 linking is disabled.
2022-05-20 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* m2pp.cc: (Renamed from m2pp.c). Comments tidied up.
* Make-lang.in: m2pp.c changed to m2pp.cc.
(m2rte.so) Added insn-flags.h as a dependent
2022-05-19 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2-gcc/m2builtins.cc: Corrected comments (specifically
those referring to .c files).
* gm2-gcc/m2convert.cc: Corrected comments (specifically
those referring to .c files).
* gm2-gcc/m2expr.cc: Corrected comments (specifically
those referring to .c files).
* gm2-gcc/m2statement.cc: Corrected comments (specifically
those referring to .c files).
* gm2-gcc/m2treelib.cc: Corrected comments (specifically
those referring to .c files).
* gm2-gcc/m2type.cc: Corrected comments (specifically
those referring to .c files).
* gm2-gcc/rtegraph.cc: Corrected comments (specifically
those referring to .c files).
* gm2-lang.cc: Corrected comments (specifically
those referring to .c files).
* plugin/m2rte.cc: Reformatted comments.
* lang-options.h: (Removed).
* plugin/m2rte.cc: Further reformatting of comments.
* gm2-gcc/m2statement.cc: Corrected comment formatting and
removed usused debugging code.
* gm2-gcc/m2assert.cc: Corrected comment formatting.
* gm2-gcc/m2block.cc: Corrected comment formatting.
* gm2-gcc/m2builtins.cc: Corrected comment formatting.
* gm2-gcc/m2convert.cc: Corrected comment formatting.
* gm2-gcc/m2decl.cc: Corrected comment formatting.
* gm2-gcc/m2except.cc: Corrected comment formatting.
* gm2-gcc/m2expr.cc: Corrected comment formatting.
* gm2-gcc/m2linemap.cc: Corrected comment formatting.
* gm2-gcc/m2statement.cc: Corrected comment formatting.
* gm2-gcc/m2treelib.cc: Corrected comment formatting.
* gm2-gcc/m2type.cc: Corrected comment formatting.
* gm2-gcc/rtegraph.cc: Corrected comment formatting.
* gm2-gcc/m2color.h: Corrected comment formatting.
* gm2-gcc/gcc-consolidation.h: Corrected comment formatting.
2022-05-16 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* plugin/m2rte.cc (alias.h, predict.h, tm.h)
(stringpool.h, toplev.h, basic-block.h, hash-table.h)
(vec.h, ggc.h, basic-block.h, tree-ssa-alias.h)
(internal-fn.h, gimple-fold.h, tree-eh.h, gimple-expr.h)
(is-a.h): Header file includes removed.
(plugin/m2rte$(exeext).so) Make dependent upon
$(GCC_HEADER_DEPENDENCIES_FOR_M2) and insn-addr-common.h.
2022-05-15 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* m2/Make-lang.in (GCC_HEADER_DEPENDENCIES_FOR_M2): New define.
m2/gm2-gcc/%.o: Add GCC_HEADER_DEPENDENCIES_FOR_M2 as a dependent.
m2/gm2-lang.o: Add GCC_HEADER_DEPENDENCIES_FOR_M2 as a dependent.
m2/stor-layout.o: Add GCC_HEADER_DEPENDENCIES_FOR_M2 as a
dependent.
m2/m2pp.o: Add GCC_HEADER_DEPENDENCIES_FOR_M2 as a
dependent.
m2/gm2-gcc/rtegraph.o: Add GCC_HEADER_DEPENDENCIES_FOR_M2 as a
dependent.
c-family/m2pp.o: Add GCC_HEADER_DEPENDENCIES_FOR_M2 as a
dependent. Added new comments.
* m2/tools-src/calcpath: Remove -e option to realpath
to help the build on FreeBSD.
2022-05-13 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2-compiler/ppg.mod: Reduced the line wrap marker
to ensure texi pretty print rules do not cause overful box errors
in gm2 pdf documentation.
* gm2-libs-iso/SYSTEM.def: Shorten the comment lines
and parameter lists per line to avoid overful box errors.
* gm2-libs/Assertion.def: Shorten the comment lines
and parameter lists per line to avoid overful box errors.
* gm2-libs/Builtins.def: Shorten the comment lines
and parameter lists per line to avoid overful box errors.
* gm2-libs/Builtins.mod: Name change n to nbytes for memcpy,
memset and memmove.
* gm2-libs/DynamicStrings.def: Shorten the comment lines
and parameter lists per line to avoid overful box errors.
* gm2-libs/Environment.def: Shorten the comment lines
and parameter lists per line to avoid overful box errors.
* gm2-libs/FIO.def: Shorten the comment lines
and parameter lists per line to avoid overful box errors.
* gm2-libs/FIO.mod: Shorten the comment lines
and parameter lists per line to avoid overful box errors.
* gm2-libs/FormatStrings.def: Shorten the comment lines
and parameter lists per line to avoid overful box errors.
* gm2-libs/FpuIO.def: Shorten the comment lines
and parameter lists per line to avoid overful box errors.
* gm2-libs/GetOpt.def: Shorten the comment lines
and parameter lists per line to avoid overful box errors.
* gm2-libs/SYSTEM.def: Shorten the comment lines
and parameter lists per line to avoid overful box errors.
2022-05-05 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* m2-link-support.h (GM2CC): Add CC1_SPEC to the cc1/cc1plus
invocation.
2022-05-04 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* m2/m2-link-support.h (RM_IF_NOSAVETEMP) New macro.
(GM2CC) Use RM_IF_NOSAVETEMP on the assembler intermediate file.
(GM2LCC) Use RM_IF_NOSAVETEMP when creating an archive of the
application. (GEN_SCAFFOLD_SRC) Use RM_IF_NOSAVETEMP when
creating the scaffold source program. (M2LINK) Use
RM_IF_NOSAVETEMP when creating the assembler source name and use
RM_IF_NOSAVETEMP when creating the main program object.
2022-05-03 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* Make-lang.in: Replaced sh with $(SHELL).
* gm2-lang.cc (gm2_langhook_post_options): Assign
main_input_filename. (gm2_parse_input_files) Assign
main_input_filename before every source filename is compiled.
2022-04-29 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* m2/gm2-libs-ch/SysExceptions.c: Replace sigfpe with sigfpe_ to
avoid name clash with C signal infastructure.
* m2/mc-boot-ch/GSysExceptions.c: Replace sigfpe with sigfpe_ to
avoid name clash with C signal infastructure.
2022-04-28 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* Make-lang.in: Added $(INCLUDES) to all %.o rules requiring gmp.h.
* mc-boot/Gkeyc.c: Rebuilt.
* mc/keyc.mod (initMacros): Add sigfpe to the list of names to be
avoided.
* m2/mc-boot/GEnvironment.c: Rebuilt.
* mc-boot/GEnvironment.h: Rebuilt.
* mc-boot/Gdecl.c: Rebuilt.
* mc-boot/Gkeyc.c: Rebuilt.
* mc-boot/Glibc.h: Rebuilt.
* mc/keyc.mod (initMacros): Add trunc to the list of functions to
be avoided.
2022-04-20 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* tools-src/mklink.c (FindObject): Replace calls to sprintf
with calls to snprintf.
2022-03-02 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* ChangeLog: Correct month for last commit.
2022-03-02 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* ChangeLog-2021: (New file).
2022-03-02 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2-libs/Args.def (GetArg): Corrected formatting.
* gm2-libs/Environment.def (GetEnvironment): Renamed parameter
a to dest. (PutEnvironment) New procedure function.
* gm2-libs/Environment.mod (GetEnvironment): Renamed parameter
a to dest. (PutEnvironment) New procedure function.
* gm2-libs/SEnvironment.def (GetEnvironment): Renamed parameter
a to dest. (PutEnvironment) New procedure function.
* gm2-libs/SEnvironment.mod (GetEnvironment): Renamed parameter
a to dest. (PutEnvironment) New procedure function.
* gm2-libs/libc.def: Export list introduced identifiers putenv, execv.
* m2/m2-link-support.h: Ensure that the scaffold program
is not deleted if the user specified -fmakeinit.
* mc-boot-ch/Glibc.c (libc_putenv): New function.
* ChangeLog-2021: (New file).
* m2/m2-link-support.h (GEN_SCAFFOLD_SRC): New definition.
(M2LINK) use GEN_SCAFFOLD_SRC to generate the scaffold name.
* m2/configure.ac: Added rule to test for Python3. Added rule to
detect realpath.
2022-01-25 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* gm2spec.cc: Replaced save_switch by fe_save_switch.
Replaced xputenv by fe_putenv. Replaced xgetenv by fe_getenv.
2022-01-23 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* mc/decl.mod: (isZtypeEquivalent) New procedure function.
(isEquivalentType) New procedure function. (doExprCastC)
Added header comment and check for type equivalence.
(needsCast) Added header comment and skip types for
the formal and actual parameters before comparison.
Add check for actual = nil parameter. (checkSystemCast)
check for actual = nil being passed to a pointer parameter.
* mc-boot/GArgs.c: Rebuilt.
* mc-boot/GCmdArgs.c: Rebuilt.
* mc-boot/GDebug.c: Rebuilt.
* mc-boot/GDynamicStrings.c: Rebuilt.
* mc-boot/GEnvironment.c: Rebuilt.
* mc-boot/GFIO.c: Rebuilt.
* mc-boot/GFormatStrings.c: Rebuilt.
* mc-boot/GIO.c: Rebuilt.
* mc-boot/GIndexing.c: Rebuilt.
* mc-boot/GM2RTS.c: Rebuilt.
* mc-boot/GNumberIO.c: Rebuilt.
* mc-boot/GPushBackInput.c: Rebuilt.
* mc-boot/GRTExceptions.c: Rebuilt.
* mc-boot/GRTint.c: Rebuilt.
* mc-boot/GStdIO.c: Rebuilt.
* mc-boot/GStrCase.c: Rebuilt.
* mc-boot/GStrIO.c: Rebuilt.
* mc-boot/GStrLib.c: Rebuilt.
* mc-boot/GStringConvert.c: Rebuilt.
* mc-boot/GSysStorage.c: Rebuilt.
* mc-boot/GTimeString.c: Rebuilt.
* mc-boot/Galists.c: Rebuilt.
* mc-boot/Gdecl.c: Rebuilt.
* mc-boot/Gkeyc.c: Rebuilt.
* mc-boot/Glists.c: Rebuilt.
* mc-boot/GmcComment.c: Rebuilt.
* mc-boot/GmcError.c: Rebuilt.
* mc-boot/GmcLexBuf.c: Rebuilt.
* mc-boot/GmcMetaError.c: Rebuilt.
* mc-boot/GmcOptions.c: Rebuilt.
* mc-boot/GmcPretty.c: Rebuilt.
* mc-boot/GmcPrintf.c: Rebuilt.
* mc-boot/GmcSearch.c: Rebuilt.
* mc-boot/GmcStack.c: Rebuilt.
* mc-boot/Gmcp1.c: Rebuilt.
* mc-boot/Gmcp2.c: Rebuilt.
* mc-boot/Gmcp3.c: Rebuilt.
* mc-boot/Gmcp4.c: Rebuilt.
* mc-boot/Gmcp5.c: Rebuilt.
* mc-boot/GnameKey.c: Rebuilt.
* mc-boot/GsymbolKey.c: Rebuilt.
* mc-boot/Gvarargs.c: Rebuilt.
* mc-boot/Gwlists.c: Rebuilt.
2022-01-22 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* mc/decl.mod: (doReturnC) Use getExprType rather than getType.
(getExprType) Added header comment.
* mc-boot/GCmdArgs.c: Rebuilt.
* mc-boot/GDynamicStrings.c: Rebuilt.
* mc-boot/GFIO.c: Rebuilt.
* mc-boot/GFormatStrings.c: Rebuilt.
* mc-boot/GFpuIO.c: Rebuilt.
* mc-boot/GIO.c: Rebuilt.
* mc-boot/GIndexing.c: Rebuilt.
* mc-boot/GM2EXCEPTION.c: Rebuilt.
* mc-boot/GM2RTS.c: Rebuilt.
* mc-boot/GNumberIO.c: Rebuilt.
* mc-boot/GPushBackInput.c: Rebuilt.
* mc-boot/GRTExceptions.c: Rebuilt.
* mc-boot/GRTint.c: Rebuilt.
* mc-boot/GSArgs.c: Rebuilt.
* mc-boot/GSFIO.c: Rebuilt.
* mc-boot/GStorage.c: Rebuilt.
* mc-boot/GStrCase.c: Rebuilt.
* mc-boot/GStrIO.c: Rebuilt.
* mc-boot/GStrLib.c: Rebuilt.
* mc-boot/GStringConvert.c: Rebuilt.
* mc-boot/GSysStorage.c: Rebuilt.
* mc-boot/Galists.c: Rebuilt.
* mc-boot/Gdecl.c: Rebuilt.
* mc-boot/Gkeyc.c: Rebuilt.
* mc-boot/Glists.c: Rebuilt.
* mc-boot/GmcComment.c: Rebuilt.
* mc-boot/GmcComp.c: Rebuilt.
* mc-boot/GmcError.c: Rebuilt.
* mc-boot/GmcFileName.c: Rebuilt.
* mc-boot/GmcLexBuf.c: Rebuilt.
* mc-boot/GmcMetaError.c: Rebuilt.
* mc-boot/GmcOptions.c: Rebuilt.
* mc-boot/GmcPreprocess.c: Rebuilt.
* mc-boot/GmcPretty.c: Rebuilt.
* mc-boot/GmcPrintf.c: Rebuilt.
* mc-boot/GmcSearch.c: Rebuilt.
* mc-boot/GmcStack.c: Rebuilt.
* mc-boot/GmcStream.c: Rebuilt.
* mc-boot/Gmcp1.c: Rebuilt.
* mc-boot/Gmcp2.c: Rebuilt.
* mc-boot/Gmcp3.c: Rebuilt.
* mc-boot/Gmcp4.c: Rebuilt.
* mc-boot/Gmcp5.c: Rebuilt.
* mc-boot/GnameKey.c: Rebuilt.
* mc-boot/GsymbolKey.c: Rebuilt.
* mc-boot/Gvarargs.c: Rebuilt.
* mc-boot/Gwlists.c: Rebuilt.
2022-01-22 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* mc-boot-ch/Gabort.c: (New file).
* Make-lang.in: Use $(CXX) rather than $(CC). Use $(CC) rather
than $(HOSTCC) when compiling mcflex.c. Invoke $(M2LINK) with
--langc++ rather than --g++. (MCC_ARGS) changed to use
--olang=c++. (m2/ppg$(exeext)) link with Gabort.o and make
dependant upon Gabort.o. (m2/pg$(exeext)) link with Gabort.o
and make dependant upon Gabort.o. (m2/pge$(exeext)) link with
Gabort.o and make dependant upon Gabort.o. (gm2-check-examples)
Removed.
* gm2-ici/m2linemap.c: Introduce extern C for complete source
file.
* gm2-libs-ch/README: Reformatted.
* gm2-libs-ch/RTcodummy.c: Introduce extern C for complete source
file.
* gm2-libs-ch/RTintdummy.c: Introduce extern C for complete source
file.
* gm2-libs-ch/Selective.c: Introduce extern C for complete source
file.
* gm2-libs-ch/SysExceptions.c: Introduce extern C for complete
source file.
* gm2-libs-ch/UnixArgs.c: Introduce extern C for complete source
file.
* gm2-libs-ch/UnixArgs.c: Introduce extern C for complete source
file.
* gm2-libs-ch/cgetopt.c: Introduce extern C for complete source
file.
* gm2-libs-ch/choosetemp.c: Introduce extern C for complete source
file.
* gm2-libs-ch/dtoa.c: Introduce extern C for complete source
file.
* gm2-libs-ch/errno.c: Introduce extern C for complete source
file.
* gm2-libs-ch/host.c: Introduce extern C for complete source
file.
* gm2-libs-ch/ldtoa.c: Introduce extern C for complete source
file.
* gm2-libs-ch/termios.c: Introduce extern C for complete source
file.
* gm2-libs-ch/tools.c: Reformatted source.
* gm2-libs-ch/wrapc.c: Introduce extern C for complete source
file.
* gm2-libs-ch/xlibc.c: Introduce extern C for complete source
file.
* mc-boot-ch/GBuiltins.c: Introduce extern C for complete source
file.
* mc-boot-ch/GRTco.c: Introduce extern C for complete source
file.
* mc-boot-ch/GSYSTEM.c: Introduce extern C for complete source
file.
* mc-boot-ch/GSelective.c: Introduce extern C for complete source
file.
* mc-boot-ch/GSysExceptions.c: Introduce extern C for complete
source file.
* mc-boot-ch/GUnixArgs.c: Introduce extern C for complete source
file.
* mc-boot-ch/Gdtoa.c: Introduce extern C for complete source
file.
* mc-boot-ch/Gerrno.c: Introduce extern C for complete source
file.
* mc-boot-ch/Gldtoa.c: Introduce extern C for complete source
file.
* mc-boot-ch/Glibc.c: Introduce extern C for complete source
file.
* mc-boot-ch/Gmcrts.c: Removed fancy_abort. Introduce extern C for
complete source file.
* mc-boot-ch/Gtermios.c: Introduce extern C for complete source
file.
* mc-boot-ch/Gwrapc.c: Introduce extern C for complete source
file.
* mc-boot/GASCII.c: Rebuilt.
* mc-boot/GASCII.h: Rebuilt.
* mc-boot/GArgs.c: Rebuilt.
* mc-boot/GArgs.h: Rebuilt.
* mc-boot/GAssertion.c: Rebuilt.
* mc-boot/GAssertion.h: Rebuilt.
* mc-boot/GBreak.c: Rebuilt.
* mc-boot/GBreak.h: Rebuilt.
* mc-boot/GCOROUTINES.h: Rebuilt.
* mc-boot/GCmdArgs.c: Rebuilt.
* mc-boot/GCmdArgs.h: Rebuilt.
* mc-boot/GDebug.c: Rebuilt.
* mc-boot/GDebug.h: Rebuilt.
* mc-boot/GDynamicStrings.c: Rebuilt.
* mc-boot/GDynamicStrings.h: Rebuilt.
* mc-boot/GEnvironment.c: Rebuilt.
* mc-boot/GEnvironment.h: Rebuilt.
* mc-boot/GFIO.c: Rebuilt.
* mc-boot/GFIO.h: Rebuilt.
* mc-boot/GFormatStrings.c Rebuilt.:
* mc-boot/GFormatStrings.h: Rebuilt.
* mc-boot/GFpuIO.c: Rebuilt.
* mc-boot/GFpuIO.h: Rebuilt.
* mc-boot/GIO.c: Rebuilt.
* mc-boot/GIO.h: Rebuilt.
* mc-boot/GIndexing.c: Rebuilt.
* mc-boot/GIndexing.h: Rebuilt.
* mc-boot/GM2EXCEPTION.c: Rebuilt.
* mc-boot/GM2EXCEPTION.h: Rebuilt.
* mc-boot/GM2RTS.c: Rebuilt.
* mc-boot/GM2RTS.h: Rebuilt.
* mc-boot/GMemUtils.c: Rebuilt.
* mc-boot/GMemUtils.h: Rebuilt.
* mc-boot/GNumberIO.c: Rebuilt.
* mc-boot/GNumberIO.h: Rebuilt.
* mc-boot/GPushBackInput.c: Rebuilt.
* mc-boot/GPushBackInput.h: Rebuilt.
* mc-boot/GRTExceptions.c: Rebuilt.
* mc-boot/GRTExceptions.h: Rebuilt.
* mc-boot/GRTco.h: Rebuilt.
* mc-boot/GRTint.c: Rebuilt.
* mc-boot/GRTint.h: Rebuilt.
* mc-boot/GSArgs.c: Rebuilt.
* mc-boot/GSArgs.h: Rebuilt.
* mc-boot/GSFIO.c: Rebuilt.
* mc-boot/GSFIO.h: Rebuilt.
* mc-boot/GSYSTEM.h: Rebuilt.
* mc-boot/GSelective.h: Rebuilt.
* mc-boot/GStdIO.c: Rebuilt.
* mc-boot/GStdIO.h: Rebuilt.
* mc-boot/GStorage.c: Rebuilt.
* mc-boot/GStorage.h: Rebuilt.
* mc-boot/GStrCase.c: Rebuilt.
* mc-boot/GStrCase.h: Rebuilt.
* mc-boot/GStrIO.c: Rebuilt.
* mc-boot/GStrIO.h: Rebuilt.
* mc-boot/GStrLib.c: Rebuilt.
* mc-boot/GStrLib.h: Rebuilt.
* mc-boot/GStringConvert.c: Rebuilt.
* mc-boot/GStringConvert.h: Rebuilt.
* mc-boot/GSysExceptions.h: Rebuilt.
* mc-boot/GSysStorage.c: Rebuilt.
* mc-boot/GSysStorage.h: Rebuilt.
* mc-boot/GTimeString.c: Rebuilt.
* mc-boot/GTimeString.h: Rebuilt.
* mc-boot/GUnixArgs.h: Rebuilt.
* mc-boot/Galists.c: Rebuilt.
* mc-boot/Galists.h: Rebuilt.
* mc-boot/Gdecl.c: Rebuilt.
* mc-boot/Gdecl.h: Rebuilt.
* mc-boot/Gdtoa.h: Rebuilt.
* mc-boot/Gerrno.h: Rebuilt.
* mc-boot/Gkeyc.c: Rebuilt.
* mc-boot/Gkeyc.h: Rebuilt.
* mc-boot/Gldtoa.h: Rebuilt.
* mc-boot/Glibc.h: Rebuilt.
* mc-boot/Glibm.h: Rebuilt.
* mc-boot/Glists.c: Rebuilt.
* mc-boot/Glists.h: Rebuilt.
* mc-boot/GmcComment.c: Rebuilt.
* mc-boot/GmcComment.h: Rebuilt.
* mc-boot/GmcComp.c: Rebuilt.
* mc-boot/GmcComp.h: Rebuilt.
* mc-boot/GmcDebug.c: Rebuilt.
* mc-boot/GmcDebug.h: Rebuilt.
* mc-boot/GmcError.c: Rebuilt.
* mc-boot/GmcError.h: Rebuilt.
* mc-boot/GmcFileName.c: Rebuilt.
* mc-boot/GmcFileName.h: Rebuilt.
* mc-boot/GmcLexBuf.c: Rebuilt.
* mc-boot/GmcLexBuf.h: Rebuilt.
* mc-boot/GmcMetaError.c: Rebuilt.
* mc-boot/GmcMetaError.h: Rebuilt.
* mc-boot/GmcOptions.c: Rebuilt.
* mc-boot/GmcOptions.h: Rebuilt.
* mc-boot/GmcPreprocess.c: Rebuilt.
* mc-boot/GmcPreprocess.h: Rebuilt.
* mc-boot/GmcPretty.c: Rebuilt.
* mc-boot/GmcPretty.h: Rebuilt.
* mc-boot/GmcPrintf.c: Rebuilt.
* mc-boot/GmcPrintf.h: Rebuilt.
* mc-boot/GmcQuiet.c: Rebuilt.
* mc-boot/GmcQuiet.h: Rebuilt.
* mc-boot/GmcReserved.c: Rebuilt.
* mc-boot/GmcReserved.h: Rebuilt.
* mc-boot/GmcSearch.c: Rebuilt.
* mc-boot/GmcSearch.h: Rebuilt.
* mc-boot/GmcStack.c: Rebuilt.
* mc-boot/GmcStack.h: Rebuilt.
* mc-boot/GmcStream.c: Rebuilt.
* mc-boot/GmcStream.h: Rebuilt.
* mc-boot/Gmcflex.h: Rebuilt.
* mc-boot/Gmcp1.c: Rebuilt.
* mc-boot/Gmcp1.h: Rebuilt.
* mc-boot/Gmcp2.c: Rebuilt.
* mc-boot/Gmcp2.h: Rebuilt.
* mc-boot/Gmcp3.c: Rebuilt.
* mc-boot/Gmcp3.h: Rebuilt.
* mc-boot/Gmcp4.c: Rebuilt.
* mc-boot/Gmcp4.h: Rebuilt.
* mc-boot/Gmcp5.c: Rebuilt.
* mc-boot/Gmcp5.h: Rebuilt.
* mc-boot/GnameKey.c: Rebuilt.
* mc-boot/GnameKey.h: Rebuilt.
* mc-boot/GsymbolKey.c: Rebuilt.
* mc-boot/GsymbolKey.h: Rebuilt.
* mc-boot/Gtermios.h: Rebuilt.
* mc-boot/Gtop.c: Rebuilt.
* mc-boot/Gvarargs.c: Rebuilt.
* mc-boot/Gvarargs.h: Rebuilt.
* mc-boot/Gwlists.c: Rebuilt.
* mc-boot/Gwlists.h: Rebuilt.
* mc-boot/Gwrapc.h: Rebuilt.
* mc/decl.mod: (returnT) scope field added. (makeReturn)
initialize scope field. (doReturnC) check scope field and
generate error if expression exists and no return type specified.
Call doExprCastC to cast the return expression.
(outDefC) Call keyc.genConfigSystem before entering extern C
block. (outImpC) Call keyc.genConfigSystem prior to keyc.genDefs.
(outModuleC) Call keyc.genConfigSystem prior to keyc.genDefs.
* mc/keyc.def: (genConfigSystem) exported.
* mc/varargs.mod: (copy) Rewritten pointer arithmetic to allow for
Modula-2 and translated C++ versions to compile cleanly.
* tools-src/mklink.c: Replace option --gcc with --langc. Replace
option --g++ with --langc++.
2022-01-18 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* Make-lang.in: (gm2spec.o) Use gm2spec.cc source
file.
(plugin/m2rte$(exeext).so) Use m2/plugin/m2rte.cc
source file.
(m2/gm2-gcc/%.o) Use .cc rather than .c source files.
(m2/stor-layout.o) Build from stor-layout.cc rather than
stor-layout.c.
* config-lang.in: Renamed all .c files to .cc files.
* gm2-gcc/init.cc: Remamed from m2/gm2-gcc/init.c.
* gm2-gcc/init.h: Summary name change.
* gm2-gcc/m2assert.cc: Remamed from
m2/gm2-gcc/m2assert.c.
* gm2-gcc/m2assert.h: Summary name change.
* gm2-gcc/m2block.cc: Renamed from
m2/gm2-gcc/m2block.c.
* gm2-gcc/m2block.def: Summary name change.
* gcc/m2/gm2-gcc/m2block.h: Summary name change.
* gm2-gcc/m2builtins.cc: Renamed from
m2/gm2-gcc/m2builtins.c.
* gm2-gcc/m2builtins.def: Summary name change.
* gm2-gcc/m2builtins.h: Summary name change.
* gm2-gcc/m2color.cc: Renamed from
m2/gm2-gcc/m2color.c.
* gm2-gcc/m2convert.cc: Renamed from
m2/gm2-gcc/m2convert.c.
* gm2-gcc/m2convert.def: Summary name change.
* gm2-gcc/m2convert.h: Summary name change.
* gm2-gcc/m2decl.cc: Renamed from m2/gm2-gcc/m2decl.c.
* gm2-gcc/m2decl.def: Summary name change.
* gm2-gcc/m2decl.h: Summary name change.
* gm2-gcc/m2except.cc: Renamed from
m2/gm2-gcc/m2except.c.
* gm2-gcc/m2except.h: Summary name change.
* gm2-gcc/m2expr.cc: Renamed from m2/gm2-gcc/m2expr.c.
* gm2-gcc/m2expr.def: Summary name change.
* gm2-gcc/m2expr.h: Summary name change.
* gm2-gcc/m2linemap.cc: Renamed from
m2/gm2-gcc/m2linemap.c.
* gm2-gcc/m2linemap.h: Summary name change.
* gm2-gcc/m2misc.cc: Renamed from m2/gm2-gcc/m2misc.c.
* gm2-gcc/m2misc.def: Summary name change.
* gm2-gcc/m2misc.h: Summary name change.
* gm2-gcc/m2statement.cc: Renamed from
m2/gm2-gcc/m2statement.c.
* gm2-gcc/m2statement.def: Summary name change.
* gm2-gcc/m2statement.h: Summary name change.
* gm2-gcc/m2top.cc: Renamed from m2/gm2-gcc/m2top.c.
* gm2-gcc/m2top.def: Summary name change.
* gm2-gcc/m2top.h: Summary name change.
* gm2-gcc/m2tree.cc: Renamed from m2/gm2-gcc/m2tree.c.
* gm2-gcc/m2tree.def: Summary name change.
* gm2-gcc/m2tree.h: Summary name change.
* gm2-gcc/m2treelib.cc: Renamed from
m2/gm2-gcc/m2treelib.c.
* gm2-gcc/m2treelib.def: Summary name change.
* gm2-gcc/m2treelib.h: Summary name change.
* gm2-gcc/m2type.cc: Renamed from m2/gm2-gcc/m2type.c.
* gm2-gcc/m2type.def: Summary name change.
* gm2-gcc/m2type.h: Summary name change.
* gm2-gcc/rtegraph.cc: Renamed from
m2/gm2-gcc/rtegraph.c.
* gm2-lang.cc: Renamed from m2/gm2-lang.c.
* gm2spec.cc: Renamed from m2/gm2spec.c.
* plugin/m2rte.cc: Renamed from m2/plugin/m2rte.c.
2022-01-18 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* COPYING.FDL: Update copyright notice dates.
* COPYING.RUNTIME: Update copyright notice dates.
* Make-lang.in: Update copyright notice dates.
* bnf/gm2l.bnf: Update copyright notice dates.
* bnf/gm2m.bnf: Update copyright notice dates.
* bnf/m2-1.bnf: Update copyright notice dates.
* bnf/m2-2.bnf: Update copyright notice dates.
* bnf/m2-3.bnf: Update copyright notice dates.
* bnf/m2-c.bnf: Update copyright notice dates.
* bnf/m2-h.bnf: Update copyright notice dates.
* bnf/m2.bnf: Update copyright notice dates.
* bnf/mc-1.bnf: Update copyright notice dates.
* bnf/mc-2.bnf: Update copyright notice dates.
* bnf/mc-3.bnf: Update copyright notice dates.
* bnf/mc-4.bnf: Update copyright notice dates.
* bnf/mc-5.bnf: Update copyright notice dates.
* config-lang.in: Update copyright notice dates.
* configure.ac: Update copyright notice dates.
* gm2-compiler/CLexBuf.def: Update copyright notice dates.
* gm2-compiler/CLexBuf.mod: Update copyright notice dates.
* gm2-compiler/FifoQueue.def: Update copyright notice dates.
* gm2-compiler/FifoQueue.mod: Update copyright notice dates.
* gm2-compiler/Lists.def: Update copyright notice dates.
* gm2-compiler/Lists.mod: Update copyright notice dates.
* gm2-compiler/M2ALU.def: Update copyright notice dates.
* gm2-compiler/M2ALU.mod: Update copyright notice dates.
* gm2-compiler/M2AsmUtil.def: Update copyright notice dates.
* gm2-compiler/M2AsmUtil.mod: Update copyright notice dates.
* gm2-compiler/M2Base.def: Update copyright notice dates.
* gm2-compiler/M2Base.mod: Update copyright notice dates.
* gm2-compiler/M2BasicBlock.def: Update copyright notice dates.
* gm2-compiler/M2BasicBlock.mod: Update copyright notice dates.
* gm2-compiler/M2Batch.def: Update copyright notice dates.
* gm2-compiler/M2Batch.mod: Update copyright notice dates.
* gm2-compiler/M2Bitset.def: Update copyright notice dates.
* gm2-compiler/M2Bitset.mod: Update copyright notice dates.
* gm2-compiler/M2CaseList.def: Update copyright notice dates.
* gm2-compiler/M2CaseList.mod: Update copyright notice dates.
* gm2-compiler/M2Check.def: Update copyright notice dates.
* gm2-compiler/M2Check.mod: Update copyright notice dates.
* gm2-compiler/M2Code.def: Update copyright notice dates.
* gm2-compiler/M2Code.mod: Update copyright notice dates.
* gm2-compiler/M2ColorString.def: Update copyright notice dates.
* gm2-compiler/M2ColorString.mod: Update copyright notice dates.
* gm2-compiler/M2Comp.def: Update copyright notice dates.
* gm2-compiler/M2Comp.mod: Update copyright notice dates.
* gm2-compiler/M2Configure.def: Update copyright notice dates.
* gm2-compiler/M2Configure.mod: Update copyright notice dates.
* gm2-compiler/M2Const.def: Update copyright notice dates.
* gm2-compiler/M2Const.mod: Update copyright notice dates.
* gm2-compiler/M2Debug.def: Update copyright notice dates.
* gm2-compiler/M2Debug.mod: Update copyright notice dates.
* gm2-compiler/M2DebugStack.def: Update copyright notice dates.
* gm2-compiler/M2DebugStack.mod: Update copyright notice dates.
* gm2-compiler/M2Defaults.def: Update copyright notice dates.
* gm2-compiler/M2Defaults.mod: Update copyright notice dates.
* gm2-compiler/M2Depth.def: Update copyright notice dates.
* gm2-compiler/M2Depth.mod: Update copyright notice dates.
* gm2-compiler/M2DriverOptions.def: Update copyright notice dates.
* gm2-compiler/M2DriverOptions.mod: Update copyright notice dates.
* gm2-compiler/M2Emit.def: Update copyright notice dates.
* gm2-compiler/M2Emit.mod: Update copyright notice dates.
* gm2-compiler/M2Error.def: Update copyright notice dates.
* gm2-compiler/M2Error.mod: Update copyright notice dates.
* gm2-compiler/M2EvalSym.def: Update copyright notice dates.
* gm2-compiler/M2FileName.def: Update copyright notice dates.
* gm2-compiler/M2FileName.mod: Update copyright notice dates.
* gm2-compiler/M2GCCDeclare.def: Update copyright notice dates.
* gm2-compiler/M2GCCDeclare.mod: Update copyright notice dates.
* gm2-compiler/M2GenGCC.def: Update copyright notice dates.
* gm2-compiler/M2GenGCC.mod: Update copyright notice dates.
* gm2-compiler/M2Lex.def: Update copyright notice dates.
* gm2-compiler/M2Lex.mod: Update copyright notice dates.
* gm2-compiler/M2LexBuf.def: Update copyright notice dates.
* gm2-compiler/M2LexBuf.mod: Update copyright notice dates.
* gm2-compiler/M2MetaError.def: Update copyright notice dates.
* gm2-compiler/M2MetaError.mod: Update copyright notice dates.
* gm2-compiler/M2Optimize.def: Update copyright notice dates.
* gm2-compiler/M2Optimize.mod: Update copyright notice dates.
* gm2-compiler/M2Options.def: Update copyright notice dates.
* gm2-compiler/M2Options.mod: Update copyright notice dates.
* gm2-compiler/M2Pass.def: Update copyright notice dates.
* gm2-compiler/M2Pass.mod: Update copyright notice dates.
* gm2-compiler/M2Preprocess.def: Update copyright notice dates.
* gm2-compiler/M2Preprocess.mod: Update copyright notice dates.
* gm2-compiler/M2Printf.def: Update copyright notice dates.
* gm2-compiler/M2Printf.mod: Update copyright notice dates.
* gm2-compiler/M2Quads.def: Update copyright notice dates.
* gm2-compiler/M2Quads.mod: Update copyright notice dates.
* gm2-compiler/M2Quiet.def: Update copyright notice dates.
* gm2-compiler/M2Quiet.mod: Update copyright notice dates.
* gm2-compiler/M2Range.def: Update copyright notice dates.
* gm2-compiler/M2Range.mod: Update copyright notice dates.
* gm2-compiler/M2Reserved.def: Update copyright notice dates.
* gm2-compiler/M2Reserved.mod: Update copyright notice dates.
* gm2-compiler/M2SSA.mod: Update copyright notice dates.
* gm2-compiler/M2Scope.def: Update copyright notice dates.
* gm2-compiler/M2Scope.mod: Update copyright notice dates.
* gm2-compiler/M2Search.def: Update copyright notice dates.
* gm2-compiler/M2Search.mod: Update copyright notice dates.
* gm2-compiler/M2Size.def: Update copyright notice dates.
* gm2-compiler/M2Size.mod: Update copyright notice dates.
* gm2-compiler/M2StackAddress.def: Update copyright notice dates.
* gm2-compiler/M2StackAddress.mod: Update copyright notice dates.
* gm2-compiler/M2StackWord.def: Update copyright notice dates.
* gm2-compiler/M2StackWord.mod: Update copyright notice dates.
* gm2-compiler/M2Students.def: Update copyright notice dates.
* gm2-compiler/M2Students.mod: Update copyright notice dates.
* gm2-compiler/M2Swig.def: Update copyright notice dates.
* gm2-compiler/M2Swig.mod: Update copyright notice dates.
* gm2-compiler/M2System.def: Update copyright notice dates.
* gm2-compiler/M2System.mod: Update copyright notice dates.
* gm2-compiler/M2Version.def: Update copyright notice dates.
* gm2-compiler/NameKey.def: Update copyright notice dates.
* gm2-compiler/NameKey.mod: Update copyright notice dates.
* gm2-compiler/ObjectFiles.def: Update copyright notice dates.
* gm2-compiler/ObjectFiles.mod: Update copyright notice dates.
* gm2-compiler/Output.def: Update copyright notice dates.
* gm2-compiler/Output.mod: Update copyright notice dates.
* gm2-compiler/P0SymBuild.def: Update copyright notice dates.
* gm2-compiler/P0SymBuild.mod: Update copyright notice dates.
* gm2-compiler/P0SyntaxCheck.def: Update copyright notice dates.
* gm2-compiler/P1Build.def: Update copyright notice dates.
* gm2-compiler/P1SymBuild.def: Update copyright notice dates.
* gm2-compiler/P1SymBuild.mod: Update copyright notice dates.
* gm2-compiler/P2Build.def: Update copyright notice dates.
* gm2-compiler/P2SymBuild.def: Update copyright notice dates.
* gm2-compiler/P2SymBuild.mod: Update copyright notice dates.
* gm2-compiler/P3Build.def: Update copyright notice dates.
* gm2-compiler/P3SymBuild.def: Update copyright notice dates.
* gm2-compiler/P3SymBuild.mod: Update copyright notice dates.
* gm2-compiler/PCBuild.def: Update copyright notice dates.
* gm2-compiler/PCSymBuild.def: Update copyright notice dates.
* gm2-compiler/PCSymBuild.mod: Update copyright notice dates.
* gm2-compiler/PHBuild.def: Update copyright notice dates.
* gm2-compiler/Sets.def: Update copyright notice dates.
* gm2-compiler/Sets.mod: Update copyright notice dates.
* gm2-compiler/SymbolConversion.def: Update copyright notice dates.
* gm2-compiler/SymbolConversion.mod: Update copyright notice dates.
* gm2-compiler/SymbolKey.def: Update copyright notice dates.
* gm2-compiler/SymbolKey.mod: Update copyright notice dates.
* gm2-compiler/SymbolTable.def: Update copyright notice dates.
* gm2-compiler/SymbolTable.mod: Update copyright notice dates.
* gm2-compiler/bnflex.def: Update copyright notice dates.
* gm2-compiler/bnflex.mod: Update copyright notice dates.
* gm2-compiler/cflex.def: Update copyright notice dates.
* gm2-compiler/gm2.mod: Update copyright notice dates.
* gm2-compiler/gm2lcc.mod: Update copyright notice dates.
* gm2-compiler/gm2lgen.mod: Update copyright notice dates.
* gm2-compiler/gm2lorder.mod: Update copyright notice dates.
* gm2-compiler/m2flex.def: Update copyright notice dates.
* gm2-compiler/ppg.mod: Update copyright notice dates.
* gm2-gcc/dynamicstrings.h: Update copyright notice dates.
* gm2-gcc/gcc-consolidation.h: Update copyright notice dates.
* gm2-gcc/init.c: Update copyright notice dates.
* gm2-gcc/init.def: Update copyright notice dates.
* gm2-gcc/init.h: Update copyright notice dates.
* gm2-gcc/m2assert.c: Update copyright notice dates.
* gm2-gcc/m2assert.h: Update copyright notice dates.
* gm2-gcc/m2block.c: Update copyright notice dates.
* gm2-gcc/m2block.def: Update copyright notice dates.
* gm2-gcc/m2block.h: Update copyright notice dates.
* gm2-gcc/m2builtins.c: Update copyright notice dates.
* gm2-gcc/m2builtins.def: Update copyright notice dates.
* gm2-gcc/m2builtins.h: Update copyright notice dates.
* gm2-gcc/m2color.c: Update copyright notice dates.
* gm2-gcc/m2color.def: Update copyright notice dates.
* gm2-gcc/m2color.h: Update copyright notice dates.
* gm2-gcc/m2convert.c: Update copyright notice dates.
* gm2-gcc/m2convert.def: Update copyright notice dates.
* gm2-gcc/m2convert.h: Update copyright notice dates.
* gm2-gcc/m2decl.c: Update copyright notice dates.
* gm2-gcc/m2decl.def: Update copyright notice dates.
* gm2-gcc/m2decl.h: Update copyright notice dates.
* gm2-gcc/m2except.c: Update copyright notice dates.
* gm2-gcc/m2except.def: Update copyright notice dates.
* gm2-gcc/m2except.h: Update copyright notice dates.
* gm2-gcc/m2expr.c: Update copyright notice dates.
* gm2-gcc/m2expr.def: Update copyright notice dates.
* gm2-gcc/m2expr.h: Update copyright notice dates.
* gm2-gcc/m2linemap.c: Update copyright notice dates.
* gm2-gcc/m2linemap.def: Update copyright notice dates.
* gm2-gcc/m2linemap.h: Update copyright notice dates.
* gm2-gcc/m2misc.c: Update copyright notice dates.
* gm2-gcc/m2misc.def: Update copyright notice dates.
* gm2-gcc/m2misc.h: Update copyright notice dates.
* gm2-gcc/m2options.h: Update copyright notice dates.
* gm2-gcc/m2range.h: Update copyright notice dates.
* gm2-gcc/m2search.h: Update copyright notice dates.
* gm2-gcc/m2statement.c: Update copyright notice dates.
* gm2-gcc/m2statement.def: Update copyright notice dates.
* gm2-gcc/m2statement.h: Update copyright notice dates.
* gm2-gcc/m2top.c: Update copyright notice dates.
* gm2-gcc/m2top.def: Update copyright notice dates.
* gm2-gcc/m2top.h: Update copyright notice dates.
* gm2-gcc/m2tree.c: Update copyright notice dates.
* gm2-gcc/m2tree.def: Update copyright notice dates.
* gm2-gcc/m2tree.h: Update copyright notice dates.
* gm2-gcc/m2treelib.c: Update copyright notice dates.
* gm2-gcc/m2treelib.def: Update copyright notice dates.
* gm2-gcc/m2treelib.h: Update copyright notice dates.
* gm2-gcc/m2type.c: Update copyright notice dates.
* gm2-gcc/m2type.def: Update copyright notice dates.
* gm2-gcc/m2type.h: Update copyright notice dates.
* gm2-gcc/rtegraph.c: Update copyright notice dates.
* gm2-gcc/rtegraph.h: Update copyright notice dates.
* gm2-internals.texi: Update copyright notice dates.
* gm2-lang.c: Update copyright notice dates.
* gm2-lang.h: Update copyright notice dates.
* gm2-libs-ch/RTcodummy.c: Update copyright notice dates.
* gm2-libs-ch/RTintdummy.c: Update copyright notice dates.
* gm2-libs-ch/Selective.c: Update copyright notice dates.
* gm2-libs-ch/SysExceptions.c: Update copyright notice dates.
* gm2-libs-ch/UnixArgs.c: Update copyright notice dates.
* gm2-libs-ch/cgetopt.c: Update copyright notice dates.
* gm2-libs-ch/choosetemp.c: Update copyright notice dates.
* gm2-libs-ch/dtoa.c: Update copyright notice dates.
* gm2-libs-ch/errno.c: Update copyright notice dates.
* gm2-libs-ch/host.c: Update copyright notice dates.
* gm2-libs-ch/ldtoa.c: Update copyright notice dates.
* gm2-libs-ch/pthdummy.c: Update copyright notice dates.
* gm2-libs-ch/termios.c: Update copyright notice dates.
* gm2-libs-ch/tools.c: Update copyright notice dates.
* gm2-libs-ch/wrapc.c: Update copyright notice dates.
* gm2-libs-ch/xlibc.c: Update copyright notice dates.
* gm2-libs-coroutines/Debug.def: Update copyright notice dates.
* gm2-libs-coroutines/Debug.mod: Update copyright notice dates.
* gm2-libs-coroutines/Executive.def: Update copyright notice dates.
* gm2-libs-coroutines/Executive.mod: Update copyright notice dates.
* gm2-libs-coroutines/KeyBoardLEDs.def: Update copyright notice dates.
* gm2-libs-coroutines/README.texi: Update copyright notice dates.
* gm2-libs-coroutines/SYSTEM.def: Update copyright notice dates.
* gm2-libs-coroutines/SYSTEM.mod: Update copyright notice dates.
* gm2-libs-coroutines/TimerHandler.def: Update copyright notice dates.
* gm2-libs-coroutines/TimerHandler.mod: Update copyright notice dates.
* gm2config.h.in: Update copyright notice dates.
* gm2spec.c: Update copyright notice dates.
* gm2version.h: Update copyright notice dates.
* lang-options.h: Update copyright notice dates.
* lang-specs.h: Update copyright notice dates.
* lang.opt: Update copyright notice dates.
* m2-link-support.h: Update copyright notice dates.
* m2-tree.def: Update copyright notice dates.
* m2-tree.h: Update copyright notice dates.
* m2.flex: Update copyright notice dates.
* m2pp.c: Update copyright notice dates.
* m2pp.h: Update copyright notice dates.
* mc-boot-ch/GBuiltins.c: Update copyright notice dates.
* mc-boot-ch/GRTco.c: Update copyright notice dates.
* mc-boot-ch/GSYSTEM.c: Update copyright notice dates.
* mc-boot-ch/GSelective.c: Update copyright notice dates.
* mc-boot-ch/GSysExceptions.c: Update copyright notice dates.
* mc-boot-ch/GUnixArgs.c: Update copyright notice dates.
* mc-boot-ch/Gcbuiltin.c: Update copyright notice dates.
* mc-boot-ch/Gdtoa.c: Update copyright notice dates.
* mc-boot-ch/Gerrno.c: Update copyright notice dates.
* mc-boot-ch/Gldtoa.c: Update copyright notice dates.
* mc-boot-ch/Glibc.c: Update copyright notice dates.
* mc-boot-ch/Glibm.c: Update copyright notice dates.
* mc-boot-ch/Gmcrts.c: Update copyright notice dates.
* mc-boot-ch/Gmcrts.h: Update copyright notice dates.
* mc-boot-ch/Gnetwork.h: Update copyright notice dates.
* mc-boot-ch/Gpth.c: Update copyright notice dates.
* mc-boot-ch/Gtermios.c: Update copyright notice dates.
* mc-boot-ch/Gwrapc.c: Update copyright notice dates.
* mc-boot-ch/network.c: Update copyright notice dates.
* mc/Indexing.def: Update copyright notice dates.
* mc/Indexing.mod: Update copyright notice dates.
* mc/alists.def: Update copyright notice dates.
* mc/alists.mod: Update copyright notice dates.
* mc/decl.def: Update copyright notice dates.
* mc/decl.mod: Update copyright notice dates.
* mc/keyc.def: Update copyright notice dates.
* mc/keyc.mod: Update copyright notice dates.
* mc/lists.def: Update copyright notice dates.
* mc/lists.mod: Update copyright notice dates.
* mc/m2flex.def: Update copyright notice dates.
* mc/mc.flex: Update copyright notice dates.
* mc/mcComment.def: Update copyright notice dates.
* mc/mcComment.h: Update copyright notice dates.
* mc/mcComment.mod: Update copyright notice dates.
* mc/mcComp.def: Update copyright notice dates.
* mc/mcComp.mod: Update copyright notice dates.
* mc/mcDebug.def: Update copyright notice dates.
* mc/mcDebug.mod: Update copyright notice dates.
* mc/mcError.def: Update copyright notice dates.
* mc/mcError.mod: Update copyright notice dates.
* mc/mcFileName.def: Update copyright notice dates.
* mc/mcFileName.mod: Update copyright notice dates.
* mc/mcLexBuf.def: Update copyright notice dates.
* mc/mcLexBuf.h: Update copyright notice dates.
* mc/mcLexBuf.mod: Update copyright notice dates.
* mc/mcMetaError.def: Update copyright notice dates.
* mc/mcMetaError.mod: Update copyright notice dates.
* mc/mcOptions.def: Update copyright notice dates.
* mc/mcOptions.mod: Update copyright notice dates.
* mc/mcPreprocess.def: Update copyright notice dates.
* mc/mcPreprocess.mod: Update copyright notice dates.
* mc/mcPretty.def: Update copyright notice dates.
* mc/mcPretty.mod: Update copyright notice dates.
* mc/mcPrintf.def: Update copyright notice dates.
* mc/mcPrintf.mod: Update copyright notice dates.
* mc/mcQuiet.def: Update copyright notice dates.
* mc/mcQuiet.mod: Update copyright notice dates.
* mc/mcReserved.def: Update copyright notice dates.
* mc/mcReserved.h: Update copyright notice dates.
* mc/mcReserved.mod: Update copyright notice dates.
* mc/mcSearch.def: Update copyright notice dates.
* mc/mcSearch.mod: Update copyright notice dates.
* mc/mcStack.def: Update copyright notice dates.
* mc/mcStack.mod: Update copyright notice dates.
* mc/mcStream.def: Update copyright notice dates.
* mc/mcStream.mod: Update copyright notice dates.
* mc/mcflex.def: Update copyright notice dates.
* mc/mcp1.def: Update copyright notice dates.
* mc/mcp2.def: Update copyright notice dates.
* mc/mcp3.def: Update copyright notice dates.
* mc/mcp4.def: Update copyright notice dates.
* mc/mcp5.def: Update copyright notice dates.
* mc/nameKey.def: Update copyright notice dates.
* mc/nameKey.mod: Update copyright notice dates.
* mc/symbolKey.def: Update copyright notice dates.
* mc/symbolKey.mod: Update copyright notice dates.
* mc/top.mod: Update copyright notice dates.
* mc/varargs.def: Update copyright notice dates.
* mc/varargs.mod: Update copyright notice dates.
* mc/wlists.def: Update copyright notice dates.
* mc/wlists.mod: Update copyright notice dates.
* tools-src/array2index.py: Update copyright notice dates.
* tools-src/boilerplate.py: Update copyright notice dates.
* tools-src/buildpg: Update copyright notice dates.
* tools-src/buildsyntax: Update copyright notice dates.
* tools-src/calcpath: Update copyright notice dates.
* tools-src/createUlmSys: Update copyright notice dates.
* tools-src/def2texi.py: Update copyright notice dates.
* tools-src/gensum.py: Update copyright notice dates.
* tools-src/incfile: Update copyright notice dates.
* tools-src/makeSystem: Update copyright notice dates.
* tools-src/makeconfigure: Update copyright notice dates.
* tools-src/makeversion: Update copyright notice dates.
* tools-src/mklink.c: Update copyright notice dates.
* tools-src/tidydates.py: Update copyright notice dates.
2022-01-11 Gaius Mulley <gaiusmod2@gmail.com>
* Make-lang.in (m2/gm2spec.o): Added $(LIBS) to the dependants.
(stage1/m2/gm2l): Added $(LIBS) to the dependants.
(stage1/m2/gm2lcc): Added $(LIBS) to the dependants.
(stage1/m2/gm2lgen): Added $(LIBS) to the dependants.
(stage1/m2/gm2lorder): Added $(LIBS) to the dependants.
(stage1/m2/gm2m): Added $(LIBS) to the dependants.
2022-01-04 Gaius Mulley <gaius.mulley@southwales.ac.uk>
* mc/decl.mod: Added missing comments to many procedures.
(getStringContents) Completed missing code removing a --fixme--.
(getLiteralStringContents) New procedure function.
(doMakeEnumField) Return f even if an error should occur.
* mc-boot/Gdecl.c: Rebuilt.

1653
gcc/m2/Make-lang.in Normal file

File diff suppressed because it is too large Load Diff

856
gcc/m2/Make-maintainer.in Normal file
View File

@@ -0,0 +1,856 @@
# Make-maintainer.in build support tools for GNU M2.
# Copyright (C) 2022 Free Software Foundation, Inc.
#This file is part of GCC.
#GCC is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 3, or (at your option)
#any later version.
#GCC is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#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/>.
# QUIAT=@
XGCC = ./xgcc -B./
GM2_2 = ./gm2 -B./stage2/m2 -g -fm2-g
# m2/ppg$(exeext) is the recursive descent parser generator.
PPG-INTERFACE-C = libc.c mcrts.c Selective.c termios.c \
SysExceptions.c wrapc.c \
SYSTEM.c errno.c
PPG-INTERFACE-CC = UnixArgs.cc ldtoa.cc dtoa.cc
# Implementation modules found in the gm2-compiler directory.
PPG-MODS = SymbolKey.mod NameKey.mod Lists.mod bnflex.mod Output.mod
# Core library definition modules used by ppg found in the gm2-libs directory.
PPG-LIB-DEFS = Args.def Assertion.def ASCII.def Debug.def \
DynamicStrings.def FIO.def Indexing.def IO.def \
NumberIO.def PushBackInput.def \
M2Dependent.def \
M2EXCEPTION.def M2LINK.def M2RTS.def \
RTExceptions.def \
StdIO.def SFIO.def StrIO.def StrLib.def \
Storage.def StrCase.def SysStorage.def
# Core library implementation modules used by ppg found in the gm2-libs directory.
PPG-LIB-MODS = ASCII.mod \
Args.mod \
Assertion.mod \
Debug.mod \
DynamicStrings.mod \
FIO.mod \
IO.mod \
Indexing.mod \
M2Dependent.mod \
M2EXCEPTION.mod \
M2RTS.mod \
NumberIO.mod \
PushBackInput.mod \
RTExceptions.mod \
SFIO.mod \
StdIO.mod \
Storage.mod \
StrCase.mod \
StrIO.mod \
StrLib.mod \
SysStorage.mod
# Program module ppg.mod from which pge.mod is created. ppg.mod is
# where changes should be made and then you should run pge-maintainer
# to recreate the C++ version of pge.
PPG-SRC = ppg.mod
BUILD-PPG-O = $(PPG-INTERFACE-C:%.c=m2/gm2-ppg-boot/$(SRC_PREFIX)%.o) \
$(PPG-INTERFACE-CC:%.cc=m2/gm2-ppg-boot/$(SRC_PREFIX)%.o) \
$(PPG-MODS:%.mod=m2/gm2-ppg-boot/$(SRC_PREFIX)%.o) \
$(PPG-LIB-MODS:%.mod=m2/gm2-ppg-boot/$(SRC_PREFIX)%.o) \
$(PPG-SRC:%.mod=m2/gm2-ppg-boot/$(SRC_PREFIX)%.o)
MCC_ARGS= --olang=c++ \
--quiet \
--h-file-prefix=$(SRC_PREFIX) \
-I$(srcdir)/m2/gm2-libs \
-I$(srcdir)/m2/gm2-compiler \
-I$(srcdir)/m2/gm2-libiberty \
-I$(srcdir)/m2/gm2-gcc
MCC=m2/boot-bin/mc$(exeext) $(MCC_ARGS)
BUILD-PPG-LIBS-H = $(PPG-LIB-DEFS:%.def=m2/gm2-ppg-boot/$(SRC_PREFIX)%.h)
BUILD-PPG-H = m2/boot-bin/mc$(exeext) $(BUILD-PPG-LIBS-H)
m2/gm2-ppg-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs/%.def $(MCDEPS)
$(MCC) -o=$@ $(srcdir)/m2/gm2-libs/$*.def
m2/gm2-ppg-boot/$(SRC_PREFIX)%.o: m2/mc-boot-ch/$(SRC_PREFIX)%.c m2/gm2-libs/gm2-libs-host.h
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs $(INCLUDES) -g -c $< -o $@
m2/gm2-ppg-boot/$(SRC_PREFIX)%.o: m2/mc-boot-ch/$(SRC_PREFIX)%.cc m2/gm2-libs/gm2-libs-host.h
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs $(INCLUDES) -g -c $< -o $@
m2/gm2-ppg-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-BOOT-H)
$(MCC) -o=m2/gm2-ppg-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-libs/$*.mod
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) \
-Im2/gm2-ppg-boot -I$(srcdir)/m2/mc-boot -Im2/gm2-libs-boot \
-I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c m2/gm2-ppg-boot/$(SRC_PREFIX)$*.c -o $@
m2/gm2-ppg-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-compiler/%.mod $(MCDEPS) $(BUILD-BOOT-H)
$(MCC) -o=m2/gm2-ppg-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-compiler/$*.mod
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) \
-Im2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \
-I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c m2/gm2-ppg-boot/$(SRC_PREFIX)$*.c -o $@
m2/ppg$(exeext): m2/boot-bin/mc $(BUILD-PPG-O) $(BUILD-MC-INTERFACE-O) m2/gm2-ppg-boot/main.o \
m2/gm2-libs-boot/RTcodummy.o m2/mc-boot-ch/$(SRC_PREFIX)abort.o \
m2/gm2-libs-boot/M2LINK.o
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(BUILD-PPG-O) m2/gm2-ppg-boot/main.o \
m2/gm2-libs-boot/RTcodummy.o m2/mc-boot-ch/$(SRC_PREFIX)abort.o \
m2/gm2-libs-boot/M2LINK.o -lm
m2/gm2-ppg-boot/main.o: $(M2LINK) $(srcdir)/m2/init/mcinit
unset CC ; $(M2LINK) -s --langc++ --exit --name mainppginit.c $(srcdir)/m2/init/ppginit
mv mainppginit.c m2/gm2-ppg-boot/main.c
$(CXX) $(INCLUDES) -g -c -o $@ m2/gm2-ppg-boot/main.c
m2/gm2-auto:
test -d $@ || mkdir -p $@
# m2/pg$(exext) is the 2nd generation parser generator built from ebnf
# without error recovery
PG-SRC = pg.mod
BUILD-PG-O = $(PPG-INTERFACE-C:%.c=m2/gm2-pg-boot/$(SRC_PREFIX)%.o) \
$(PPG-INTERFACE-CC:%.cc=m2/gm2-pg-boot/$(SRC_PREFIX)%.o) \
$(PPG-MODS:%.mod=m2/gm2-pg-boot/$(SRC_PREFIX)%.o) \
$(PPG-LIB-MODS:%.mod=m2/gm2-pg-boot/$(SRC_PREFIX)%.o) \
$(PG-SRC:%.mod=m2/gm2-pg-boot/$(SRC_PREFIX)%.o)
m2/gm2-pg-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs/%.def $(MCDEPS)
$(MCC) -o=$@ $(srcdir)/m2/gm2-libs/$*.def
m2/gm2-pg-boot/$(SRC_PREFIX)%.o: m2/mc-boot-ch/$(SRC_PREFIX)%.c m2/gm2-libs/gm2-libs-host.h
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs $(INCLUDES) -g -c $< -o $@
m2/gm2-pg-boot/$(SRC_PREFIX)%.o: m2/mc-boot-ch/$(SRC_PREFIX)%.cc m2/gm2-libs/gm2-libs-host.h
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs $(INCLUDES) -g -c $< -o $@
m2/gm2-pg-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-BOOT-H)
$(MCC) -o=m2/gm2-pg-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-libs/$*.mod
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/gm2-pg-boot -I$(srcdir)/m2/mc-boot \
-I$(srcdir)/m2/mc-boot-ch \
-Im2/gm2-libs-boot $(INCLUDES) \
-g -c m2/gm2-pg-boot/$(SRC_PREFIX)$*.c -o $@
m2/gm2-pg-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-compiler/%.mod $(MCDEPS) $(BUILD-BOOT-H)
$(MCC) -o=m2/gm2-pg-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-compiler/$*.mod
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \
-I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c m2/gm2-pg-boot/$(SRC_PREFIX)$*.c -o $@
m2/gm2-pg-boot/$(SRC_PREFIX)pg.o: m2/gm2-auto/pg.mod $(MCDEPS) $(BUILD-BOOT-H)
$(MCC) -o=m2/gm2-pg-boot/$(SRC_PREFIX)pg.c m2/gm2-auto/pg.mod
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \
-I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c m2/gm2-pg-boot/$(SRC_PREFIX)pg.c -o $@
m2/pg$(exeext): m2/boot-bin/mc \
$(BUILD-PG-O) $(GM2-PPG-MODS:%.mod=m2/gm2-pg-boot/%.o) \
$(BUILD-MC-INTERFACE-O) m2/gm2-pg-boot/main.o m2/gm2-libs-boot/RTcodummy.o \
m2/mc-boot-ch/$(SRC_PREFIX)abort.o m2/gm2-libs-boot/M2LINK.o
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(BUILD-PG-O) \
m2/gm2-pg-boot/main.o m2/gm2-libs-boot/RTcodummy.o \
m2/gm2-libs-boot/M2LINK.o \
m2/mc-boot-ch/$(SRC_PREFIX)abort.o -lm
m2/gm2-auto/pginit:
sed -e 's/ppg/pg/' < $(srcdir)/m2/init/ppginit > $@
m2/gm2-pg-boot/main.o: m2/gm2-auto/pginit $(M2LINK)
unset CC ; $(M2LINK) -s --langc++ --exit --name mainpginit.c m2/gm2-auto/pginit
mv mainpginit.c m2/gm2-pg-boot/main.c
$(CXX) $(INCLUDES) -g -c -o $@ m2/gm2-pg-boot/main.c
m2/pg-e$(exeext): m2/pg$(exeext)
$(CP) m2/pg$(exeext) m2/pg-e$(exeext)
$(SHELL) $(srcdir)/m2/tools-src/buildpg $(srcdir)/m2/gm2-compiler/ppg.mod pg -e > m2/gm2-auto/t.bnf
./m2/pg-e$(exeext) -e -l m2/gm2-auto/t.bnf | sed -e 's/t\.bnf/pg\.bnf/' > m2/gm2-auto/t.mod
$(QUIAT)if ! diff m2/gm2-auto/t.mod m2/gm2-auto/pg.mod > /dev/null ; then \
echo "pg failed during self build" ; \
exit 1 ; \
fi
$(RM) m2/gm2-auto/t.bnf m2/gm2-auto/t.mod
m2/gm2-auto/pg.mod: m2/ppg$(exeext)
$(SHELL) $(srcdir)/m2/tools-src/buildpg $(srcdir)/m2/gm2-compiler/ppg.mod pg -e > m2/gm2-auto/pg.bnf
./m2/ppg$(exeext) -e -l m2/gm2-auto/pg.bnf > m2/gm2-auto/pg.mod
# pge is the recursive descent parser with first/followset error recovery.
PGE-SRC = pge.mod
BUILD-PGE-O = $(PPG-INTERFACE-C:%.c=m2/gm2-pge-boot/$(SRC_PREFIX)%.o) \
$(PPG-INTERFACE-CC:%.cc=m2/gm2-pge-boot/$(SRC_PREFIX)%.o) \
$(PPG-MODS:%.mod=m2/gm2-pge-boot/$(SRC_PREFIX)%.o) \
$(PPG-LIB-MODS:%.mod=m2/gm2-pge-boot/$(SRC_PREFIX)%.o) \
$(PGE-SRC:%.mod=m2/gm2-pge-boot/$(SRC_PREFIX)%.o)
m2/gm2-auto/pge.mod: m2/pg$(exeext)
$(SHELL) $(srcdir)/m2/tools-src/buildpg $(srcdir)/m2/gm2-compiler/ppg.mod pge > m2/gm2-auto/pge.bnf
./m2/pg$(exeext) -l m2/gm2-auto/pge.bnf -o m2/gm2-auto/pge.mod
m2/gm2-pge-boot/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs/%.def $(MCDEPS)
$(MCC) -o=$@ $(srcdir)/m2/gm2-libs/$*.def
m2/gm2-pge-boot/$(SRC_PREFIX)libc.o: $(srcdir)/m2/mc-boot-ch/Glibc.c m2/gm2-libs/gm2-libs-host.h
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) $(INCLUDES) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs -g -c $< -o $@
m2/gm2-pge-boot/$(SRC_PREFIX)mcrts.o: $(srcdir)/m2/mc-boot-ch/Gmcrts.c m2/gm2-libs/gm2-libs-host.h
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) $(INCLUDES) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs -g -c $< -o $@
m2/gm2-pge-boot/$(SRC_PREFIX)UnixArgs.o: $(srcdir)/m2/mc-boot-ch/GUnixArgs.cc
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c $< -o $@
m2/gm2-pge-boot/$(SRC_PREFIX)Selective.o: $(srcdir)/m2/mc-boot-ch/GSelective.c m2/gm2-libs/gm2-libs-host.h
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -Im2/gm2-libs -g -c $< -o $@
m2/gm2-pge-boot/$(SRC_PREFIX)termios.o: $(srcdir)/m2/mc-boot-ch/Gtermios.cc m2/gm2-libs/gm2-libs-host.h
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs $(INCLUDES) -g -c $< -o $@
m2/gm2-pge-boot/$(SRC_PREFIX)SysExceptions.o: $(srcdir)/m2/mc-boot-ch/GSysExceptions.c m2/gm2-libs/gm2-libs-host.h
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs $(INCLUDES) -g -c $< -o $@
m2/gm2-pge-boot/$(SRC_PREFIX)ldtoa.o: $(srcdir)/m2/mc-boot-ch/Gldtoa.c m2/gm2-libs/gm2-libs-host.h
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs $(INCLUDES) -g -c $< -o $@
m2/gm2-pge-boot/$(SRC_PREFIX)dtoa.o: $(srcdir)/m2/mc-boot-ch/Gdtoa.c m2/gm2-libs/gm2-libs-host.h
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs $(INCLUDES) -g -c $< -o $@
m2/gm2-pge-boot/$(SRC_PREFIX)wrapc.o: $(srcdir)/m2/mc-boot-ch/Gwrapc.c m2/gm2-libs/gm2-libs-host.h
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs $(INCLUDES) -g -c $< -o $@
m2/gm2-pge-boot/$(SRC_PREFIX)SYSTEM.o: $(srcdir)/m2/mc-boot-ch/GSYSTEM.c
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c $< -o $@
m2/gm2-pge-boot/$(SRC_PREFIX)errno.o: $(srcdir)/m2/mc-boot-ch/Gerrno.c
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c $< -o $@
m2/gm2-pge-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-libs/%.mod $(MCDEPS) $(BUILD-BOOT-H)
$(MCC) -o=m2/gm2-pge-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-libs/$*.mod
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/gm2-pge-boot -I$(srcdir)/m2/mc-boot \
-I$(srcdir)/m2/mc-boot-ch -Im2/gm2-libs-boot \
$(INCLUDES) -g -c m2/gm2-pge-boot/$(SRC_PREFIX)$*.c -o $@
m2/gm2-pge-boot/$(SRC_PREFIX)%.o: $(srcdir)/m2/gm2-compiler/%.mod $(MCDEPS) $(BUILD-BOOT-H)
$(MCC) -o=m2/gm2-pge-boot/$(SRC_PREFIX)$*.c $(srcdir)/m2/gm2-compiler/$*.mod
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) -Im2/mc-boot -Im2/gm2-compiler-boot \
-Im2/gm2-libs-boot \
-I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c m2/gm2-pge-boot/$(SRC_PREFIX)$*.c -o $@
m2/gm2-pge-boot/$(SRC_PREFIX)pge.o: m2/gm2-auto/pge.mod $(MCDEPS) $(BUILD-BOOT-H)
$(MCC) -o=m2/gm2-pge-boot/$(SRC_PREFIX)pge.c m2/gm2-auto/pge.mod
$(CXX) -I. -I$(srcdir)/../include -I$(srcdir) \
-Im2/mc-boot -Im2/gm2-compiler-boot -Im2/gm2-libs-boot \
-I$(srcdir)/m2/mc-boot-ch $(INCLUDES) -g -c m2/gm2-pge-boot/$(SRC_PREFIX)pge.c -o $@
m2/pge$(exeext): m2/boot-bin/mc \
$(BUILD-PGE-O) $(GM2-PPG-MODS:%.mod=m2/gm2-pge-boot/%.o) \
$(BUILD-MC-INTERFACE-O) m2/gm2-pge-boot/main.o m2/gm2-libs-boot/RTcodummy.o \
m2/mc-boot-ch/$(SRC_PREFIX)abort.o m2/gm2-libs-boot/M2LINK.o
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(BUILD-PGE-O) \
m2/gm2-pge-boot/main.o m2/gm2-libs-boot/RTcodummy.o \
m2/mc-boot-ch/$(SRC_PREFIX)abort.o m2/gm2-libs-boot/M2LINK.o -lm
$(SHELL) $(srcdir)/m2/tools-src/buildpg $(srcdir)/m2/gm2-compiler/ppg.mod t > m2/gm2-auto/t.bnf
./m2/pge$(exeext) m2/gm2-auto/t.bnf -o m2/gm2-auto/t1.mod
./m2/pg$(exeext) m2/gm2-auto/t.bnf -o m2/gm2-auto/t2.mod
$(QUIAT)if ! diff m2/gm2-auto/t1.mod m2/gm2-auto/t2.mod > /dev/null ; then \
echo "failure: pg (with error recovery) failed" ; \
$(RM) m2/pge$(exeext) ; \
exit 1 ; \
fi
$(RM) m2/gm2-auto/t.mod m2/gm2-auto/t1.mod m2/gm2-auto/t2.mod
m2/gm2-auto/pgeinit:
sed -e 's/ppg/pge/' < $(srcdir)/m2/init/ppginit > $@
m2/gm2-pge-boot/main.o: m2/gm2-auto/pgeinit $(M2LINK)
unset CC ; $(M2LINK) -s --langc++ --exit --name mainpgeinit.c m2/gm2-auto/pgeinit
mv mainpgeinit.c m2/gm2-pge-boot/main.c
$(CXX) $(INCLUDES) -g -c -o $@ m2/gm2-pge-boot/main.c
$(objdir)/m2/gm2-ppg-boot:
test -d $@ || mkdir $@
$(objdir)/m2/gm2-pg-boot:
test -d $@ || mkdir $@
$(objdir)/m2/gm2-pge-boot:
test -d $@ || mkdir $@
m2/gm2-auto/pg.o: m2/gm2-auto/pg.mod $(MCDEPS)
$(MC) --quiet -o=m2/gm2-auto/pg.c m2/gm2-auto/pg.mod
$(COMPILER) -c $(CFLAGS) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2 -Im2/gm2-libs-boot -Im2/gm2-compiler-boot -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) m2/gm2-auto/pg.c -o $@
m2/gm2-auto/pge.o: m2/gm2-auto/pge.mod $(MCDEPS)
$(MC) --quiet -o=m2/gm2-auto/pge.c m2/gm2-auto/pge.mod
$(COMPILER) -c $(CFLAGS) -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2 -Im2/gm2-libs-boot -Im2/gm2-compiler-boot -I$(srcdir)/m2/mc-boot-ch $(INCLUDES) m2/gm2-auto/pge.c -o $@
pge-help: force
@echo "The pge maintainer commands are:"
@echo " "
@echo " make pge-maintainer"
@echo " make pge-verify"
@echo " make pge-push # copy pge C++ sources (app and libs) into srcdir/m2/pge-boot"
@echo " make pge-libs-push # copy C++ libraries which pge uses into srcdir/m2/pge-boot"
@echo " make pge-app-push # copy pge C++ application modules into srcdir/m2/pge-boot"
@echo " make pge-clean"
pge-maintainer: $(PGE)
# Copy the C++ sources for ppe.mod into $(srcdir)/pge-boot.
pge-push: pge-libs-push pge-app-push
pge-libs-push: force
for i in $(cat $(srcdir)/m2/init/ppginit) ; do \
if [ -f $(srcdir)/m2/gm2-libs-ch/${i}.h ] ; then \
cp $(srcdir)/m2/gm2-libs-ch/${i}.h $(srcdir) ; \
else \
echo "not found ${i}" ; \
fi ; \
if [ -f $(srcdir)/m2/gm2-libs-ch/${i}.c* ] ; then \
cp $(srcdir)/m2/gm2-libs-ch/${i}.c* $(srcdir) ; \
elif [ -f $(srcdir)/m2/gm2-pge-libs/${i}.c* ] ; then \
cp $(srcdir)/m2/gm2-pge-libs/${i}.c* $(srcdir) ; \
else \
echo "not found ${i}" ; \
fi ; \
done
pge-app-push: force
cp m2/gm2-pge-boot/*.c $(srcdir)/m2/pge-boot
# Perform sanity checks.
pge-verify: force
# Remove pge build files.
pge-clean: force
$(RM) -f m2/gm2-pg-boot/* m2/gm2-ppg-boot/* m2/gm2-pge-boot/*
# The rest of the Make-lang.in handles the bootstrap tool (maintained
# mode) and also provides testing between the bootstrapped and the
# non-bootstrapped compilers.
# Rules for mc
# The default rule used generate mc, eventually it will be replaced by mc-bootstrap.
BOOTGM2=gm2
MCOPTIONS=-g -c -fsources -fsoft-check-all -fm2-g # -fauto-init
MCLINK=-g # use -g -fmodules -c if you are debugging and wish to see missing modules.
# This is only needed in maintainer mode by 'make mc-maintainer' when regenerating the C
# version of mc. We need a working Modula-2 compiler to run mc-maintainer.
GM2SYS=${HOME}/opt/lib/gcc/x86_64-pc-linux-gnu/12.0.0/m2/m2pim
GM2PATH=$(srcdir)/m2/mc:$(GM2SYS):$(srcdir)/m2:m2/gm2-auto:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso
mc: mc-clean mc-devel
mc-push: force
cp -p m2/mc-boot-gen/*.c $(srcdir)/m2/mc-boot/
cp -p m2/mc-boot-gen/*.h $(srcdir)/m2/mc-boot/
mc-clean: force m2/mc-obj
$(RM) m2/mc-boot-gen/*.[ch] m2/boot-bin/* m2/mc-boot/* m2/mc-boot-ch/*
mc-maintainer: mc-clean mc-autogen mc-push mc-clean mc-bootstrap
mc-clean-libs: force
$(RM) m2/gm2-libs-boot/*
mc-continue: mc-clean mc-bootstrap mc-clean-libs mc-fresh $(BUILD-MC-INTERFACE-O) $(BUILD-LIBS-BOOT) $(BUILD-COMPILER-BOOT)
mc-fresh: force
$(RM) m2/gm2-auto/* m2/gm2-compiler-boot/* m2/gm2-libs-boot/*
mc-help: force
@echo "mc-maintainer produces a new mc C version in the source tree (takes longer)"
@echo "mc-continue builds the mc from the C version and attempts to build gm2 libraries and gm2 compiler"
@echo "mc-verify builds mc from Modula-2 sources and mc from C sources and run both on all sources diffing the output"
@echo "mc builds mc from Modula-2 sources, quickly"
@echo "m2/pge build the parser generator (needed by mc-maintainer)"
m2/mc-obj:
mkdir $@
mc-verify: mc-clean mc-bootstrap mc
mv mc m2/boot-bin/mc.m2
@echo "verifying the two generations of mc"
for i in $(GM2-VERIFY-MODS) ; do \
echo -n "$$i " ; \
m2/boot-bin/mc $(MC_ARGS) -o=mcout.c $(srcdir)/m2/gm2-compiler/$$i > /dev/null ; \
echo -n "[1]" ; \
m2/boot-bin/mc.m2 $(MC_ARGS) -o=mcout.m2 $(srcdir)/m2/gm2-compiler/$$i > /dev/null ; \
echo -n "[2]" ; \
$(RM) $$i.mc-diff ; \
if [ -f mcout.c -a -f mcout.m2 ] ; then \
if diff mcout.c mcout.m2 > /dev/null ; then \
echo "[passed]" ; \
else \
echo "[*** failed ***]" ; \
diff mcout.c mcout.m2 > $$i.mc-diff ; \
fi \
fi ; \
$(RM) mcout.c mcout.m2 ; \
done
mc-stage2: force
m2/boot-bin/mc$(exeext) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=m2/mc-boot-gen/GmcStream.c $(srcdir)/m2/mc/mcStream.mod
m2/boot-bin/mc$(exeext) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=m2/mc-boot-gen/Gdecl.c $(srcdir)/m2/mc/decl.mod
if diff m2/mc-boot-gen/Gdecl.c $(srcdir)/m2/mc-boot/Gdecl.c ; then echo "passed" ; else echo "failed" ; fi
# mc-devel - compiles mc using gm2
mc-devel: m2/boot-bin/mc-devel$(exeext)
m2/boot-bin/mc-devel$(exeext): m2/mc-obj/mcp1.mod \
m2/mc-obj/mcp2.mod \
m2/mc-obj/mcp3.mod \
m2/mc-obj/mcp4.mod \
m2/mc-obj/mcp5.mod \
mcflex.c \
m2/mc-boot-ch/Gabort.o
$(RM) -rf mc-obj
mkdir mc-obj
$(CC) -I$(srcdir)/m2/mc -c -g mcflex.c -o mc-obj/mcflex.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/decl.mod -o mc-obj/decl.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcStream.mod -o mc-obj/mcStream.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcPretty.mod -o mc-obj/mcPretty.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcStack.mod -o mc-obj/mcStack.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/varargs.mod -o mc-obj/varargs.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcMetaError.mod -o mc-obj/mcMetaError.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcOptions.mod -o mc-obj/mcOptions.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcComp.mod -o mc-obj/mcComp.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) m2/mc-obj/mcp1.mod -o mc-obj/mcp1.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) m2/mc-obj/mcp2.mod -o mc-obj/mcp2.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) m2/mc-obj/mcp3.mod -o mc-obj/mcp3.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) m2/mc-obj/mcp4.mod -o mc-obj/mcp4.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) m2/mc-obj/mcp5.mod -o mc-obj/mcp5.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/wlists.mod -o mc-obj/wlists.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/alists.mod -o mc-obj/alists.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/symbolKey.mod -o mc-obj/symbolKey.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcReserved.mod -o mc-obj/mcReserved.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/nameKey.mod -o mc-obj/nameKey.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcSearch.mod -o mc-obj/mcSearch.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcFileName.mod -o mc-obj/mcFileName.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcLexBuf.mod -o mc-obj/mcLexBuf.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcQuiet.mod -o mc-obj/mcQuiet.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcError.mod -o mc-obj/mcError.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcDebug.mod -o mc-obj/mcDebug.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcPrintf.mod -o mc-obj/mcPrintf.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/Indexing.mod -o mc-obj/Indexing.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcPreprocess.mod -o mc-obj/mcPreprocess.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/keyc.mod -o mc-obj/keyc.o
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) $(srcdir)/m2/mc/mcComment.mod -o mc-obj/mcComment.o
$(BOOTGM2) $(MCLINK) -I. -fscaffold-main -I$(GM2PATH) \
-fuse-list=$(srcdir)/m2/init/mcinit $(srcdir)/m2/mc/top.mod -o mc \
m2/gm2-libs-boot/RTcodummy.o \
m2/gm2-libs-boot/dtoa.o m2/gm2-libs-boot/ldtoa.o mc-obj/*o m2/mc-boot-ch/Gabort.o
m2/boot-bin/mc-opt$(exeext): m2/mc-obj/mcp1.mod \
m2/mc-obj/mcp2.mod \
m2/mc-obj/mcp3.mod \
m2/mc-obj/mcp4.mod \
m2/mc-obj/mcp5.mod \
mcflex.c
g++ -I$(srcdir)/m2/mc -c -g mcflex.c
$(BOOTGM2) -fsources -fm2-whole-program -g -I$(srcdir)/m2/mc:$(objdir)/m2/mc-obj:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/mc $(srcdir)/m2/mc/top.mod
m2/mc/decl.o: $(srcdir)/m2/mc/decl.mod
$(BOOTGM2) $(MCOPTIONS) -I$(GM2PATH) -o $@ $(srcdir)/m2/mc/decl.mod
m2/mc-obj/%.mod: $(srcdir)/m2/mc/%.bnf $(PGE)
$(PGE) -l $< -o $@
gm2-bootstrap: mc-devel
for i in $(srcdir)/m2/gm2-libs/*.def ; do echo $$i ; ./mc --gcc-config-system -I$(srcdir)/m2/gm2-libs $$i ; done
for i in $(srcdir)/m2/gm2-compiler/*.def ; do echo $$i ; ./mc --gcc-config-system -I$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-gcc $$i ; done
for i in $(srcdir)/m2/gm2-libs/*.mod ; do echo $$i ; ./mc --gcc-config-system -I$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-gcc $$i ; done
$(objdir)/plugin:
test -d $@ || mkdir -p $@
$(objdir)/m2/mc-boot:
test -d $@ || mkdir -p $@
$(objdir)/m2/mc-boot-ch:
test -d $@ || mkdir -p $@
$(objdir)/m2/mc-boot-gen:
test -d $@ || mkdir -p $@
mc-autogen: mc-clean mc-devel \
$(BUILD-MC-BOOT-H) $(BUILD-MC-BOOT-C) \
$(BUILD-MC-BOOT-AUTO-C)
for i in m2/mc-boot-gen/*.c ; do \
echo $(CXX) -g -c -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/mc-boot-gen/ $$i -o m2/mc-boot-gen/`basename $$i .c`.o ; \
$(CXX) -g -c -I. -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/m2/mc-boot-ch -Im2/mc-boot-gen/ $$i -o m2/mc-boot-gen/`basename $$i .c`.o ; done
@echo -n "built "
@cd m2/mc-boot-gen ; ls *.o | wc -l
@echo -n "out of "
@cd m2/mc-boot-gen ; ls *.c | wc -l
@echo "modules"
# EXTENDED_OPAQUE = --extended-opaque
EXTENDED_OPAQUE =
MC_OPTIONS = $(MC_COPYRIGHT) --gcc-config-system --olang=c++
m2/mc-boot-gen/$(SRC_PREFIX)%.h: $(srcdir)/m2/mc/%.def
./mc $(MC_OPTIONS) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
m2/mc-boot-gen/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs/%.def
./mc $(MC_OPTIONS) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
m2/mc-boot-gen/$(SRC_PREFIX)decl.c: $(srcdir)/m2/mc/decl.mod
./mc $(MC_OPTIONS) --extended-opaque -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
m2/mc-boot-gen/$(SRC_PREFIX)%.c: $(srcdir)/m2/mc/%.mod
./mc $(MC_OPTIONS) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
m2/mc-boot-gen/$(SRC_PREFIX)%.c: $(srcdir)/m2/gm2-libs/%.mod
./mc $(MC_OPTIONS) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
m2/mc-boot-gen/$(SRC_PREFIX)%.h: $(srcdir)/m2/gm2-libs-iso/%.def
./mc $(MC_OPTIONS) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
m2/mc-boot-gen/$(SRC_PREFIX)%.c: m2/mc-obj/%.mod
./mc $(MC_OPTIONS) -I$(srcdir)/m2/mc:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-libs-iso $(EXTENDED_OPAQUE) --h-file-prefix=$(SRC_PREFIX) -o=$@ $<
# mc-bootstrap compiles mc using the C version previously generated by mc-autogen.
# These autogenerated files will be checked into git by the maintainer.
mc-bootstrap: mc-clean m2/boot-bin/mc$(exeext)
gm2.maintainer-reconfigure: force
autoconf $(srcdir)/m2/gm2-libs/config-host.in > $(srcdir)/m2/gm2-libs/config-host
( cd $(srcdir)/m2/gm2-libs ; autoheader config-host.in )
( cd $(srcdir)/m2 ; autoconf configure.in > configure )
gm2.maintainer-clean: force
-rm -f $(srcdir)/m2/gm2-auto/*
-rm -f $(srcdir)/m2/gm2-libs.texi
-rm -f $(srcdir)/m2/gm2-ebnf.texi
-rm -f $(srcdir)/m2/images/gnu.eps
gm2.maintainer-help: force
@echo "make knows about:"
@echo " "
@echo "make gm2.maintainer-help this command"
@echo "make gm2.maintainer-reconfigure rebuild the configure scripts"
@echo "make gm2.maintainer-clean clean pre-built images and texi files"
#
# verify the compiler can be built across three generations of cc1gm2 diffing assembly output.
# stage1/m2/cc1gm2 built by translating M2 into C++.
# stage2/m2/cc1gm2 built from stage1/m2/cc1gm2.
# stage3/m2/cc1gm2 built from stage2/m2/cc1gm2.
#
# GM2-VERIFY-MODS is a list of modules which have no __DATE__ stamp inside them
# and thus they can be built by the different versions of gm2.
# This list is used for testing only.
GM2-VERIFY-MODS = FifoQueue.mod M2AsmUtil.mod M2Optimize.mod \
M2StackWord.mod M2Pass.mod M2Batch.mod \
M2Quads.mod M2Comp.mod M2Reserved.mod \
M2Debug.mod M2Defaults.mod NameKey.mod \
M2FileName.mod P0SymBuild.mod P1SymBuild.mod P2SymBuild.mod \
P3SymBuild.mod \
SymbolKey.mod SymbolTable.mod M2Error.mod \
M2StackAddress.mod \
M2Students.mod \
M2BasicBlock.mod M2Code.mod M2GenGCC.mod M2GCCDeclare.mod\
M2ALU.mod M2System.mod M2Base.mod Lists.mod \
M2Search.mod bnflex.mod ppg.mod Output.mod \
SymbolConversion.mod \
M2Preprocess.mod M2Printf.mod M2LexBuf.mod M2Quiet.mod \
M2Bitset.mod M2Size.mod CLexBuf.mod M2Scope.mod \
M2Range.mod M2Swig.mod M2MetaError.mod Sets.mod \
M2CaseList.mod PCSymBuild.mod M2Const.mod \
M2DebugStack.mod ObjectFiles.mod M2ColorString.mod M2Emit.mod
GM2-VERIFY-AUTO = P1Build.mod P2Build.mod PCBuild.mod P3Build.mod \
PHBuild.mod pg.mod P0SyntaxCheck.mod
GM2_LIBS_PARANOID = m2/gm2-compiler-paranoid/gm2.a \
m2/gm2-libs-paranoid/libgm2.a # build it again using GM2_LIBS
gm2.paranoid: stage3/m2/cc1gm2$(exeext) gm2.verifyparanoid
stage3/m2/cc1gm2$(exeext): stage2/m2/cc1gm2$(exeext) m2/gm2-compiler-paranoid/m2flex.o \
$(P) $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) $(GM2_LIBS_PARANOID) \
m2/gm2-gcc/rtegraph.o plugin/m2rte$(exeext).so m2/gm2-libs-boot/M2LINK.o
@$(call LINK_PROGRESS,$(INDEX.m2),start)
+$(LLINKER) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GM2_C_OBJS) m2/gm2-compiler-paranoid/m2flex.o \
attribs.o \
$(GM2_LIBS_PARANOID) \
$(BACKEND) $(LIBS) m2/gm2-gcc/rtegraph.o m2/gm2-libs-boot/M2LINK.o \
$(BACKENDLIBS) $(LIBSTDCXX) -lm
@$(call LINK_PROGRESS,$(INDEX.m2),end)
# gm2.verifyparanoid diffs the output of all three compilers with the compiler source code
gm2.verifyparanoid: stage1/m2/cc1gm2$(exeext) stage2/m2/cc1gm2$(exeext) stage3/m2/cc1gm2$(exeext) force
@echo "verifying the three generations of GNU Modula-2 compilers - it may take some time.."
$(QUIAT)for i in $(GM2-VERIFY-MODS) ; do \
echo -n "$$i " ; \
./gm2 -S $(GM2_FLAGS) -c -B./stage1/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty $(srcdir)/m2/gm2-compiler/$$i -o m2/gm2-compiler-verify/1.s ; \
echo -n "[1]" ; \
./gm2 -S $(GM2_FLAGS) -c -B./stage2/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty $(srcdir)/m2/gm2-compiler/$$i -o m2/gm2-compiler-verify/2.s ; \
echo -n "[2]" ; \
./gm2 -S $(GM2_FLAGS) -c -B./stage3/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty $(srcdir)/m2/gm2-compiler/$$i -o m2/gm2-compiler-verify/3.s ; \
echo -n "[3]" ; \
if ! diff m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/2.s > m2/gm2-compiler-verify/1_2.diff 2>&1 ; then \
echo -n " [stage 1 and stage 2 differ]" ; \
cp m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.1.lst ; \
cp m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.2.lst ; \
echo " " ; \
exit 1 ; \
fi ; \
if ! diff m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/3.s > m2/gm2-compiler-verify/2_3.diff 2>&1 ; then \
echo -n " [stage 2 and stage 3 differ]" ; \
cp m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.2.lst ; \
cp m2/gm2-compiler-verify/3.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.3.lst ; \
fi ; \
echo " " ; \
done
$(QUIAT)echo "now verifying automatically built modules"
$(QUIAT)for i in x $(GM2-VERIFY-AUTO) ; do \
if [ -f m2/gm2-auto/$$i ] ; then \
echo -n "$$i " ; \
./gm2 -S $(GM2_FLAGS) -c -B./stage1/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty m2/gm2-auto/$$i -o m2/gm2-compiler-verify/1.s ; \
echo -n "[1]" ; \
./gm2 -S $(GM2_FLAGS) -c -B./stage2/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty m2/gm2-auto/$$i -o m2/gm2-compiler-verify/2.s ; \
echo -n "[2]" ; \
./gm2 -S $(GM2_FLAGS) -c -B./stage3/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty m2/gm2-auto/$$i -o m2/gm2-compiler-verify/3.s ; \
echo -n "[3]" ; \
if ! diff m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/2.s > m2/gm2-compiler-verify/1_2.diff 2>&1 ; then \
echo -n " [stage 1 and stage 2 differ]" ; \
cp m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.1.lst ; \
cp m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.2.lst ; \
echo " " ; \
exit 1 ; \
fi ; \
if ! diff m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/3.s > m2/gm2-compiler-verify/2_3.diff 2>&1 ; then \
echo -n " [stage 2 and stage 3 differ]" ; \
cp m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.2.lst ; \
cp m2/gm2-compiler-verify/3.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.3.lst ; \
fi ; \
echo " " ; \
fi ; \
done ; \
$(RM) -f m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/3.s m2/gm2-compiler-verify/2_3.diff m2/gm2-compiler-verify/1_2.diff
# gm2.verifystage12 diffs the output of the stage1 and stage2 compilers with the compiler source code
gm2.verifystage12: force stage1/m2/cc1gm2$(exeext) stage2/m2/cc1gm2$(exeext)
@echo "verifying stage1 and stage2 generations of GNU Modula-2 compilers - it may take some time.."
$(QUIAT)for i in $(GM2-VERIFY-MODS) ; do \
echo -n "$$i " ; \
./gm2 -S $(GM2_FLAGS) -c -B./stage1/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty $(srcdir)/m2/gm2-compiler/$$i -o m2/gm2-compiler-verify/1.s ; \
echo -n "[1]" ; \
./gm2 -S $(GM2_FLAGS) -c -B./stage2/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty $(srcdir)/m2/gm2-compiler/$$i -o m2/gm2-compiler-verify/2.s ; \
echo -n "[2]" ; \
if ! diff m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/2.s > m2/gm2-compiler-verify/1_2.diff 2>&1 ; then \
echo -n " [stage 1 and stage 2 differ]" ; \
cp m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.1.lst ; \
cp m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.2.lst ; \
echo " " ; \
fi ; \
echo " " ; \
done
$(QUIAT)echo "now verifying automatically built modules"
$(QUIAT)for i in x $(GM2-VERIFY-AUTO) ; do \
if [ -f m2/gm2-auto/$$i ] ; then \
echo -n "$$i " ; \
./gm2 -S $(GM2_FLAGS) -c -B./stage1/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty m2/gm2-auto/$$i -o m2/gm2-compiler-verify/1.s ; \
echo -n "[1]" ; \
./gm2 -S $(GM2_FLAGS) -c -B./stage2/m2 -I$(srcdir)/m2/gm2-compiler:$(srcdir)/m2/gm2-libs:$(srcdir)/m2/gm2-gcc:$(srcdir)/m2/gm2-libiberty m2/gm2-auto/$$i -o m2/gm2-compiler-verify/2.s ; \
echo -n "[2]" ; \
if ! diff m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/2.s > m2/gm2-compiler-verify/1_2.diff 2>&1 ; then \
echo -n " [stage 1 and stage 2 differ]" ; \
cp m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.1.lst ; \
cp m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/t.s | as -ahl m2/gm2-compiler-verify/t.s > m2/gm2-compiler-verify/$$i.2.lst ; \
echo " " ; \
fi ; \
echo " " ; \
fi ; \
done ; \
$(RM) -f m2/gm2-compiler-verify/1.s m2/gm2-compiler-verify/2.s m2/gm2-compiler-verify/3.s m2/gm2-compiler-verify/2_3.diff m2/gm2-compiler-verify/1_2.diff
# The rules which build objects in the gm2-compiler-paranoid gm2-libs-paranoid directories.
m2/gm2-libs-paranoid/%.o: m2/gm2-libs-ch/%.c
$(XGCC) -c -g $(GM2_O_S3) $(GM2_O) -I./ -Im2/gm2-libs -Wall $(INCLUDES) $< -o $@
m2/gm2-libs-paranoid/%.o: $(srcdir)/m2/gm2-libs/%.mod
$(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-libs-iso -I$(srcdir)/m2/gm2-libiberty $< -o $@
m2/gm2-compiler-paranoid/%.o: $(srcdir)/m2/gm2-compiler/%.mod
$(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
m2/gm2-compiler-paranoid/%.o: m2/gm2-compiler-paranoid/%.mod
$(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
m2/gm2-compiler-paranoid/P0SyntaxCheck.o: m2/gm2-compiler-paranoid/P0SyntaxCheck.mod
$(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
m2/gm2-compiler-paranoid/P1Build.o: m2/gm2-compiler-paranoid/P1Build.mod
$(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
m2/gm2-compiler-paranoid/P2Build.o: m2/gm2-compiler-paranoid/P2Build.mod
$(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
m2/gm2-compiler-paranoid/P3Build.o: m2/gm2-compiler-paranoid/P3Build.mod
$(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
m2/gm2-compiler-paranoid/PHBuild.o: m2/gm2-compiler-paranoid/PHBuild.mod
$(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
m2/gm2-compiler-paranoid/PCBuild.o: m2/gm2-compiler-paranoid/PCBuild.mod
$(GM2_2) $(GM2_O_S3) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc -I$(srcdir)/m2/gm2-libiberty $< -o $@
m2/gm2-libs-paranoid/host.o: $(srcdir)/m2/gm2-libs-ch/host.c m2/gm2-libs/gm2-libs-host.h
$(CXX) -c $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
m2/gm2-libs-paranoid/wrapc.o: $(srcdir)/m2/gm2-libs-ch/wrapc.c m2/gm2-libs-boot/$(SRC_PREFIX)wrapc.h m2/gm2-libs/gm2-libs-host.h
$(CXX) -c -DIN_GCC $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
m2/gm2-libs-paranoid/UnixArgs.o: $(srcdir)/m2/gm2-libs-ch/UnixArgs.cc \
m2/gm2-libs-boot/$(SRC_PREFIX)UnixArgs.h
$(CXX) -c -DIN_GCC $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
m2/gm2-libs-paranoid/errno.o: $(srcdir)/m2/gm2-libs-ch/errno.c \
m2/gm2-libs-boot/$(SRC_PREFIX)errno.h
$(CXX) -c -DIN_GCC $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
m2/gm2-libs-paranoid/Selective.o: $(srcdir)/m2/gm2-libs-ch/Selective.c \
m2/gm2-libs-boot/$(SRC_PREFIX)Selective.h
$(COMPILER) -c -DIN_GCC $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
m2/gm2-libs-paranoid/choosetemp.o: $(srcdir)/m2/gm2-libs-ch/choosetemp.c \
m2/gm2-libiberty/$(SRC_PREFIX)choosetemp.h
$(CXX) -c -DIN_GCC $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot -Im2/gm2-libiberty $(INCLUDES) $< -o $@
m2/gm2-libs-paranoid/SysExceptions.o: $(srcdir)/m2/gm2-libs-ch/SysExceptions.c \
m2/gm2-libs-boot/$(SRC_PREFIX)SysExceptions.h
$(CXX) -c -DIN_GCC $(GM2_O_S3) $(CFLAGS) -Im2/gm2-libs -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot $(INCLUDES) $< -o $@
m2/gm2-compiler-paranoid/m2flex.o: m2/gm2-compiler/m2flex.c $(TIMEVAR_H)
$(COMPILER) -c $(GM2_O_S3) -g $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(GM2GCC) -Im2/gm2-compiler-boot -Im2/gm2-libs-boot $< -o $@
m2/gm2-libs-paranoid/dtoa.o: $(srcdir)/m2/gm2-libs-ch/dtoa.cc \
m2/gm2-libs-boot/$(SRC_PREFIX)dtoa.h \
m2/gm2-libs/gm2-libs-host.h
$(CXX) -c $(GM2_O_S3) $(CFLAGS) -I$(srcdir)/m2 -Im2/gm2-libs-boot -Im2/gm2-libs $(INCLUDES) $< -o $@
m2/gm2-libs-paranoid/ldtoa.o: $(srcdir)/m2/gm2-libs-ch/ldtoa.cc \
m2/gm2-libs-boot/$(SRC_PREFIX)ldtoa.h \
m2/gm2-libs/gm2-libs-host.h
$(CXX) -c $(GM2_O_S3) $(CFLAGS) -I$(srcdir)/m2 -Im2/gm2-libs-boot -Im2/gm2-libs $(INCLUDES) $< -o $@
m2/gm2-libs-paranoid/termios.o: $(srcdir)/m2/gm2-libs-ch/termios.c \
m2/gm2-libs-boot/$(SRC_PREFIX)termios.h \
m2/gm2-libs/gm2-libs-host.h
$(CXX) -c $(GM2_O_S3) $(CFLAGS) -I$(srcdir)/m2 -Im2/gm2-libs-boot -Im2/gm2-libs $(INCLUDES) $< -o $@
# The rules which build the paranoid version of gm2.
BUILD-LIBS-PARANOID-H = $(GM2-LIBS-BOOT-DEFS:%.def=m2/gm2-libs-boot/$(SRC_PREFIX)%.h)
BUILD-LIBS-PARANOID = $(BUILD-LIBS-PARANOID-H) \
$(GM2-LIBS-MODS:%.mod=m2/gm2-libs-paranoid/%.o) \
$(GM2-LIBS-CC:%.cc=m2/gm2-libs-paranoid/%.o) \
$(GM2-LIBS-C:%.c=m2/gm2-libs-paranoid/%.o)
m2/gm2-libs-paranoid/libgm2.a: m2/boot-bin/mc$(exeext) $(BUILD-LIBS-PARANOID)
$(AR) cr $@ $(GM2-LIBS-MODS:%.mod=m2/gm2-libs-paranoid/%.o) \
$(GM2-LIBS-CC:%.cc=m2/gm2-libs-paranoid/%.o) \
$(GM2-LIBS-C:%.c=m2/gm2-libs-paranoid/%.o)
$(RANLIB) $@
m2/gm2-compiler-paranoid/gm2.a: \
$(GM2-COMP-MODS:%.mod=m2/gm2-compiler-paranoid/%.o) \
$(GM2-AUTO-MODS:%.mod=m2/gm2-compiler-paranoid/%.o) \
m2/gm2-compiler-paranoid/M2Version.o \
m2/gm2-compiler-paranoid/m2flex.o
$(AR) cr $@ $(GM2-COMP-MODS:%.mod=m2/gm2-compiler-paranoid/%.o) \
$(GM2-AUTO-MODS:%.mod=m2/gm2-compiler-paranoid/%.o) \
m2/gm2-compiler-paranoid/M2Version.o
$(RANLIB) $@
m2/gm2-compiler-paranoid/M2Version.mod:
$(SHELL) $(srcdir)/m2/tools-src/makeversion -m $(srcdir) m2/gm2-compiler-paranoid
m2/gm2-compiler-paranoid/M2Version.o: m2/gm2-compiler-paranoid/M2Version.mod
$(GM2_2) $(GM2_FLAGS) -c -I$(srcdir)/m2/gm2-compiler -I$(srcdir)/m2/gm2-libs -I$(srcdir)/m2/gm2-gcc $< -o $@
m2/gm2-compiler-paranoid/%.mod: $(srcdir)/m2/gm2-compiler/%.bnf $(PGE)
$(PGE) -k -l $< -o $@
# Recreate the target independent copies of the documentation which is
# used during the build if Python3 is unavailable.
# m2-target-independent-doc-rst should be enabled once
# tools-src/def2doc.py is completed (module hyperlinks need rst
# treatment).
m2-target-independent-doc: m2-target-independent-doc-texi # m2-target-independent-doc-rst
m2-target-independent-doc-texi: force
ifeq ($(HAVE_PYTHON),yes)
python3 $(srcdir)/m2/tools-src/def2doc.py -t -b$(srcdir)/m2 -f$(srcdir)/m2/gm2-libs-iso/SYSTEM.def -o $(srcdir)/m2/target-independent/SYSTEM-iso.texi
python3 $(srcdir)/m2/tools-src/def2doc.py -t -b$(srcdir)/m2 -f$(srcdir)/m2/gm2-libs/SYSTEM.def -o $(srcdir)/m2/target-independent/SYSTEM-pim.texi
python3 $(srcdir)/m2/tools-src/def2doc.py -t -b$(srcdir)/m2 -f$(srcdir)/m2/gm2-libs/Builtins.def -o $(srcdir)/m2/target-independent/Builtins.texi
python3 $(srcdir)/m2/tools-src/def2doc.py -t -uLibraries -s$(srcdir)/m2 -b$(srcdir)/m2 -o $(srcdir)/m2/target-independent/gm2-libs.texi
else
echo "m2-target-independent-doc-texi will only work if Python3 was detected during configure"
endif
m2-target-independent-doc-rst: force
ifeq ($(HAVE_PYTHON),yes)
python3 $(srcdir)/m2/tools-src/def2doc.py -x -b$(srcdir)/m2 -f$(srcdir)/m2/gm2-libs-iso/SYSTEM.def -o $(srcdir)/m2/target-independent/SYSTEM-iso.rst
python3 $(srcdir)/m2/tools-src/def2doc.py -x -b$(srcdir)/m2 -f$(srcdir)/m2/gm2-libs/SYSTEM.def -o $(srcdir)/m2/target-independent/SYSTEM-pim.rst
python3 $(srcdir)/m2/tools-src/def2doc.py -x -b$(srcdir)/m2 -f$(srcdir)/m2/gm2-libs/Builtins.def -o $(srcdir)/m2/target-independent/Builtins.rst
python3 $(srcdir)/m2/tools-src/def2doc.py -x -uLibraries -s$(srcdir)/m2 -b$(srcdir)/m2 -o $(srcdir)/m2/target-independent/gm2-libs.rst
else
echo "m2-target-independent-doc-rst will only work if Python3 was detected during configure"
endif

231
gcc/m2/NEWS Normal file
View File

@@ -0,0 +1,231 @@
This file describes recent user-visible changes in gm2. Bug fixes are
not described. There are more details in the man and info pages.
gm2 is now in the GCC tree and therefore these version numbers are
historical.
VERSION 1.9.5
=============
* More subexpressions tokens are created and accuracy of error positions
within subexpressions has been improved.
* the GCC switch -fanalyzer can be used with Modula-2.
VERSION 1.9.4
=============
* More GCC error routines utilized for error messages, erroneous
subexpressions are more accurately reported.
* Complete type checking now performed.
VERSION 1.9.3
=============
* GCC error routines utilized for error messages.
* complete whole number runtime range error detection finished.
* improved m2-plugin which analyzes the call graph and will issue
warnings if the compiler detects a exported procedure will cause
a range error. The plugin will issue an error if the range error
will be called from the module constructor/deconstructor.
VERSION 1.2.0
=============
* New improved more accurate source/line correlation in debugging output.
* -fm2-g generates nops to further improve debugging single stepping.
* -fm2-whole-program whole program optimization available.
* works with gcc-5.2.0 under x86_64, x86_32, arm 64 bit and arm 32 bit.
VERSION 1.0.4
=============
* Bug fixes to release 1.0
VERSION 1.0
===========
* All ISO libraries are complete.
* All ISO language implemented.
* All regression tests pass on both x86_64 and x86_32 Debian GNU/Linux
platforms.
VERSION 0.68
============
* more ISO library modules are implemented.
* many errors are much more informative and indicate what the
compiler has seen and what it expects.
VERSION 0.63
============
* many ISO library modules are implemented.
* Exception handling is complete and it can coexist with swig.
* all errors now include column information. Also added -fxcode
option which issues errors in Apple Xcode format.
* shared libraries are now implemented, to link against the shared
libraries use the new option -fshared. Likewise to generate a
shared library use the -fshared option.
* the keyword FINALLY is now implemented and both the initialization
and finalization blocks map onto GNU/Linux shared library
constructor and deconstructors.
* the PIM libraries are built with -O0, -O2, -O2 -fshared, -fshared.
* a new option -fswig automatically generates a swig interface file
corresponding to the definition module being compiled.
This allows Python and other scripting languages to call Modula-2
modules.
* new options, -fobject-path, allows users to specify the path for
all objects whereas -I specifies the path for the library sources.
* -fmakeinit option introduced which will generate a file
_m2_modulename.c in the current directory.
* introduced fixed sized types in the SYSTEM module.
VERSION 0.62
============
* all language options changed to -f. Warning options are
still -W. Introduced memmove to Builtins.def.
* Introduced gm2/gm2-libs-pim/BlockOps.{def,mod}
* gm2/gm2-libs-pim/BitByteOps.{def,mod}: added.
* -O now works on compiler and passes make gm2.paranoid.
VERSION 0.61
============
* builds when grafted onto gcc-4.1.2
VERSION 0.52
============
* tagged ready for branch for gcc-3.3.6 so that the head
can be developed with gcc-4.1.0
VERSION 0.51
============
* all regression tests pass on LP64 and i386 GNU/Linux
* declaration of variables at particular addresses is now implemented.
Now gm2 is a full PIM Modula-2 compiler and hence the formal release.
VERSION 0.50
============
* all regression tests pass on LP64 and i386 GNU/Linux, i386, Mac OS X.3 G5
* gm2-harness 0.7 will download, patch and build gcc, gdb, gm2 with the
SET and TYPE enhancements below. gm2-harness-0.7 also honours the
--prefix= option.
* Much better dwarf-2 debugging support and when used with
a patched gdb-6.3 the programmer can display RECORDs,
ARRAYs, SETs, subranges and constant char literals in
Modula-2 syntax.
* it currently complies with Programming in Modula-2 Edition 2, 3 and 4.
Users can switch on specific mutually exclusive features by using
-Wpim or -Wpim2.
* gm2 supports full PIM Modula-2 (except variables located at
particular addresses).
* profiling (-p) option is now available.
* module priorities now implemented.
* Logitech compatible libraries: Break.def, CardinalIO.def,
Conversions.def, DebugPMD.def, DebugTrace.def, Delay.def, Display.def,
ErrorCode.def, FloatingUtilities.def, InOut.def, Keyboard.def,
LongIO.def, Random.def, RealConversions.def, RealInOut.def,
Strings.def, Termbase.def, Terminal.def, TimeDate.def have been implemented.
* all Ulm libraries are available.
VERSION 0.49
============
* supports sets of any ordinal size (memory permitting).
* implements ISO Modula-2 SYSTEM which can be switched on via: -Wiso.
* easy interface to C, and varargs can be passed to C routines.
* University of Ulm libraries are installed together with the compiler
and can be accessed via: -Wlibs=ulm
* some Logitech libraries have been implemented and can be accessed via:
-Wlibs=logitech
* coroutines have been implemented in the PIM style and these are accessible
from SYSTEM. A number of supporting libraries (executive and file descriptor
mapping to interrupt vector libraries are available through the
-Wlibs=pim-coroutines switch).
VERSION 0.42
============
* MinGW cross compilation port released.
Please see http://floppsie.comp.glam.ac.uk/Glamorgan/gaius/web/gm2-mingw.html
for building details.
VERSION 0.41
============
* native sparc port passes make gm2.paranoid and make check-gm2
* native i386 port passes make gm2.paranoid and make check-gm2
* passes all 1350 regression tests
* builds with gcc-3.3.2
VERSION 0.40
============
* brought GM2 up to date with gcc-3.3.1
* many, many bug fixes and no patch is now required in the garbage collection
of gcc-3.3.1
* builds under Redhat 9.0 and Suse 9.0
* added the LONGCARD data type.
* LENGTH is now mapped onto M2RTS.Length if the parameter is not a constant
at compile time.
* standard procedures can be called inside constant expressions.
* introduced examples/pthread
* introduced a tool, h2def, to aid production of DEFINITION MODULE FOR "C" modules
from C header files.
* added MathLib0 module, added svga example.
* added access to thirty one gcc built-in functions.
VERSION 0.33
============
* implemented large sets.
* implemented ISO compliant sets.
* when gm2 is invoked with -gstabs a patched gdb will
display set contents. This also works well with SET OF CHAR.
* definition modules no longer have to explicitly export
identifiers.
VERSION 0.32
============
* gm2 can be built as a native or as a strongarm cross compiler.
* the C preprocessor can be invoked and it processes both definition and
implementation modules.
* error reporting understands preprocessed Modula-2 source.

35
gcc/m2/README Normal file
View File

@@ -0,0 +1,35 @@
Building GNU Modula-2
=====================
Please see the GCC documentation (gcc.texi) and section
(Installing GCC).
Regression testing GM2
======================
cd host-build ; make check-m2
runs all regression tests.
Stress testing GM2
==================
cd host-build/gcc ; make gm2.paranoid
builds gm2 using itself and then compiles each module with both
versions of gm2 comparing the emitted assembler code.
Contributing to GNU Modula-2
============================
Please do. But also please read the GNU Emacs info under
* Standards: (standards). GNU coding standards.
* Intellectual Property:: Keeping Free Software Free
* Reading Non-Free Code:: Referring to Proprietary Programs
* Contributions:: Accepting Contributions
you might consider joining the GM2 Mailing list: see URL:
http://lists.nongnu.org/mailman/listinfo/gm2 before you start coding.
Many thanks and enjoy your programming!

12
gcc/m2/aclocal.m4 vendored Normal file
View File

@@ -0,0 +1,12 @@
#
# set up the '--enable-ulmlib' command line option
#
# this does not work with the gcc frontent (yet)
# AC_DEFUN([GM2_ULMLIB_OPTION],
# [AC_ARG_ENABLE([ulmlib],
# AS_HELP_STRING([--enable-ulmlib],
# [build and install the University of Ulm libraries]),
# [ulmlib="$withval"],
# [ulmlib="yes"])])
# AC_SUBST([ulmlib])

83
gcc/m2/config-lang.in Normal file
View File

@@ -0,0 +1,83 @@
# Top level configure fragment for GNU Modula-2.
# Copyright (C) 2000-2022 Free Software Foundation, Inc.
# This file is part of GCC.
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# GCC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# 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/>.
# Configure looks for the existence of this file to auto-config each language.
# We define several parameters used by configure:
#
# language - name of language as it would appear in $(LANGUAGES)
# compilers - value to add to $(COMPILERS)
# stagestuff - files to add to $(STAGESTUFF)
language="m2"
compilers="cc1gm2\$(exeext)"
stagestuff="gm2\$(exeext) cc1gm2\$(exeext) cc1gm2-cross\$(exeext)"
target_libs="target-libstdc++-v3 target-libgm2"
# The Modula-2 frontend needs C++ compiler during stage 1.
lang_requires_boot_languages=c++
# Do not build by default.
build_by_default="no"
gtfiles="\$(srcdir)/m2/gm2-lang.cc \
\$(srcdir)/m2/gm2-lang.h \
\$(srcdir)/m2/gm2-gcc/rtegraph.cc \
\$(srcdir)/m2/gm2-gcc/m2block.cc \
\$(srcdir)/m2/gm2-gcc/m2builtins.cc \
\$(srcdir)/m2/gm2-gcc/m2decl.cc \
\$(srcdir)/m2/gm2-gcc/m2except.cc \
\$(srcdir)/m2/gm2-gcc/m2expr.cc \
\$(srcdir)/m2/gm2-gcc/m2statement.cc \
\$(srcdir)/m2/gm2-gcc/m2type.cc"
outputs="m2/config-make \
m2/Make-maintainer \
"
mkdir -p m2/gm2-compiler-boot
mkdir -p m2/gm2-libs-boot
mkdir -p m2/gm2-ici-boot
mkdir -p m2/gm2-libiberty
mkdir -p m2/gm2-gcc
mkdir -p m2/gm2-compiler
mkdir -p m2/gm2-libs
mkdir -p m2/gm2-libs-iso
mkdir -p m2/gm2-compiler-paranoid
mkdir -p m2/gm2-libs-paranoid
mkdir -p m2/gm2-compiler-verify
mkdir -p m2/boot-bin
mkdir -p m2/gm2-libs-pim
mkdir -p m2/gm2-libs-coroutines
mkdir -p m2/gm2-libs-min
mkdir -p m2/pge-boot
mkdir -p plugin
mkdir -p stage1/m2 stage2/m2 stage3/m2 stage4/m2
# directories used by Make-maintainer
mkdir -p m2/gm2-auto
mkdir -p m2/gm2-pg-boot
mkdir -p m2/gm2-pge-boot
mkdir -p m2/gm2-ppg-boot
mkdir -p m2/mc-boot
mkdir -p m2/mc-boot-ch
mkdir -p m2/mc-boot-gen

6
gcc/m2/config-make.in Normal file
View File

@@ -0,0 +1,6 @@
# Target libraries are put under this directory:
TARGET_SUBDIR = @target_subdir@
# Python3 executable name if it exists
PYTHON = @PYTHON@
# Does Python3 exist? (yes/no).
HAVE_PYTHON = @HAVE_PYTHON@

4718
gcc/m2/configure vendored Executable file

File diff suppressed because it is too large Load Diff

38
gcc/m2/configure.ac Normal file
View File

@@ -0,0 +1,38 @@
# configure.ac provides gm2spec.c with access to config values.
# Copyright (C) 2001-2022 Free Software Foundation, Inc.
# Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# GCC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# 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/>.
AC_INIT(m2, [ ])
# Determine the host, build, and target systems
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_CHECK_PROGS(regex_realpath, realpath)
if test x$regex_realpath = "x" ; then
AC_MSG_ERROR([realpath is required to build GNU Modula-2 (hint install coreutils).])
fi
AC_CHECK_FUNCS([stpcpy])
AC_CHECK_HEADERS(sys/types.h)
AC_HEADER_DIRENT
AC_CHECK_LIB([c],[opendir],[AC_DEFINE([HAVE_OPENDIR],[1],[found opendir])])
AC_CONFIG_HEADERS(gm2config.h, [echo timestamp > stamp-h])
AC_OUTPUT

View File

@@ -0,0 +1,264 @@
(* CLexBuf.def provides a lexical buffer for clex.
Copyright (C) 2003-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE CLexBuf ;
(*
Title : CLexBuf
Author : Gaius Mulley
System : GNU Modula-2
Date : Thu Jan 23 12:32:36 2003
Revision : $Version$
Description: provides a lexical buffer for clex.
*)
FROM SYSTEM IMPORT ADDRESS ;
FROM DynamicStrings IMPORT String ;
FROM NameKey IMPORT Name ;
EXPORT QUALIFIED toktype,
IsMacroDefined, NoArgs, DefineMacro, UnDefineMacro,
OpenSource, CloseSource, ReInitialize, GetToken, InsertToken,
InsertTokenAndRewind, GetLineNo,
GetTokenNo, TokenToLineNo, FindFileNameFromToken, GetFileName,
ResetForNewPass,
currenttoken, currentstring, currentinteger,
EnableMacroSubstitutions,
AddTok, AddTokCharStar, AddTokInteger,
SetFile, PushFile, PopFile, FlushTokens ;
TYPE
toktype = (eoftok, startok, arrowtok, structtok, lsbratok, rsbratok,
lcbratok, rcbratok, lparatok, rparatok, semicolontok,
longtok, inttok, chartok, enumtok, typedeftok,
floattok, doubletok, unsignedtok, consttok,
periodperiodperiodtok,
integertok, hexintegertok, octintegertok,
identtok, realtok, conststringtok, constchartok, codetok,
starthashtok, endhashtok, definetok, undeftok, iftok, elsetok,
endiftok, ifdeftok, ifndeftok, includetok,
nottok, commatok,
periodtok,
gretok, lesstok, ortok, andtok, bartok, ambersandtok,
shiftlefttok, shiftrighttok, divtok, modtok,
sizeoftok, definedtok, hattok, equaltok, notequaltok,
greequaltok, lessequaltok, plustok, minustok, tildetok,
externtok, statictok, autotok, registertok,
voidtok, shorttok, signedtok, uniontok, colontok, becomestok,
volatiletok, typetok) ;
VAR
currenttoken : toktype ;
currentstring : ADDRESS ;
currentinteger: INTEGER ;
(*
EnableMacroSubstitutions -
*)
PROCEDURE EnableMacroSubstitutions (b: BOOLEAN) ;
(*
IsMacroDefined - returns TRUE if macro, n, was defined.
*)
PROCEDURE IsMacroDefined (n: Name) : BOOLEAN ;
(*
NoArgs - returns the number of arguments for macro, n.
-1 if the macro does not exist
*)
PROCEDURE NoArgs (n: Name) : INTEGER ;
(*
DefineMacro - defines macro, n, as defined to start at token, t.
*)
PROCEDURE DefineMacro (n: Name; t: CARDINAL) ;
(*
UnDefineMacro -
*)
PROCEDURE UnDefineMacro (n: Name) ;
(*
OpenSource - Attempts to open the source file, s.
The success of the operation is returned.
*)
PROCEDURE OpenSource (s: String) : BOOLEAN ;
(*
CloseSource - closes the current open file.
*)
PROCEDURE CloseSource ;
(*
ReInitialize - re-initialize the all the data structures.
*)
PROCEDURE ReInitialize ;
(*
ResetForNewPass - reset the buffer pointers to the beginning ready for
a new pass
*)
PROCEDURE ResetForNewPass ;
(*
GetToken - gets the next token into currenttoken.
*)
PROCEDURE GetToken ;
(*
InsertToken - inserts a symbol, token, infront of the current token
ready for the next pass.
*)
PROCEDURE InsertToken (token: toktype) ;
(*
InsertTokenAndRewind - inserts a symbol, token, infront of the current token
and then moves the token stream back onto the inserted token.
*)
PROCEDURE InsertTokenAndRewind (token: toktype) ;
(*
GetLineNo - returns the current line number where the symbol occurs in
the source file.
*)
PROCEDURE GetLineNo () : CARDINAL ;
(*
GetTokenNo - returns the number of tokens read from
the source file by the lexical analaysis.
*)
PROCEDURE GetTokenNo () : CARDINAL ;
(*
TokenToLineNo - returns the line number of the current file for the
TokenNo. The depth refers to the include depth.
A depth of 0 is the current file, depth of 1 is the file
which included the current file. Zero is returned if the
depth exceeds the file nesting level.
*)
PROCEDURE TokenToLineNo (TokenNo: CARDINAL; depth: CARDINAL) : CARDINAL ;
(*
FindFileNameFromToken - returns the complete FileName for the appropriate
source file yields the token number, TokenNo.
The, Depth, indicates the include level: 0..n
Level 0 is the current. NIL is returned if n+1
is requested.
*)
PROCEDURE FindFileNameFromToken (TokenNo: CARDINAL; depth: CARDINAL) : String ;
(*
GetFileName - assigns, a, to the current file name.
*)
PROCEDURE GetFileName () : String ;
(* ***********************************************************************
*
* These functions allow c.lex to deliver tokens into the buffer
*
************************************************************************* *)
(*
AddTok - adds a token to the buffer.
*)
PROCEDURE AddTok (t: toktype) ;
(*
AddTokCharStar - adds a token to the buffer and an additional string, s.
A copy of string, s, is made.
*)
PROCEDURE AddTokCharStar (t: toktype; s: ADDRESS) ;
(*
AddTokInteger - adds a token and an integer to the buffer.
*)
PROCEDURE AddTokInteger (t: toktype; i: INTEGER) ;
(*
SetFile - sets the current filename to, filename.
*)
PROCEDURE SetFile (filename: ADDRESS) ;
(*
PushFile - indicates that, filename, has just been included.
*)
PROCEDURE PushFile (filename: ADDRESS) ;
(*
PopFile - indicates that we are returning to, filename, having finished
an include.
*)
PROCEDURE PopFile (filename: ADDRESS) ;
(*
FlushTokens - removes the last token.
*)
PROCEDURE FlushTokens ;
END CLexBuf.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,103 @@
(* FifoQueue.def provides a simple fifo queue.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE FifoQueue ;
(*
Author : Gaius Mulley
Title : FifoQueue
Date : Tue Dec 12 16:23:22 GMT 1989
Description: FifoQueue provides a mechanism to and from which CARDINAL
numbers can be stored and retrieved from a FIFO queue.
Last update: Tue Dec 12 16:24:24 GMT 1989
*)
EXPORT QUALIFIED PutEnumerationIntoFifoQueue, GetEnumerationFromFifoQueue,
PutSubrangeIntoFifoQueue, GetSubrangeFromFifoQueue,
PutConstIntoFifoQueue, GetConstFromFifoQueue,
PutConstructorIntoFifoQueue, GetConstructorFromFifoQueue ;
(*
PutEnumerationIntoFifoQueue - places an enumeration symbol, c,
into a fifo queue.
*)
PROCEDURE PutEnumerationIntoFifoQueue (c: CARDINAL) ;
(*
GetEnumerationFromFifoQueue - retrieves an enumeration symbol,
c, from a fifo queue.
*)
PROCEDURE GetEnumerationFromFifoQueue (VAR c: CARDINAL) ;
(*
PutSubrangeIntoFifoQueue - places a subrange symbol into a fifo
queue.
*)
PROCEDURE PutSubrangeIntoFifoQueue (c: CARDINAL) ;
(*
GetSubrangeFromFifoQueue - retrieves a subrange symbol from a
fifo queue.
*)
PROCEDURE GetSubrangeFromFifoQueue (VAR c: CARDINAL) ;
(*
PutConstIntoFifoQueue - places a constant symbol
into a fifo queue.
*)
PROCEDURE PutConstIntoFifoQueue (c: CARDINAL) ;
(*
GetConstFromFifoQueue - retrieves a const symbol
from a fifo queue.
*)
PROCEDURE GetConstFromFifoQueue (VAR c: CARDINAL) ;
(*
PutConstructorIntoFifoQueue - places a constructor symbol
into a fifo queue.
*)
PROCEDURE PutConstructorIntoFifoQueue (c: CARDINAL) ;
(*
GetConstructorFromFifoQueue - retrieves a constructor symbol
from a fifo queue.
*)
PROCEDURE GetConstructorFromFifoQueue (VAR c: CARDINAL) ;
END FifoQueue.

View File

@@ -0,0 +1,170 @@
(* FifoQueue.mod provides a simple fifo queue.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE FifoQueue ;
FROM Lists IMPORT List, InitList, PutItemIntoList, GetItemFromList ;
TYPE
Fifo = RECORD
Queue: List ;
Out : CARDINAL ;
END ;
VAR
const,
subrange,
enumeration,
constructor: Fifo ;
(*
PutInto - places a CARDINAL number, c, into a fifo queue.
*)
PROCEDURE PutInto (VAR f: Fifo; c: CARDINAL) ;
BEGIN
WITH f DO
PutItemIntoList(Queue, c)
END
END PutInto ;
(*
GetFrom - retrieves a CARDINAL number, c, from a fifo queue.
*)
PROCEDURE GetFrom (VAR f: Fifo; VAR c: CARDINAL) ;
BEGIN
WITH f DO
INC(Out) ;
c := GetItemFromList(Queue, Out)
END
END GetFrom ;
(*
PutEnumerationIntoFifoQueue - places an enumeration symbol, c,
into a fifo queue.
*)
PROCEDURE PutEnumerationIntoFifoQueue (c: CARDINAL) ;
BEGIN
PutInto(enumeration, c)
END PutEnumerationIntoFifoQueue ;
(*
GetEnumerationFromFifoQueue - retrieves an enumeration symbol,
c, from a fifo queue.
*)
PROCEDURE GetEnumerationFromFifoQueue (VAR c: CARDINAL) ;
BEGIN
GetFrom(enumeration, c)
END GetEnumerationFromFifoQueue ;
(*
PutSubrangeIntoFifoQueue - places a subrange symbol into a fifo
queue.
*)
PROCEDURE PutSubrangeIntoFifoQueue (c: CARDINAL) ;
BEGIN
PutInto(subrange, c)
END PutSubrangeIntoFifoQueue ;
(*
GetSubrangeFromFifoQueue - retrieves a subrange symbol from a
fifo queue.
*)
PROCEDURE GetSubrangeFromFifoQueue (VAR c: CARDINAL) ;
BEGIN
GetFrom(subrange, c)
END GetSubrangeFromFifoQueue ;
(*
PutConstructorIntoFifoQueue - places a constructor symbol
into a fifo queue.
*)
PROCEDURE PutConstructorIntoFifoQueue (c: CARDINAL) ;
BEGIN
PutInto(constructor, c)
END PutConstructorIntoFifoQueue ;
(*
GetConstructorFromFifoQueue - retrieves a constructor symbol
from a fifo queue.
*)
PROCEDURE GetConstructorFromFifoQueue (VAR c: CARDINAL) ;
BEGIN
GetFrom(constructor, c)
END GetConstructorFromFifoQueue ;
(*
PutConstIntoFifoQueue - places a constant symbol
into a fifo queue.
*)
PROCEDURE PutConstIntoFifoQueue (c: CARDINAL) ;
BEGIN
PutInto(const, c)
END PutConstIntoFifoQueue ;
(*
GetConstFromFifoQueue - retrieves a const symbol
from a fifo queue.
*)
PROCEDURE GetConstFromFifoQueue (VAR c: CARDINAL) ;
BEGIN
GetFrom(const, c)
END GetConstFromFifoQueue ;
(*
Init - initialize the fifo queue.
*)
PROCEDURE Init (VAR f: Fifo) ;
BEGIN
WITH f DO
InitList(Queue) ;
Out := 0
END
END Init ;
BEGIN
Init(const) ;
Init(enumeration) ;
Init(subrange) ;
Init(constructor)
END FifoQueue.

View File

@@ -0,0 +1,128 @@
(* Lists.def provides an unordered list manipulation package.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE Lists ;
(*
Author : Gaius Mulley
Title : Lists
Date : Tue Dec 12 20:53:36 EST 1989
SYSTEM : UNIX (GNU Modula-2)
Description: Provides an unordered list manipulation package.
Last update: $Date: 2010/10/03 19:01:05 $
Version : $Revision: 1.9 $
*)
FROM SYSTEM IMPORT WORD ;
FROM SymbolKey IMPORT PerformOperation ;
EXPORT QUALIFIED List,
InitList, KillList, PutItemIntoList, GetItemFromList,
GetIndexOfList,
NoOfItemsInList, IsItemInList, IncludeItemIntoList,
RemoveItemFromList, ForeachItemInListDo, DuplicateList ;
TYPE
List ;
(*
InitList - creates a new list, l.
*)
PROCEDURE InitList (VAR l: List) ;
(*
KillList - deletes the complete list, l.
*)
PROCEDURE KillList (VAR l: List) ;
(*
PutItemIntoList - places a CARDINAL, c, into list, l.
*)
PROCEDURE PutItemIntoList (l: List; c: WORD) ;
(*
GetItemFromList - retrieves the nth WORD from list, l.
*)
PROCEDURE GetItemFromList (l: List; n: CARDINAL) : WORD ;
(*
GetIndexOfList - returns the index for WORD, c, in list, l.
If more than one CARDINAL, c, exists the index
for the first is returned.
*)
PROCEDURE GetIndexOfList (l: List; c: WORD) : CARDINAL ;
(*
NoOfItemsInList - returns the number of items in list, l.
*)
PROCEDURE NoOfItemsInList (l: List) : CARDINAL ;
(*
IncludeItemIntoList - adds a WORD, c, into a list providing
the value does not already exist.
*)
PROCEDURE IncludeItemIntoList (l: List; c: WORD) ;
(*
RemoveItemFromList - removes a WORD, c, from a list.
It assumes that this value only appears once.
*)
PROCEDURE RemoveItemFromList (l: List; c: WORD) ;
(*
IsItemInList - returns true if a WORD, c, was found in list, l.
*)
PROCEDURE IsItemInList (l: List; c: WORD) : BOOLEAN ;
(*
ForeachItemInListDo - calls procedure, P, foreach item in list, l.
*)
PROCEDURE ForeachItemInListDo (l: List; P: PerformOperation) ;
(*
DuplicateList - returns a duplicate list derived from, l.
*)
PROCEDURE DuplicateList (l: List) : List ;
END Lists.

View File

@@ -0,0 +1,341 @@
(* Lists.mod provides an unordered list manipulation package.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE Lists ;
FROM Storage IMPORT ALLOCATE, DEALLOCATE ;
CONST
MaxNoOfElements = 5 ;
TYPE
List = POINTER TO list ;
list = RECORD
NoOfElements: CARDINAL ;
Elements : ARRAY [1..MaxNoOfElements] OF WORD ;
Next : List ;
END ;
(*
InitList - creates a new list, l.
*)
PROCEDURE InitList (VAR l: List) ;
BEGIN
NEW (l) ;
WITH l^ DO
NoOfElements := 0 ;
Next := NIL
END
END InitList ;
(*
KillList - deletes the complete list, l.
*)
PROCEDURE KillList (VAR l: List) ;
BEGIN
IF l#NIL
THEN
IF l^.Next#NIL
THEN
KillList(l^.Next)
END ;
DISPOSE(l)
END
END KillList ;
(*
PutItemIntoList - places a WORD, c, into list, l.
*)
PROCEDURE PutItemIntoList (l: List; c: WORD) ;
BEGIN
WITH l^ DO
IF NoOfElements<MaxNoOfElements
THEN
INC(NoOfElements) ;
Elements[NoOfElements] := c
ELSIF Next#NIL
THEN
PutItemIntoList(Next, c)
ELSE
InitList(Next) ;
PutItemIntoList(Next, c)
END
END
END PutItemIntoList ;
(*
GetItemFromList - retrieves the nth WORD from list, l.
(recursive solution).
*)
(*
PROCEDURE GetItemFromList (l: List; n: CARDINAL) : WORD ;
BEGIN
IF n>NoOfItemsInList(l)
THEN
RETURN( 0 )
ELSE
WITH l^ DO
IF n<=NoOfElements
THEN
RETURN( Elements[n] )
ELSE
RETURN( GetItemFromList( Next, n-NoOfElements ) )
END
END
END
END GetItemFromList ;
*)
(* iterative solution *)
PROCEDURE GetItemFromList (l: List; n: CARDINAL) : WORD ;
BEGIN
WHILE l#NIL DO
WITH l^ DO
IF n<=NoOfElements
THEN
RETURN( Elements[n] )
ELSE
DEC(n, NoOfElements)
END
END ;
l := l^.Next
END ;
RETURN( 0 )
END GetItemFromList ;
(*
GetIndexOfList - returns the index for WORD, c, in list, l.
If more than one WORD, c, exists the index
for the first is returned.
*)
PROCEDURE GetIndexOfList (l: List; c: WORD) : CARDINAL ;
VAR
i: CARDINAL ;
BEGIN
IF l=NIL
THEN
RETURN( 0 )
ELSE
WITH l^ DO
i := 1 ;
WHILE i<=NoOfElements DO
IF Elements[i]=c
THEN
RETURN( i )
ELSE
INC(i)
END
END ;
RETURN( NoOfElements+GetIndexOfList(Next, c) )
END
END
END GetIndexOfList ;
(*
NoOfItemsInList - returns the number of items in list, l.
*)
(*
PROCEDURE NoOfItemsInList (l: List) : CARDINAL ;
BEGIN
IF l=NIL
THEN
RETURN( 0 )
ELSE
WITH l^ DO
RETURN( NoOfElements+NoOfItemsInList(Next) )
END
END
END NoOfItemsInList ;
*)
(*
NoOfItemsInList - returns the number of items in list, l.
(iterative algorithm of the above).
*)
PROCEDURE NoOfItemsInList (l: List) : CARDINAL ;
VAR
t: CARDINAL ;
BEGIN
IF l=NIL
THEN
RETURN( 0 )
ELSE
t := 0 ;
REPEAT
WITH l^ DO
INC(t, NoOfElements)
END ;
l := l^.Next
UNTIL l=NIL;
RETURN( t )
END
END NoOfItemsInList ;
(*
IncludeItemIntoList - adds a WORD, c, into a list providing
the value does not already exist.
*)
PROCEDURE IncludeItemIntoList (l: List; c: WORD) ;
BEGIN
IF NOT IsItemInList(l, c)
THEN
PutItemIntoList(l, c)
END
END IncludeItemIntoList ;
(*
RemoveItem - remove an element at index, i, from the list data type.
*)
PROCEDURE RemoveItem (p, l: List; i: CARDINAL) ;
BEGIN
WITH l^ DO
DEC(NoOfElements) ;
WHILE i<=NoOfElements DO
Elements[i] := Elements[i+1] ;
INC(i)
END ;
IF (NoOfElements=0) AND (p#NIL)
THEN
p^.Next := l^.Next ;
DISPOSE(l)
END
END
END RemoveItem ;
(*
RemoveItemFromList - removes a WORD, c, from a list.
It assumes that this value only appears once.
*)
PROCEDURE RemoveItemFromList (l: List; c: WORD) ;
VAR
p : List ;
i : CARDINAL ;
Found: BOOLEAN ;
BEGIN
IF l#NIL
THEN
Found := FALSE ;
p := NIL ;
REPEAT
WITH l^ DO
i := 1 ;
WHILE (i<=NoOfElements) AND (Elements[i]#c) DO
INC(i)
END ;
END ;
IF (i<=l^.NoOfElements) AND (l^.Elements[i]=c)
THEN
Found := TRUE
ELSE
p := l ;
l := l^.Next
END
UNTIL (l=NIL) OR Found ;
IF Found
THEN
RemoveItem(p, l, i)
END
END
END RemoveItemFromList ;
(*
IsItemInList - returns true if a WORD, c, was found in list, l.
*)
PROCEDURE IsItemInList (l: List; c: WORD) : BOOLEAN ;
VAR
i: CARDINAL ;
BEGIN
REPEAT
WITH l^ DO
i := 1 ;
WHILE (i<=NoOfElements) DO
IF Elements[i]=c
THEN
RETURN( TRUE )
ELSE
INC(i)
END
END
END ;
l := l^.Next
UNTIL l=NIL ;
RETURN( FALSE )
END IsItemInList ;
(*
ForeachItemInListDo - calls procedure, P, foreach item in list, l.
*)
PROCEDURE ForeachItemInListDo (l: List; P: PerformOperation) ;
VAR
i, n: CARDINAL ;
BEGIN
n := NoOfItemsInList(l) ;
i := 1 ;
WHILE i<=n DO
P(GetItemFromList(l, i)) ;
INC(i)
END
END ForeachItemInListDo ;
(*
DuplicateList - returns a duplicate list derived from, l.
*)
PROCEDURE DuplicateList (l: List) : List ;
VAR
m : List ;
n, i: CARDINAL ;
BEGIN
InitList(m) ;
n := NoOfItemsInList(l) ;
i := 1 ;
WHILE i<=n DO
PutItemIntoList(m, GetItemFromList(l, i)) ;
INC(i)
END ;
RETURN( m )
END DuplicateList ;
END Lists.

View File

@@ -0,0 +1,989 @@
(* M2ALU.def gcc implementation of the M2ALU module.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2ALU ;
(*
Title : M2ALU.def
Author : Gaius Mulley
System : UNIX (gm2)
Date : Tue Jul 11 09:14:28 2000
Description: Handles all values in the Modula-2 compiler and all
manipulations of values. All values are mapped onto
gcc trees.
*)
FROM NameKey IMPORT Name ;
FROM m2tree IMPORT Tree ;
FROM M2GCCDeclare IMPORT WalkAction, IsAction ;
EXPORT QUALIFIED PtrToValue,
InitValue,
IsValueTypeNone,
IsValueTypeInteger,
IsValueTypeReal,
IsValueTypeComplex,
IsValueTypeSet,
IsValueTypeConstructor,
IsValueTypeArray,
IsValueTypeRecord,
PopInto, PushFrom,
PushIntegerTree, PopIntegerTree,
PushSetTree, PopSetTree,
PushRealTree, PopRealTree,
PushComplexTree, PopComplexTree,
PopConstructorTree,
PushCard,
PushInt,
PushChar,
PushString,
PushTypeOfTree,
CoerseLongRealToCard,
ConvertRealToInt,
ConvertToInt,
ConvertToType,
GetSetValueType,
IsSolved, IsValueConst,
PutConstructorSolved, EvaluateValue, TryEvaluateValue,
IsNulSet, IsGenericNulSet, PushNulSet, AddBitRange, AddBit, SubBit,
SetOr, SetAnd, SetIn,
SetDifference, SetSymmetricDifference,
SetNegate, SetShift, SetRotate,
Addn, Multn, Sub,
DivFloor, ModFloor, DivTrunc, ModTrunc,
Equ, NotEqu, Less, Gre, LessEqu, GreEqu,
GetValue, GetRange, ConstructSetConstant, BuildRange,
IsConstructorDependants, WalkConstructorDependants,
AddField, AddElements,
PushEmptyConstructor, PushEmptyArray, PushEmptyRecord,
ChangeToConstructor,
IsValueAndTreeKnown, CheckOrResetOverflow ;
TYPE
PtrToValue ;
(*
InitValue - initializes and returns a value container.
*)
PROCEDURE InitValue () : PtrToValue ;
(*
IsValueTypeNone - returns TRUE if the value on the top stack has no value.
*)
PROCEDURE IsValueTypeNone () : BOOLEAN ;
(*
IsValueTypeInteger - returns TRUE if the value on the top stack is an integer.
*)
PROCEDURE IsValueTypeInteger () : BOOLEAN ;
(*
IsValueTypeReal - returns TRUE if the value on the top stack is a real.
*)
PROCEDURE IsValueTypeReal () : BOOLEAN ;
(*
IsValueTypeComplex - returns TRUE if the value on the top stack is a complex.
*)
PROCEDURE IsValueTypeComplex () : BOOLEAN ;
(*
IsValueTypeSet - returns TRUE if the value on the top stack is a set.
*)
PROCEDURE IsValueTypeSet () : BOOLEAN ;
(*
IsValueTypeConstructor - returns TRUE if the value on the top
stack is a constructor.
*)
PROCEDURE IsValueTypeConstructor () : BOOLEAN ;
(*
IsValueTypeArray - returns TRUE if the value on the top
stack is an array.
*)
PROCEDURE IsValueTypeArray () : BOOLEAN ;
(*
IsValueTypeRecord - returns TRUE if the value on the top
stack is a record.
*)
PROCEDURE IsValueTypeRecord () : BOOLEAN ;
(*
GetSetValueType - returns the set type on top of the ALU stack.
*)
PROCEDURE GetSetValueType () : CARDINAL ;
(*
PushIntegerTree - pushes a gcc tree value onto the ALU stack.
*)
PROCEDURE PushIntegerTree (t: Tree) ;
(*
PopIntegerTree - pops a gcc tree value from the ALU stack.
*)
PROCEDURE PopIntegerTree () : Tree ;
(*
PushRealTree - pushes a gcc tree value onto the ALU stack.
*)
PROCEDURE PushRealTree (t: Tree) ;
(*
PopRealTree - pops a gcc tree value from the ALU stack.
*)
PROCEDURE PopRealTree () : Tree ;
(*
PushComplexTree - pushes a gcc tree value onto the ALU stack.
*)
PROCEDURE PushComplexTree (t: Tree) ;
(*
PopComplexTree - pops a gcc tree value from the ALU stack.
*)
PROCEDURE PopComplexTree () : Tree ;
(*
PushSetTree - pushes a gcc tree onto the ALU stack.
The tree, t, is expected to contain a
word value. It is converted into a set
type (sym). Bit 0 maps onto MIN(sym).
*)
PROCEDURE PushSetTree (tokenno: CARDINAL;
t: Tree; sym: CARDINAL) ;
(*
PopSetTree - pops a gcc tree from the ALU stack.
*)
PROCEDURE PopSetTree (tokenno: CARDINAL) : Tree ;
(*
PopConstructorTree - returns a tree containing the compound literal.
*)
PROCEDURE PopConstructorTree (tokenno: CARDINAL) : Tree ;
(*
PushFrom - pushes a copy of the contents of, v, onto stack.
*)
PROCEDURE PushFrom (v: PtrToValue) ;
(*
PopInto - pops the top element from the stack and places it into, v.
*)
PROCEDURE PopInto (v: PtrToValue) ;
(*
PushCard - pushes a cardinal onto the stack.
*)
PROCEDURE PushCard (c: CARDINAL) ;
(*
PushInt - pushes an integer onto the stack.
*)
PROCEDURE PushInt (i: INTEGER) ;
(*
PushChar - pushes a char onto the stack.
*)
PROCEDURE PushChar (c: CHAR) ;
(*
PushString - pushes the numerical value of the string onto the stack.
*)
PROCEDURE PushString (tokenno: CARDINAL; s: Name) ;
(*
CoerseLongRealToCard - performs a coersion between a REAL to a CARDINAL
*)
PROCEDURE CoerseLongRealToCard ;
(*
ConvertRealToInt - converts a REAL into an INTEGER
*)
PROCEDURE ConvertRealToInt ;
(*
ConvertToInt - converts the value into an INTEGER. This should be used
if we are computing the number of elements in a char set to
avoid an overflow.
*)
PROCEDURE ConvertToInt ;
(*
ConvertToType - converts the top of stack to type, t.
*)
PROCEDURE ConvertToType (t: CARDINAL) ;
(*
IsSolved - returns true if the memory cell indicated by v
has a known value.
*)
PROCEDURE IsSolved (v: PtrToValue) : BOOLEAN ;
(*
PutConstructorSolved - records that this constructor is solved.
*)
PROCEDURE PutConstructorSolved (sym: CARDINAL) ;
(*
EvaluateValue - attempts to evaluate the symbol, sym, value.
*)
PROCEDURE EvaluateValue (sym: CARDINAL) ;
(*
TryEvaluateValue - attempts to evaluate the symbol, sym, value.
*)
PROCEDURE TryEvaluateValue (sym: CARDINAL) ;
(*
Add - adds the top two elements on the stack.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +------------+
| Op2 | | Op2 + Op1 |
|------------| |------------|
*)
PROCEDURE Addn ;
(*
Sub - subtracts the top two elements on the stack.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +------------+
| Op2 | | Op2 - Op1 |
|------------| |------------|
*)
PROCEDURE Sub ;
(*
Mult - multiplies the top two elements on the stack.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +------------+
| Op2 | | Op2 * Op1 |
|------------| |------------|
*)
PROCEDURE Multn ;
(*
DivFloor - divides the top two elements on the stack.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +--------------+
| Op2 | | Op2 DIV Op1 |
|------------| |--------------|
*)
PROCEDURE DivFloor ;
(*
ModFloor - modulus of the top two elements on the stack.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +--------------+
| Op2 | | Op2 MOD Op1 |
|------------| |--------------|
*)
PROCEDURE ModFloor ;
(*
DivTrunc - divides the top two elements on the stack.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +--------------+
| Op2 | | Op2 DIV Op1 |
|------------| |--------------|
*)
PROCEDURE DivTrunc ;
(*
ModTrunc - modulus of the top two elements on the stack.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +--------------+
| Op2 | | Op2 MOD Op1 |
|------------| |--------------|
*)
PROCEDURE ModTrunc ;
(*
Equ - returns true if the top two elements on the stack
are identical.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 |
|------------|
| Op2 |
|------------| Empty
RETURN( Op2 = Op1 )
*)
PROCEDURE Equ (tokenno: CARDINAL) : BOOLEAN ;
(*
NotEqu - returns true if the top two elements on the stack
are not identical.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 |
|------------|
| Op2 |
|------------| Empty
RETURN( Op2 # Op1 )
*)
PROCEDURE NotEqu (tokenno: CARDINAL) : BOOLEAN ;
(*
Less - returns true if Op2 < Op1.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 |
|------------|
| Op2 |
|------------| Empty
RETURN( Op2 < Op1 )
*)
PROCEDURE Less (tokenno: CARDINAL) : BOOLEAN ;
(*
Gre - returns true if Op2 > Op1
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 |
|------------|
| Op2 |
|------------| Empty
RETURN( Op2 > Op1 )
*)
PROCEDURE Gre (tokenno: CARDINAL) : BOOLEAN ;
(*
LessEqu - returns true if Op2 <= Op1
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 |
|------------|
| Op2 |
|------------| Empty
RETURN( Op2 <= Op1 )
*)
PROCEDURE LessEqu (tokenno: CARDINAL) : BOOLEAN ;
(*
GreEqu - returns true if Op2 >= Op1
are not identical.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 |
|------------|
| Op2 |
|------------| Empty
RETURN( Op2 >= Op1 )
*)
PROCEDURE GreEqu (tokenno: CARDINAL) : BOOLEAN ;
(*
IsNulSet - returns TRUE if the top element is the nul set constant, {}.
*)
PROCEDURE IsNulSet () : BOOLEAN ;
(*
IsGenericNulSet - returns TRUE if the top element is the generic nul set constant, {}.
*)
PROCEDURE IsGenericNulSet () : BOOLEAN ;
(*
PushNulSet - pushes an empty set {} onto the ALU stack. The subrange type used
to construct the set is defined by, type. If this is NulSym then
the set is generic and compatible with all sets.
The Stack:
Entry Exit
<- Ptr
+------------+
| {} |
Ptr -> |------------|
*)
PROCEDURE PushNulSet (settype: CARDINAL) ;
(*
AddBitRange - adds the range op1..op2 to the underlying set.
Ptr ->
<- Ptr
+------------+ +------------+
| Set | | Set |
|------------| |------------|
*)
PROCEDURE AddBitRange (tokenno: CARDINAL; op1, op2: CARDINAL) ;
(*
AddBit - adds the bit op1 to the underlying set. INCL(Set, op1)
Ptr ->
<- Ptr
+------------+ +------------+
| Set | | Set |
|------------| |------------|
*)
PROCEDURE AddBit (tokenno: CARDINAL; op1: CARDINAL) ;
(*
SubBit - removes a bit op1 from the underlying set. EXCL(Set, Op1)
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +------------+
| Set | | Set |
|------------| |------------|
*)
PROCEDURE SubBit (tokenno: CARDINAL; op1: CARDINAL) ;
(*
SetIn - returns true if the Op1 IN Set
The Stack:
Entry Exit
Ptr ->
+------------+
| Set |
|------------|
| Op1 |
|------------| Empty
RETURN( Op1 IN Set )
*)
PROCEDURE SetIn (tokenno: CARDINAL; Op1: CARDINAL) : BOOLEAN ;
(*
SetOr - performs an inclusive OR of the top two sets on the stack.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +------------+
| Op2 | | Op2 + Op1 |
|------------| |------------|
*)
PROCEDURE SetOr (tokenno: CARDINAL) ;
(*
SetAnd - performs a set AND the top two sets on the stack.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +------------+
| Op2 | | Op2 * Op1 |
|------------| |------------|
*)
PROCEDURE SetAnd (tokenno: CARDINAL) ;
(*
SetDifference - performs a set difference of the top two elements on the stack.
For each member in the set
if member in Op2 and not member in Op1
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +-------------------+
| Op2 | | Op2 and (not Op1) |
|------------| |-------------------|
*)
PROCEDURE SetDifference (tokenno: CARDINAL) ;
(*
SetSymmetricDifference - performs a set difference of the top two sets on the stack.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +------------+
| Op2 | | Op2 - Op1 |
|------------| |------------|
*)
PROCEDURE SetSymmetricDifference (tokenno: CARDINAL) ;
(*
SetNegate - negates the top set on the stack.
Ptr -> <- Ptr
+-----------+ +------------+
| Set | | Set |
|-----------| |------------|
*)
PROCEDURE SetNegate (tokenno: CARDINAL) ;
(*
SetShift - if op1 is positive
then
result := op2 << op1
else
result := op2 >> op1
fi
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +------------+
| Op2 | | result |
|------------| |------------|
*)
PROCEDURE SetShift (tokenno: CARDINAL) ;
(*
SetRotate - if op1 is positive
then
result := ROTATERIGHT(op2, op1)
else
result := ROTATELEFT(op2, op1)
fi
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +------------+
| Op2 | | result |
|------------| |------------|
*)
PROCEDURE SetRotate (tokenno: CARDINAL) ;
(*
GetValue - returns and pops the value from the top of stack.
*)
PROCEDURE GetValue (tokenno: CARDINAL) : PtrToValue ;
(*
GetRange - returns TRUE if range number, n, exists in the value, v.
A non empty set is defined by having 1..N ranges
*)
PROCEDURE GetRange (v: PtrToValue; n: CARDINAL; VAR low, high: CARDINAL) : BOOLEAN ;
(*
ConstructSetConstant - builds a struct of integers which represents the
set const, sym.
*)
PROCEDURE ConstructSetConstant (tokenno: CARDINAL; v: PtrToValue) : Tree ;
(*
BuildRange - returns a integer sized constant which represents the
value {e1..e2}.
*)
PROCEDURE BuildRange (tokenno: CARDINAL; e1, e2: Tree) : Tree ;
(*
IsConstructorDependants - return TRUE if returned if all
q(dependants) of, sym, return TRUE.
*)
PROCEDURE IsConstructorDependants (sym: CARDINAL; q: IsAction) : BOOLEAN ;
(*
WalkConstructorDependants - walk the constructor, sym, calling
p for each dependant.
*)
PROCEDURE WalkConstructorDependants (sym: CARDINAL; p: WalkAction) ;
(*
IsValueAndTreeKnown - returns TRUE if the value is known and the gcc tree
is defined.
The Stack:
Entry Exit
Ptr ->
+------------+
| Op1 | <- Ptr
|------------| +------------+
*)
PROCEDURE IsValueAndTreeKnown () : BOOLEAN ;
(*
CheckOrResetOverflow - tests to see whether the tree, t, has caused
an overflow error and if so it generates an
error message.
*)
PROCEDURE CheckOrResetOverflow (tokenno: CARDINAL; t: Tree; check: BOOLEAN) ;
(*
AddElements - adds the elements, el BY, n, to the array constant.
Ptr ->
<- Ptr
+------------+ +------------+
| Array | | Array |
|------------| |------------|
*)
PROCEDURE AddElements (tokenno: CARDINAL; el, n: CARDINAL) ;
(*
AddField - adds the field op1 to the underlying constructor.
Ptr ->
<- Ptr
+------------+ +------------+
| const | | const |
|------------| |------------|
*)
PROCEDURE AddField (tokenno: CARDINAL; op1: CARDINAL) ;
(*
PushEmptyConstructor - pushes an empty constructor {} onto the ALU stack.
This is expected to be filled in by subsequent
calls to AddElements, AddRange or AddField.
The Stack:
Entry Exit
<- Ptr
+------------+
| {} |
Ptr -> |------------|
*)
PROCEDURE PushEmptyConstructor (constype: CARDINAL) ;
(*
PushEmptyArray - pushes an empty array {} onto the ALU stack.
This is expected to be filled in by subsequent
calls to AddElements.
The Stack:
Entry Exit
<- Ptr
+------------+
| {} |
Ptr -> |------------|
*)
PROCEDURE PushEmptyArray (arraytype: CARDINAL) ;
(*
PushEmptyRecord - pushes an empty record {} onto the ALU stack.
This is expected to be filled in by subsequent
calls to AddField.
The Stack:
Entry Exit
<- Ptr
+------------+
| {} |
Ptr -> |------------|
*)
PROCEDURE PushEmptyRecord (recordtype: CARDINAL) ;
(*
ChangeToConstructor - change the top of stack value to a constructor, type.
*)
PROCEDURE ChangeToConstructor (tokenno: CARDINAL; constype: CARDINAL) ;
(*
IsValueConst - returns true if the memory cell indicated by v
is only defined by constants. For example
no variables are used in the constructor.
*)
PROCEDURE IsValueConst (v: PtrToValue) : BOOLEAN ;
(*
PushTypeOfTree - pushes tree, gcc, to the stack and records the
front end type.
*)
PROCEDURE PushTypeOfTree (sym: CARDINAL; gcc: Tree) ;
END M2ALU.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,55 @@
(* M2AsmUtil.def provides asm symbol name conversion.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2AsmUtil ;
(*
Author : Gaius Mulley
Title : M2AsmUtil
Date : Thu Feb 1 15:34:08 GMT 1990
Description: Provides utilities relating symbols in the SymbolTable
to their equivalent representation in ASM format.
*)
FROM DynamicStrings IMPORT String ;
FROM NameKey IMPORT Name ;
EXPORT QUALIFIED GetFullSymName, GetFullScopeAsmName ;
(*
GetFullSymName - returns the NameKey for the symbol name (which also
may contain the module name). This is the same as
GetAsmName except that it does not have the leading _
*)
PROCEDURE GetFullSymName (sym: CARDINAL) : Name ;
(*
GetFullScopeAsmName - returns the fully qualified name for the symbol.
This will take the format
[DefImpModule|Module]_{InnerModule}_{Procedure}_SymbolName
*)
PROCEDURE GetFullScopeAsmName (sym: CARDINAL) : Name ;
END M2AsmUtil.

View File

@@ -0,0 +1,189 @@
(* M2AsmUtil.mod provides utilities relating symbols in the SymbolTable.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2AsmUtil ;
FROM SFIO IMPORT WriteS ;
FROM FIO IMPORT StdOut ;
FROM DynamicStrings IMPORT String, string, ConCat, KillString, InitString, Mark, InitStringCharStar, ConCatChar ;
FROM StdIO IMPORT Write ;
FROM StrIO IMPORT WriteString ;
FROM NameKey IMPORT WriteKey, GetKey, MakeKey, makekey, KeyToCharStar ;
FROM M2Options IMPORT WholeProgram ;
FROM SymbolTable IMPORT NulSym,
GetSymName,
GetScope,
GetBaseModule,
IsInnerModule,
IsVar,
IsProcedure,
IsModule,
IsDefImp,
IsExportQualified,
IsExported, IsPublic, IsExtern, IsMonoName,
IsDefinitionForC ;
FROM M2Error IMPORT InternalError ;
FROM m2configure IMPORT UseUnderscoreForC ;
(*
StringToKey - returns a Name, from a string and destroys the string.
*)
PROCEDURE StringToKey (s: String) : Name ;
VAR
k: Name ;
BEGIN
k := makekey (string (s)) ;
s := KillString (s) ;
RETURN k
END StringToKey ;
(*
GetFullScopeAsmName - returns the fully qualified name for the symbol.
This will take the format
[DefImpModule|Module]_{InnerModule}_{Procedure}_SymbolName
*)
PROCEDURE GetFullScopeAsmName (sym: CARDINAL) : Name ;
VAR
leader: String ;
scope : CARDINAL ;
BEGIN
scope := GetScope (sym) ;
IF UseUnderscoreForC
THEN
leader := InitString ('_')
ELSE
leader := InitString ('')
END ;
IF IsProcedure (sym) AND IsMonoName (sym)
THEN
RETURN StringToKey (ConCat (leader, InitStringCharStar (KeyToCharStar (GetSymName (sym)))))
ELSE
RETURN StringToKey (ConCat (GetFullScopePrefix (leader, scope, sym),
InitStringCharStar (KeyToCharStar (GetSymName (sym)))))
END
END GetFullScopeAsmName ;
(*
GetFullSymName - returns the NameKey for the symbol name (which also
may contain the module name).
*)
PROCEDURE GetFullSymName (sym: CARDINAL) : Name ;
VAR
module: String ;
scope : CARDINAL ;
BEGIN
IF IsProcedure (sym) AND IsMonoName (sym)
THEN
RETURN GetSymName (sym)
ELSE
scope := GetScope (sym) ;
module := GetModulePrefix (InitString (''), sym, scope) ;
RETURN StringToKey (ConCat (module, InitStringCharStar (KeyToCharStar (GetSymName (sym)))))
END
END GetFullSymName ;
(*
SymNeedsModulePrefix -
*)
PROCEDURE SymNeedsModulePrefix (sym, mod: CARDINAL) : BOOLEAN ;
BEGIN
IF IsDefImp(mod)
THEN
IF WholeProgram
THEN
IF NOT IsDefinitionForC(mod)
THEN
RETURN( TRUE )
END
ELSIF IsExportQualified(sym)
THEN
RETURN( TRUE )
END
ELSIF IsModule(mod)
THEN
RETURN( WholeProgram )
END ;
RETURN( FALSE )
END SymNeedsModulePrefix ;
(*
GetModulePrefix - returns a String containing the module prefix
for module, ModSym, providing symbol, Sym, is exported.
Name is marked if it is appended onto the new string.
*)
PROCEDURE GetModulePrefix (Name: String; Sym, ModSym: CARDINAL) : String ;
BEGIN
IF (ModSym#NulSym) AND (ModSym#GetBaseModule())
THEN
IF IsInnerModule(Sym) OR IsInnerModule(ModSym)
THEN
RETURN( ConCat(ConCatChar(InitStringCharStar(KeyToCharStar(GetSymName(ModSym))), '_'),
GetModulePrefix(Name, ModSym, GetScope(ModSym))) )
ELSIF SymNeedsModulePrefix(Sym, ModSym)
THEN
RETURN( ConCatChar(ConCat(InitStringCharStar(KeyToCharStar(GetSymName(ModSym))), Mark(Name)), '_') )
END
END ;
RETURN( Name )
END GetModulePrefix ;
(*
GetFullScopePrefix - returns a String containing the full scope prefix
for symbol, Sym. It honours IsExportQualified.
Name is marked if it is appended onto the new string.
*)
PROCEDURE GetFullScopePrefix (Name: String; Scope, Sym: CARDINAL) : String ;
BEGIN
IF Sym#NulSym
THEN
IF IsInnerModule(Scope)
THEN
RETURN( ConCat(ConCatChar(InitStringCharStar(KeyToCharStar(GetSymName(Scope))), '_'),
GetFullScopePrefix(Name, GetScope(Scope), Sym)) )
ELSIF IsDefImp(Scope) AND IsExportQualified(Sym)
THEN
RETURN( ConCatChar(ConCat(InitStringCharStar(KeyToCharStar(GetSymName(Scope))), Mark(Name)), '_') )
ELSIF IsProcedure(Scope)
THEN
RETURN( ConCatChar(ConCat(InitStringCharStar(KeyToCharStar(GetSymName(Scope))), Mark(Name)), '_') )
END
END ;
RETURN( Name )
END GetFullScopePrefix ;
END M2AsmUtil.

View File

@@ -0,0 +1,415 @@
(* M2Base.def provides a mechanism to check fundamental types.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2Base ;
(*
Author : Gaius Mulley
Title : M2Base
Date : 22/5/87
Description: Implements the default Base Types and Base
procedures in the Modula-2 compiler.
*)
FROM NameKey IMPORT Name ;
FROM m2linemap IMPORT location_t ;
EXPORT QUALIFIED Nil, (* Base constants *)
Cardinal, (* Base types *)
Integer,
Boolean,
True, False,
Char,
Proc,
LongInt, LongCard,
ShortInt, ShortCard,
ZType, RType, CType,
Real,
LongReal, ShortReal,
Complex,
LongComplex,
ShortComplex,
High, IsOrd, (* Base functions *)
LengthS,
Convert,
Re, Im, Cmplx,
Cap, Abs, Odd,
Chr, Val,
IsTrunc, IsFloat,
IsInt,
Min, Max,
New, Dispose, (* Base procedures *)
Inc, Dec,
Incl, Excl,
IsPseudoBaseFunction, (* Manipulation procedures *)
IsPseudoBaseProcedure, (* Manipulation procedures *)
IsBaseType,
GetBaseTypeMinMax,
InitBase,
CannotCheckTypeInPass3,
CheckExpressionCompatible,
CheckAssignmentCompatible,
CheckParameterCompatible,
IsAssignmentCompatible,
IsExpressionCompatible,
IsParameterCompatible,
IsComparisonCompatible,
IsValidParameter,
AssignmentRequiresWarning,
IsMathType,
IsRealType,
IsOrdinalType,
IsComplexType,
GetCmplxReturnType,
ComplexToScalar,
ScalarToComplex,
MixTypes, NegateType,
TemplateProcedure,
ActivationPointer,
IsNeededAtRunTime,
ExceptionAssign,
ExceptionReturn,
ExceptionInc,
ExceptionDec,
ExceptionIncl,
ExceptionExcl,
ExceptionShift,
ExceptionRotate,
ExceptionStaticArray,
ExceptionDynamicArray,
ExceptionForLoopBegin,
ExceptionForLoopTo,
ExceptionForLoopEnd,
ExceptionPointerNil,
ExceptionNoReturn,
ExceptionCase,
ExceptionNonPosDiv,
ExceptionNonPosMod,
ExceptionZeroDiv,
ExceptionZeroRem,
ExceptionWholeValue,
ExceptionRealValue,
ExceptionParameterBounds,
ExceptionNo ;
VAR
TemplateProcedure,
ActivationPointer,
Nil,
Cardinal, Integer,
Boolean, True, False,
Char, Proc,
LongInt, LongCard,
ShortInt, ShortCard,
ZType, RType, CType,
Real,
LongReal, ShortReal,
Complex, LongComplex,
ShortComplex,
Unbounded,
High, LengthS,
Cap, Abs, Odd,
Convert, Val,
Chr,
Re, Im, Cmplx,
Min, Max,
New, Dispose,
Inc, Dec,
Incl, Excl,
ExceptionAssign,
ExceptionReturn,
ExceptionInc,
ExceptionDec,
ExceptionIncl,
ExceptionExcl,
ExceptionShift,
ExceptionRotate,
ExceptionStaticArray,
ExceptionDynamicArray,
ExceptionForLoopBegin,
ExceptionForLoopTo,
ExceptionForLoopEnd,
ExceptionPointerNil,
ExceptionNoReturn,
ExceptionCase,
ExceptionNonPosDiv,
ExceptionNonPosMod,
ExceptionZeroDiv,
ExceptionZeroRem,
ExceptionWholeValue,
ExceptionRealValue,
ExceptionParameterBounds,
ExceptionNo : CARDINAL ;
(*
InitBase - initializes the base types and functions
used in the Modula-2 compiler.
*)
PROCEDURE InitBase (location: location_t; VAR sym: CARDINAL) ;
(*
GetBaseTypeMinMax - returns the minimum and maximum values for a
given base type. This procedure should only
be called if the type is NOT a subrange.
*)
PROCEDURE GetBaseTypeMinMax (type: CARDINAL; VAR min, max: CARDINAL) ;
(*
IsPseudoBaseFunction - returns true if Sym is a Base function.
*)
PROCEDURE IsPseudoBaseFunction (Sym: CARDINAL) : BOOLEAN ;
(*
IsPseudoBaseProcedure - returns true if Sym is a Base procedure.
*)
PROCEDURE IsPseudoBaseProcedure (Sym: CARDINAL) : BOOLEAN ;
(*
IsNeededAtRunTime - returns TRUE if procedure, sym, is a
runtime procedure. Ie a procedure which is
not a pseudo procedure and which is implemented
in M2RTS or SYSTEM and also exported.
*)
PROCEDURE IsNeededAtRunTime (tok: CARDINAL; sym: CARDINAL) : BOOLEAN ;
(*
IsBaseType - returns TRUE if Sym is a Base type.
*)
PROCEDURE IsBaseType (Sym: CARDINAL) : BOOLEAN ;
(*
IsOrdinalType - returns TRUE if, sym, is an ordinal type.
An ordinal type is defined as:
a base type which contains whole numbers or
a subrange type or an enumeration type.
*)
PROCEDURE IsOrdinalType (Sym: CARDINAL) : BOOLEAN ;
(*
IsOrd - returns TRUE if, sym, is ORD or its typed counterparts
ORDL, ORDS.
*)
PROCEDURE IsOrd (sym: CARDINAL) : BOOLEAN ;
(*
IsTrunc - returns TRUE if, sym, is TRUNC or its typed counterparts
TRUNCL, TRUNCS.
*)
PROCEDURE IsTrunc (sym: CARDINAL) : BOOLEAN ;
(*
IsFloat - returns TRUE if, sym, is FLOAT or its typed counterparts
FLOATL, FLOATS.
*)
PROCEDURE IsFloat (sym: CARDINAL) : BOOLEAN ;
(*
IsInt - returns TRUE if, sym, is INT or its typed counterparts
INTL, INTS.
*)
PROCEDURE IsInt (sym: CARDINAL) : BOOLEAN ;
(*
AssignmentRequiresWarning - returns TRUE if t1 and t2 can be used during
an assignment, but should generate a warning.
For example in PIM we can assign ADDRESS
and WORD providing they are both the
same size.
*)
PROCEDURE AssignmentRequiresWarning (t1, t2: CARDINAL) : BOOLEAN ;
(*
IsAssignmentCompatible - returns TRUE if t1 and t2 are assignment
compatible.
*)
PROCEDURE IsAssignmentCompatible (t1, t2: CARDINAL) : BOOLEAN ;
(*
IsExpressionCompatible - returns TRUE if t1 and t2 are expression
compatible.
*)
PROCEDURE IsExpressionCompatible (t1, t2: CARDINAL) : BOOLEAN ;
(*
IsParameterCompatible - returns TRUE if types t1 and t2 are parameter
compatible.
*)
PROCEDURE IsParameterCompatible (t1, t2: CARDINAL) : BOOLEAN ;
(*
IsComparisonCompatible - returns TRUE if t1 and t2 are comparison
compatible. PIM allows INTEGER and ADDRESS within
expressions but we warn against their comparison.
*)
PROCEDURE IsComparisonCompatible (t1, t2: CARDINAL) : BOOLEAN ;
(*
IsValidParameter - returns TRUE if an, actual, parameter can be passed
to the, formal, parameter. This differs from
IsParameterCompatible as this procedure includes checks
for unbounded formal parameters, var parameters and
constant actual parameters.
*)
PROCEDURE IsValidParameter (formal, actual: CARDINAL) : BOOLEAN ;
(*
CheckExpressionCompatible - returns if t1 and t2 are compatible types for
+, -, *, DIV, >, <, =, etc.
If t1 and t2 are not compatible then an error
message is displayed.
*)
PROCEDURE CheckExpressionCompatible (tok: CARDINAL;
left, right: CARDINAL) ;
(*
CheckAssignmentCompatible - returns if t1 and t2 are compatible types for
:=, =, #.
If t1 and t2 are not compatible then an error
message is displayed.
*)
PROCEDURE CheckAssignmentCompatible (tok: CARDINAL;
left, right: CARDINAL) ;
(*
CheckParameterCompatible - checks to see if types, t1, and, t2, are
compatible for parameter passing.
*)
PROCEDURE CheckParameterCompatible (tok: CARDINAL;
t1, t2: CARDINAL) ;
(*
CannotCheckTypeInPass3 - returns TRUE if we are unable to check the
type of, e, in pass 3.
*)
PROCEDURE CannotCheckTypeInPass3 (e: CARDINAL) : BOOLEAN ;
(*
MixTypes - returns the type symbol that corresponds to the types t1 and t2.
NearTok is used to identify the source position if a type
incompatability occurs.
*)
PROCEDURE MixTypes (t1, t2: CARDINAL; NearTok: CARDINAL) : CARDINAL ;
(*
NegateType - if the type is unsigned then returns the
signed equivalent.
*)
PROCEDURE NegateType (type: CARDINAL (* ; sympos: CARDINAL *) ) : CARDINAL ;
(*
IsMathType - returns TRUE if the type is a mathematical type.
A mathematical type has a range larger than INTEGER.
(Typically REAL/LONGREAL/LONGINT)
*)
PROCEDURE IsMathType (type: CARDINAL) : BOOLEAN ;
(*
IsRealType - returns TRUE if, t, is a real type.
*)
PROCEDURE IsRealType (t: CARDINAL) : BOOLEAN ;
(*
IsComplexType - returns TRUE if, sym, is COMPLEX,
LONGCOMPLEX or SHORTCOMPLEX.
*)
PROCEDURE IsComplexType (sym: CARDINAL) : BOOLEAN ;
(*
ComplexToScalar - returns the scalar (or base type) of the complex type, sym.
*)
PROCEDURE ComplexToScalar (sym: CARDINAL) : CARDINAL ;
(*
ScalarToComplex - given a real type, t, return the equivalent complex type.
*)
PROCEDURE ScalarToComplex (sym: CARDINAL) : CARDINAL ;
(*
GetCmplxReturnType - this code implements the table given in the
ISO standard Page 293 with an addition for
SHORTCOMPLEX and the fixed sized COMPLEX
types found in the GNU Modula-2 SYSTEM
Module.
*)
PROCEDURE GetCmplxReturnType (t1, t2: CARDINAL) : CARDINAL ;
END M2Base.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,87 @@
(* M2BasicBlock.def converts a scope block into a list of basic blocks.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2BasicBlock ;
(*
Title : M2BasicBlock
Author : Gaius Mulley
Date : 20/8/2003
System : GNU Modula-2
Description: Converts a scope block into a list of basic blocks.
The basic blocks are either converted back into quadruples
or alternatively translated into GCC trees.
*)
FROM M2Scope IMPORT ScopeBlock ;
EXPORT QUALIFIED BasicBlock, BasicBlockProc,
InitBasicBlocks, InitBasicBlocksFromRange,
KillBasicBlocks, FreeBasicBlocks,
ForeachBasicBlockDo ;
TYPE
BasicBlock ;
BasicBlockProc = PROCEDURE (CARDINAL, CARDINAL) ;
(*
InitBasicBlocks - converts a list of quadruples as defined by
scope blocks into a set of basic blocks.
All quadruples within this list which are not
reachable are removed.
*)
PROCEDURE InitBasicBlocks (sb: ScopeBlock) : BasicBlock ;
(*
InitBasicBlocksFromRange - converts a list of quadruples as defined by
start..end.
All quadruples within this list which are not
reachable are removed.
*)
PROCEDURE InitBasicBlocksFromRange (start, end: CARDINAL) : BasicBlock ;
(*
KillBasicBlocks - destroys the list of Basic Blocks and assigns bb to NIL.
*)
PROCEDURE KillBasicBlocks (VAR bb: BasicBlock) ;
(*
FreeBasicBlocks - destroys the list of Basic Blocks.
*)
PROCEDURE FreeBasicBlocks (bb: BasicBlock) ;
(*
ForeachBasicBlockDo - for each basic block call procedure, p.
*)
PROCEDURE ForeachBasicBlockDo (bb: BasicBlock; p: BasicBlockProc) ;
END M2BasicBlock.

View File

@@ -0,0 +1,355 @@
(* M2BasicBlock.mod converts a scope block into a list of basic blocks.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2BasicBlock ;
FROM Storage IMPORT ALLOCATE, DEALLOCATE ;
FROM StrIO IMPORT WriteString, WriteLn ;
FROM NumberIO IMPORT WriteCard ;
FROM M2Debug IMPORT Assert ;
FROM M2Options IMPORT OptimizeBasicBlock ;
FROM M2Quads IMPORT IsReferenced, IsConditional, IsUnConditional, IsCall,
IsReturn, IsNewLocalVar, IsKillLocalVar,
IsCatchBegin, IsCatchEnd,
IsInitStart, IsInitEnd, IsFinallyStart, IsFinallyEnd,
IsInitialisingConst,
IsPseudoQuad, IsDefOrModFile,
GetNextQuad, GetQuad, QuadOperator,
SubQuad ;
FROM M2Scope IMPORT ScopeBlock, ForeachScopeBlockDo ;
FROM M2GenGCC IMPORT ConvertQuadsToTree ;
TYPE
BasicBlock = POINTER TO RECORD
StartQuad : CARDINAL ; (* First Quad in Basic Block *)
EndQuad : CARDINAL ; (* End Quad in Basic Block *)
Right : BasicBlock ;
(* Last Basic Block in list *)
Left : BasicBlock ;
END ;
VAR
FreeList : BasicBlock ; (* Free list of Basic Blocks *)
HeadOfBasicBlock: BasicBlock ;
(*
InitBasicBlocks - converts a list of quadruples as defined by
scope blocks into a set of basic blocks.
All quadruples within this list which are not
reachable are removed.
*)
PROCEDURE InitBasicBlocks (sb: ScopeBlock) : BasicBlock ;
BEGIN
HeadOfBasicBlock := NIL ;
ForeachScopeBlockDo (sb, ConvertQuads2BasicBlock) ;
RETURN HeadOfBasicBlock
END InitBasicBlocks ;
(*
InitBasicBlocksFromRange - converts a list of quadruples as defined by
start..end.
All quadruples within this list which are not
reachable are removed.
*)
PROCEDURE InitBasicBlocksFromRange (start, end: CARDINAL) : BasicBlock ;
BEGIN
HeadOfBasicBlock := NIL ;
ConvertQuads2BasicBlock(start, end) ;
RETURN( HeadOfBasicBlock )
END InitBasicBlocksFromRange ;
(*
KillBasicBlocks - destroys the list of Basic Blocks.
*)
PROCEDURE KillBasicBlocks (VAR bb: BasicBlock) ;
BEGIN
FreeBasicBlocks (bb) ;
bb := NIL
END KillBasicBlocks ;
(*
FreeBasicBlocks - destroys the list of Basic Blocks.
*)
PROCEDURE FreeBasicBlocks (bb: BasicBlock) ;
VAR
b, c: BasicBlock ;
BEGIN
IF bb#NIL
THEN
b := bb ;
REPEAT
c := bb^.Right ;
bb^.Right := FreeList ;
FreeList := bb ;
bb := c
UNTIL bb=b
END
END FreeBasicBlocks ;
(*
New - returns a basic block.
*)
PROCEDURE New () : BasicBlock ;
VAR
b: BasicBlock ;
BEGIN
IF FreeList=NIL
THEN
NEW(b)
ELSE
b := FreeList ;
FreeList := FreeList^.Right
END ;
Assert(b#NIL) ;
RETURN( b )
END New ;
(*
ConvertQuads2BasicBlock - converts a list of quadruples to a list of
Basic Blocks.
A Basic Block is defined as a list of quadruples
which has only has one entry and exit point.
*)
PROCEDURE ConvertQuads2BasicBlock (Start, End: CARDINAL) ;
VAR
LastQuadDefMod,
LastQuadConditional,
LastQuadCall,
LastQuadReturn : BOOLEAN ;
Quad : CARDINAL ;
CurrentBB : BasicBlock ;
LastBB : BasicBlock ;
BEGIN
(*
Algorithm to perform Basic Block:
For every quadruple establish a set of leaders.
A Leader is defined as a quadruple which is
either:
(i) The first quadruple.
(ii) Any quadruple which is the target of a jump or unconditional jump.
(iii) Any statement which follows a conditional jump
For each leader construct a basic block.
A Basic Block starts with a leader quadruple and ends with either:
(i) Another Leader
(ii) An unconditional Jump.
Any quadruples that do not fall into a Basic Block can be thrown away
since they will never be executed.
*)
LastBB := NIL ;
CurrentBB := NIL ;
Quad := Start ;
LastQuadConditional := TRUE ; (* Force Rule (i) *)
LastQuadCall := FALSE ;
LastQuadReturn := FALSE ;
LastQuadDefMod := FALSE ;
(* Scan all quadruples *)
WHILE (Quad<=End) AND (Quad#0) DO
IF LastQuadConditional OR LastQuadCall OR LastQuadReturn OR
LastQuadDefMod OR IsReferenced(Quad)
THEN
(* Rule (ii) *)
CurrentBB := New() ; (* Get a new Basic Block *)
(* At least one quad in this Basic Block *)
StartBB(CurrentBB, Quad) ;
EndBB(CurrentBB, Quad)
ELSIF CurrentBB#NIL
THEN
(* We have a Basic Block - therefore add quad to this Block *)
EndBB(CurrentBB, Quad)
ELSIF IsPseudoQuad(Quad)
THEN
(* Add Quad to the Last BB since Pseudo Quads - compiler directives *)
(* must not be thrown away. *)
EndBB(LastBB, Quad)
ELSIF IsReturn(Quad) OR IsKillLocalVar(Quad) OR
IsCatchEnd(Quad) OR IsCatchBegin(Quad) OR
IsInitStart(Quad) OR IsInitEnd(Quad) OR
IsFinallyStart(Quad) OR IsFinallyEnd(Quad)
THEN
(* we must leave these quads alone *)
EndBB(LastBB, Quad)
ELSIF IsInitialisingConst(Quad)
THEN
(* we must leave these quads alone *)
EndBB(LastBB, Quad)
ELSE
(* remove this Quad since it will never be reached *)
SubQuad(Quad)
END ;
LastQuadConditional := IsConditional(Quad) ;
LastQuadCall := IsCall(Quad) ;
LastQuadReturn := IsReturn(Quad) ;
LastQuadDefMod := IsDefOrModFile(Quad) ;
IF IsUnConditional(Quad)
THEN
LastBB := CurrentBB ;
CurrentBB := NIL
END ;
Quad := GetNextQuad(Quad)
END
END ConvertQuads2BasicBlock ;
(*
ForeachBasicBlockDo - for each basic block call procedure, p.
*)
PROCEDURE ForeachBasicBlockDo (bb: BasicBlock; p: BasicBlockProc) ;
VAR
b: BasicBlock ;
BEGIN
IF bb#NIL
THEN
b := bb ;
REPEAT
WITH b^ DO
p(StartQuad, EndQuad)
END ;
b := b^.Right
UNTIL b=bb
END
END ForeachBasicBlockDo ;
(*
StartBB - Initially fills a Basic Block, b, with a start quad Quad.
The Basic Block is then added to the end of Basic Block list.
*)
PROCEDURE StartBB (b: BasicBlock; Quad: CARDINAL) ;
BEGIN
WITH b^ DO
StartQuad := Quad ;
EndQuad := Quad
END ;
Add(HeadOfBasicBlock, b) (* Add b to the end of the Basic Block list *)
END StartBB ;
(*
EndBB - Fills a Basic Block, b, with an end quad Quad.
*)
PROCEDURE EndBB (b: BasicBlock; Quad: CARDINAL) ;
BEGIN
b^.EndQuad := Quad
END EndBB ;
(*
Add adds a specified element to the end of a queue.
*)
PROCEDURE Add (VAR Head: BasicBlock;
b : BasicBlock) ;
BEGIN
IF Head=NIL
THEN
Head := b ;
b^.Left := b ;
b^.Right := b
ELSE
b^.Right := Head ;
b^.Left := Head^.Left ;
Head^.Left^.Right := b ;
Head^.Left := b
END
END Add ;
(*
Sub deletes an element from the specified queue.
*)
(*
PROCEDURE Sub (VAR Head: BasicBlock;
b: BasicBlock) ;
BEGIN
IF (b^.Right=Head) AND (b=Head)
THEN
Head := NIL
ELSE
IF Head=b
THEN
Head := Head^.Right
END ;
b^.Left^.Right := b^.Right ;
b^.Right^.Left := b^.Left
END
END Sub ;
*)
(*
DisplayBasicBlocks - displays the basic block data structure.
*)
(*
PROCEDURE DisplayBasicBlocks (bb: BasicBlock) ;
VAR
b: BasicBlock ;
BEGIN
b := bb ;
WriteString('quadruples') ; WriteLn ;
IF b#NIL
THEN
REPEAT
DisplayBlock(b) ;
b := b^.Right
UNTIL b=bb
END
END DisplayBasicBlocks ;
PROCEDURE DisplayBlock (b: BasicBlock) ;
BEGIN
WITH b^ DO
WriteString(' start ') ; WriteCard(StartQuad, 6) ;
WriteString(' end ') ; WriteCard(EndQuad, 6) ;
END
END DisplayBlock ;
*)
BEGIN
FreeList := NIL
END M2BasicBlock.

View File

@@ -0,0 +1,194 @@
(* M2Batch.def implements a queue for modules pending compilation.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2Batch ;
(*
Author : Gaius Mulley
Title : M2Batch
Date : 29/5/87
Description: Implements a queue modules pending compilation.
MakeSource enters modules for later compilation.
GetSource collects the next module to be compiled.
*)
FROM DynamicStrings IMPORT String ;
FROM NameKey IMPORT Name ;
EXPORT QUALIFIED MakeDefinitionSource,
MakeImplementationSource,
MakeProgramSource,
GetSource, GetModuleNo, IsModuleKnown,
AssociateDefinition, GetDefinitionModuleFile,
AssociateModule, GetModuleFile, Get,
ForeachSourceModuleDo, IsSourceSeen, IsModuleSeen,
LookupModule, LookupOuterModule, DisplayModules ;
TYPE
DoProcedure = PROCEDURE (CARDINAL) ;
(*
MakeDefinitionSource - is given a Name, n, which is used to create a Definition
module.
The Definition Module will be placed onto the
compilation pending queue if it has not yet been
compiled.
If the module has been compiled then no action is
taken. The Module Sym is returned.
*)
PROCEDURE MakeDefinitionSource (tok: CARDINAL; n: Name) : CARDINAL ;
(*
MakeImplementationSource - is given a Name, n, which is used to create an
implementation module.
The implementation Module will be placed onto
the compilation pending
queue if it has not yet been compiled.
If the module has been compiled then no
action is taken. The Module Sym is returned.
*)
PROCEDURE MakeImplementationSource (tok: CARDINAL; n: Name) : CARDINAL ;
(*
MakeProgramSource - is given a Name, n, which is used to create a program module.
The program module will be placed onto the compilation
pending queue if it has not yet been compiled.
If the module has been compiled then no action is taken.
The Module Sym is returned.
*)
PROCEDURE MakeProgramSource (tok: CARDINAL; n: Name) : CARDINAL ;
(*
GetSource - returns with the symbol Sym of the next module to be compiled.
If Sym returns with value NulSym then no module should be
compiled.
*)
PROCEDURE GetSource () : CARDINAL ;
(*
GetModuleNo - returns with symbol number of the module which was
the nth module to be read in Pass 1.
The modules are numbered from 1..n
*)
PROCEDURE GetModuleNo (nth: CARDINAL) : CARDINAL ;
(*
IsModuleKnown - returns TRUE if the Name, n, matches a module.
*)
PROCEDURE IsModuleKnown (n: Name) : BOOLEAN ;
(*
AssociateDefinition - associate the source file, filename, with the definition module,
Sym.
*)
PROCEDURE AssociateDefinition (filename: String; Sym: CARDINAL) : String ;
(*
GetDefinitionModuleFile - returns the filename associated with the definition module, Sym.
It may return a temporary preprocessed file.
*)
PROCEDURE GetDefinitionModuleFile (Sym: CARDINAL) : String ;
(*
AssociateModule - associate the source file, filename, with the implementation/program
module, Sym.
*)
PROCEDURE AssociateModule (filename: String; Sym: CARDINAL) : String ;
(*
GetModuleFile - returns the filename associated with the implementation/program module, Sym.
It may return a temporary preprocessed file.
*)
PROCEDURE GetModuleFile (Sym: CARDINAL) : String ;
(*
ForeachSourceModuleDo - call each procedure, p, for which there is a known
source file.
*)
PROCEDURE ForeachSourceModuleDo (p: DoProcedure) ;
(*
IsSourceSeen - returns TRUE if the source for module, sym, has been seen.
*)
PROCEDURE IsSourceSeen (sym: CARDINAL) : BOOLEAN ;
(*
IsModuleSeen - returns TRUE if the source for module, name, has been seen.
*)
PROCEDURE IsModuleSeen (n: Name) : BOOLEAN ;
(*
LookupModule - looks up a module in the current scope, if a module does not exist
then it creates a DefImp module.
*)
PROCEDURE LookupModule (tok: CARDINAL; n: Name) : CARDINAL ;
(*
LookupOuterModule - looks up a module in the order of: current scope, then outer scope, finally if a
module does not exist then it creates a DefImp module.
*)
PROCEDURE LookupOuterModule (tok: CARDINAL; n: Name) : CARDINAL ;
(*
Get - returns the module symbol matching name, n.
*)
PROCEDURE Get (n: Name) : CARDINAL ;
(*
DisplayModules - a debugging routine to textually emit the names of modules in the DoneQ.
*)
PROCEDURE DisplayModules ;
END M2Batch.

View File

@@ -0,0 +1,470 @@
(* M2Batch.mod implements a queue for modules pending compilation.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2Batch ;
FROM M2Debug IMPORT Assert ;
FROM SymbolTable IMPORT MakeModule, MakeDefImp, IsModule, IsDefImp, GetScope, GetLocalSym, GetCurrentScope, GetSym, NulSym ;
FROM NameKey IMPORT GetKey, WriteKey ;
FROM M2Printf IMPORT printf2 ;
FROM M2Error IMPORT InternalError ;
FROM M2MetaError IMPORT MetaError1 ;
FROM Indexing IMPORT Index, InitIndex, GetIndice, HighIndice, RemoveIndiceFromIndex, IncludeIndiceIntoIndex, InBounds ;
FROM Lists IMPORT List, InitList, IncludeItemIntoList, RemoveItemFromList,
GetItemFromList, NoOfItemsInList ;
FROM Storage IMPORT ALLOCATE ;
FROM DynamicStrings IMPORT String ;
FROM M2Pass IMPORT IsPass1, IsPass2, IsPass3, IsPassC ;
TYPE
Module = POINTER TO RECORD
SymNo : CARDINAL ;
Key : Name ;
DefFile,
ModFile: String ;
END ;
VAR
SeenList : Index ;
PendingQueue: List ;
(*
MakeProgramSource - is given a Name, n, which is used to create a program module.
The program module will be placed onto the compilation
pending queue if it has not yet been compiled.
If the module has been compiled then no action is taken.
The Module Sym is returned.
*)
PROCEDURE MakeProgramSource (tok: CARDINAL; n: Name) : CARDINAL ;
VAR
Sym: CARDINAL ;
BEGIN
Sym := Get (n) ;
IF Sym = NulSym
THEN
Assert ((NOT IsPass1 ()) AND (NOT IsPass2 ()) AND (NOT IsPass3 ()) AND (NOT IsPassC ())) ;
(* Neither been compiled or on the Pending Queue *)
Sym := MakeModule (tok, n) ;
Put (Sym, n) ;
Push (Sym)
END ;
RETURN Sym
END MakeProgramSource ;
(*
MakeDefinitionSource - is given a Name, n, which is used to create a Definition
module.
The Definition Module will be placed onto the
compilation pending queue if it has not yet been
compiled.
If the module has been compiled then no action is
taken. The Module Sym is returned.
*)
PROCEDURE MakeDefinitionSource (tok: CARDINAL; n: Name) : CARDINAL ;
VAR
Sym: CARDINAL ;
BEGIN
Sym := Get (n) ;
IF Sym = NulSym
THEN
Assert ((NOT IsPass1 ()) AND (NOT IsPass2 ()) AND (NOT IsPass3 ()) AND (NOT IsPassC ())) ;
(* Neither been compiled or on the Pending Queue *)
Sym := MakeDefImp (tok, n) ;
Put (Sym, n) ;
Push (Sym)
END ;
RETURN Sym
END MakeDefinitionSource ;
(*
MakeImplementationSource - is given a Name, n, which is used to create an
implementation module.
The implementation Module will be placed onto
the compilation pending
queue if it has not yet been compiled.
If the module has been compiled then no
action is taken. The Module Sym is returned.
*)
PROCEDURE MakeImplementationSource (tok: CARDINAL; n: Name) : CARDINAL ;
VAR
Sym: CARDINAL ;
BEGIN
Sym := Get (n) ;
IF Sym = NulSym
THEN
Assert ((NOT IsPass1 ()) AND (NOT IsPass2 ()) AND (NOT IsPass3 ()) AND (NOT IsPassC ())) ;
(* Neither been compiled or on the Pending Queue *)
Sym := MakeDefImp (tok, n) ;
Put (Sym, n) ;
Push (Sym)
END ;
RETURN Sym
END MakeImplementationSource ;
(*
GetSource - returns with the symbol Sym of the next module to be compiled.
If Sym returns with value 0 then no module should be compiled.
*)
PROCEDURE GetSource () : CARDINAL ;
BEGIN
RETURN Pop ()
END GetSource ;
(*
GetModuleNo - returns with symbol number of the nth module read during Pass 1.
*)
PROCEDURE GetModuleNo (nth: CARDINAL) : CARDINAL ;
VAR
m: Module ;
BEGIN
Assert (nth#0) ;
IF InBounds (SeenList, nth)
THEN
m := GetIndice (SeenList, nth) ;
RETURN m^.SymNo
ELSE
RETURN NulSym
END
END GetModuleNo ;
(*
IsModuleKnown - returns TRUE if the Name n matches a module.
*)
PROCEDURE IsModuleKnown (n: Name) : BOOLEAN ;
BEGIN
RETURN Get (n) # NulSym
END IsModuleKnown ;
(*
Get - returns the module symbol matching name n.
*)
PROCEDURE Get (n: Name) : CARDINAL ;
VAR
i, no: CARDINAL ;
m : Module ;
BEGIN
i := 1 ;
no := HighIndice (SeenList) ;
WHILE i <= no DO
m := GetIndice (SeenList, i) ;
WITH m^ DO
IF Key = n
THEN
RETURN SymNo
ELSE
INC (i)
END
END
END ;
RETURN NulSym
END Get ;
PROCEDURE Put (Sym: CARDINAL; n: Name) ;
VAR
m: Module ;
BEGIN
NEW (m) ;
IncludeIndiceIntoIndex (SeenList, m) ;
WITH m^ DO
SymNo := Sym ;
Key := n ;
DefFile := NIL ;
ModFile := NIL
END
END Put ;
PROCEDURE Push (Sym: CARDINAL) ;
BEGIN
IncludeItemIntoList (PendingQueue, Sym)
END Push ;
PROCEDURE Pop () : CARDINAL ;
VAR
n : CARDINAL ;
Sym: CARDINAL ;
BEGIN
n := NoOfItemsInList (PendingQueue) ;
IF n = 0
THEN
RETURN NulSym
ELSE
Sym := GetItemFromList (PendingQueue, n) ;
RemoveItemFromList (PendingQueue, Sym) ;
RETURN Sym
END
END Pop ;
(*
DisplayModules - a debugging routine to textually emit the names of modules in the SeenList.
*)
PROCEDURE DisplayModules ;
VAR
m : Module ;
n, i: CARDINAL ;
BEGIN
i := 1 ;
n := HighIndice (SeenList) ;
WHILE i<=n DO
m := GetIndice (SeenList, i) ;
WITH m^ DO
printf2 ('Module %a %d\n', Key, i)
END ;
INC (i)
END
END DisplayModules ;
(*
AssociateDefinition - associate the source file, filename, with the definition module,
Sym.
*)
PROCEDURE AssociateDefinition (filename: String; Sym: CARDINAL) : String ;
VAR
no, i: CARDINAL ;
m : Module ;
BEGIN
i := 1 ;
no := HighIndice (SeenList) ;
WHILE i <= no DO
m := GetIndice (SeenList, i) ;
WITH m^ DO
IF SymNo = Sym
THEN
DefFile := filename ;
RETURN filename
ELSE
INC (i)
END
END
END ;
InternalError ('failed to find module sym')
END AssociateDefinition ;
(*
GetDefinitionModuleFile - returns the filename associated with the definition module, Sym.
It may return a temporary preprocessed file.
*)
PROCEDURE GetDefinitionModuleFile (Sym: CARDINAL) : String ;
VAR
no, i: CARDINAL ;
m : Module ;
BEGIN
i := 1 ;
no := HighIndice (SeenList) ;
WHILE i <= no DO
m := GetIndice (SeenList, i) ;
WITH m^ DO
IF SymNo = Sym
THEN
RETURN DefFile
ELSE
INC (i)
END
END
END ;
RETURN NIL
END GetDefinitionModuleFile ;
(*
AssociateModule - associate the source file, filename, with the implementation/program
module, Sym.
*)
PROCEDURE AssociateModule (filename: String; Sym: CARDINAL) : String ;
VAR
no, i: CARDINAL ;
m : Module ;
BEGIN
i := 1 ;
no := HighIndice (SeenList) ;
WHILE i<=no DO
m := GetIndice (SeenList, i) ;
WITH m^ DO
IF SymNo = Sym
THEN
ModFile := filename ;
RETURN filename
ELSE
INC (i)
END
END
END ;
InternalError ('failed to find module sym')
END AssociateModule ;
(*
GetModuleFile - returns the filename associated with the implementation/program module, Sym.
It may return a temporary preprocessed file.
*)
PROCEDURE GetModuleFile (Sym: CARDINAL) : String ;
VAR
no, i: CARDINAL ;
m : Module ;
BEGIN
i := 1 ;
no := HighIndice (SeenList) ;
WHILE i <= no DO
m := GetIndice (SeenList, i) ;
WITH m^ DO
IF SymNo = Sym
THEN
RETURN ModFile
ELSE
INC (i)
END
END
END ;
RETURN NIL
END GetModuleFile ;
(*
ForeachSourceModuleDo - for each source file call procedure, p.
*)
PROCEDURE ForeachSourceModuleDo (p: DoProcedure) ;
VAR
i, no: CARDINAL ;
m : Module ;
BEGIN
i := 1 ;
no := HighIndice (SeenList) ;
WHILE i<=no DO
m := GetIndice (SeenList, i) ;
WITH m^ DO
IF ModFile # NIL
THEN
p (SymNo)
END
END ;
INC (i)
END
END ForeachSourceModuleDo ;
(*
IsSourceSeen - returns TRUE if the source for the program module or
implementation module has been seen.
*)
PROCEDURE IsSourceSeen (sym: CARDINAL) : BOOLEAN ;
BEGIN
Assert (IsModule (sym) OR IsDefImp (sym)) ;
RETURN GetModuleFile (sym) # NIL
END IsSourceSeen ;
(*
IsModuleSeen - returns TRUE if the source for module, name, has been seen.
*)
PROCEDURE IsModuleSeen (n: Name) : BOOLEAN ;
BEGIN
RETURN Get (n) # NulSym
END IsModuleSeen ;
(*
LookupModule - looks up a module in the current scope, if a module does not exist
then it creates a DefImp module.
*)
PROCEDURE LookupModule (tok: CARDINAL; n: Name) : CARDINAL ;
VAR
sym: CARDINAL ;
BEGIN
sym := GetSym (n) ;
IF sym = NulSym
THEN
RETURN MakeDefinitionSource (tok, n)
ELSIF IsModule (sym) OR IsDefImp (sym)
THEN
RETURN sym
ELSE
RETURN MakeDefinitionSource (tok, n)
END
END LookupModule ;
(*
LookupOuterModule - looks up a module in the order of: current scope, then outer scope, finally if a
module does not exist then it creates a DefImp module.
*)
PROCEDURE LookupOuterModule (tok: CARDINAL; n: Name) : CARDINAL ;
VAR
outer: CARDINAL ;
sym : CARDINAL ;
BEGIN
sym := GetSym (n) ;
IF sym = NulSym
THEN
outer := GetScope (GetCurrentScope ()) ;
IF outer # NulSym
THEN
sym := GetLocalSym (outer, n)
END ;
IF sym = NulSym
THEN
(* not a local module, so it must be refering to a definition module. *)
sym := MakeDefinitionSource (tok, n)
END
END ;
IF IsModule (sym) OR IsDefImp (sym)
THEN
RETURN sym
ELSE
RETURN MakeDefinitionSource (tok, n)
END
END LookupOuterModule ;
BEGIN
InitList (PendingQueue) ;
SeenList := InitIndex (1)
END M2Batch.

View File

@@ -0,0 +1,54 @@
(* M2Bitset.def provides the BITSET type.
Copyright (C) 2003-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2Bitset ;
(*
Title : M2Bitset
Author : Gaius Mulley
System : GNU Modula-2
Date : Wed May 7 21:21:31 2003
Revision : $Version$
Description: provides the BITSET type.
*)
EXPORT QUALIFIED MakeBitset, GetBitsetMinMax, Bitset, Bitnum ;
VAR
Bitset, Bitnum: CARDINAL ;
(*
MakeBitset - creates and declares the type BITSET.
*)
PROCEDURE MakeBitset ;
(*
GetBitsetMinMax - assigns min and max to the minimum and maximum values of BITSET.
*)
PROCEDURE GetBitsetMinMax (VAR min, max: CARDINAL) ;
END M2Bitset.

View File

@@ -0,0 +1,89 @@
(* M2Bitset.mod provides the BITSET type.
Copyright (C) 2003-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2Bitset ;
FROM M2Debug IMPORT Assert ;
FROM m2tree IMPORT Tree ;
FROM m2linemap IMPORT BuiltinsLocation ;
FROM m2type IMPORT GetWordType ;
FROM m2decl IMPORT GetBitsPerBitset ;
FROM m2expr IMPORT GetSizeOf ;
FROM M2ALU IMPORT PushCard, PushIntegerTree ;
FROM NameKey IMPORT MakeKey ;
FROM M2System IMPORT Word ;
FROM M2Base IMPORT Cardinal ;
FROM M2LexBuf IMPORT BuiltinTokenNo ;
FROM SymbolTable IMPORT NulSym,
MakeConstLit,
MakeConstVar,
MakeSet,
MakeSubrange,
PutSet,
PutSubrange,
PopValue,
PopSize ;
VAR
MinBitset, MaxBitset : CARDINAL ;
(*
MakeBitset - creates and declares the type BITSET.
*)
PROCEDURE MakeBitset ;
BEGIN
Bitset := MakeSet (BuiltinTokenNo, MakeKey('BITSET')) ; (* Base Type *)
(* MinBitset *)
MinBitset := MakeConstLit (BuiltinTokenNo, MakeKey('0'), Cardinal) ;
(* MaxBitset *)
MaxBitset := MakeConstVar (BuiltinTokenNo, MakeKey('MaxBitset')) ;
PushCard (GetBitsPerBitset()-1) ;
PopValue (MaxBitset) ;
Assert (Word#NulSym) ;
Bitnum := MakeSubrange (BuiltinTokenNo, MakeKey('BITNUM')) ;
PutSubrange (Bitnum, MinBitset, MaxBitset, Cardinal) ;
PutSet (Bitset, Bitnum, FALSE) ;
PushIntegerTree (GetSizeOf(BuiltinsLocation(), GetWordType())) ;
PopSize (Bitset)
END MakeBitset ;
(*
GetBitsetMinMax - assigns min and max to the minimum and maximum values of BITSET.
*)
PROCEDURE GetBitsetMinMax (VAR min, max: CARDINAL) ;
BEGIN
min := MinBitset ;
max := MaxBitset
END GetBitsetMinMax ;
END M2Bitset.

View File

@@ -0,0 +1,123 @@
(* M2CaseList.def implement ISO case label lists.
Copyright (C) 2009-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2CaseList ;
(*
Title : M2CaseList
Author : Gaius Mulley
System : GNU Modula-2
Date : Fri Jul 24 09:53:48 2009
Revision : $Version$
Description:
*)
FROM DynamicStrings IMPORT String ;
FROM Lists IMPORT List ;
(*
PushCase - create a case entity and push it to an internal stack.
Return the case id.
*)
PROCEDURE PushCase (r: CARDINAL; v: CARDINAL) : CARDINAL ;
(*
PopCase - pop the top element of the case entity from the internal
stack.
*)
PROCEDURE PopCase ;
(*
ElseCase - indicates that this case varient does have an else clause.
*)
PROCEDURE ElseCase (f: CARDINAL) ;
(*
BeginCaseList - create a new label list.
*)
PROCEDURE BeginCaseList (v: CARDINAL) ;
(*
EndCaseList - terminate the current label list.
*)
PROCEDURE EndCaseList ;
(*
AddRange - add a range to the current label list.
*)
PROCEDURE AddRange (r1, r2: CARDINAL; tok: CARDINAL) ;
(*
CaseBoundsResolved - returns TRUE if all constants in the case list, c,
are known to GCC.
*)
PROCEDURE CaseBoundsResolved (tokenno: CARDINAL; c: CARDINAL) : BOOLEAN ;
(*
TypeCaseBounds - returns TRUE if all bounds in case list, c, are
compatible with the tagged type.
*)
PROCEDURE TypeCaseBounds (c: CARDINAL) : BOOLEAN ;
(*
OverlappingCaseBounds - returns TRUE if there were any overlapping bounds
in the case list, c. It will generate an error
messages for each overlapping bound found.
*)
PROCEDURE OverlappingCaseBounds (c: CARDINAL) : BOOLEAN ;
(*
MissingCaseBounds - returns TRUE if there were any missing bounds
in the varient record case list, c. It will
generate an error message for each missing
bounds found.
*)
PROCEDURE MissingCaseBounds (tokenno: CARDINAL; c: CARDINAL) : BOOLEAN ;
(*
WriteCase - displays the case list.
*)
PROCEDURE WriteCase (c: CARDINAL) ;
END M2CaseList.

View File

@@ -0,0 +1,933 @@
(* M2CaseList.mod implement ISO case label lists.
Copyright (C) 2009-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2CaseList ;
FROM M2Debug IMPORT Assert ;
FROM M2GCCDeclare IMPORT TryDeclareConstant, GetTypeMin, GetTypeMax ;
FROM M2MetaError IMPORT MetaError1, MetaError2, MetaErrorT0, MetaErrorT1, MetaErrorT2, MetaErrorT3, MetaErrorT4, MetaErrorString1 ;
FROM M2Error IMPORT InternalError ;
FROM M2Range IMPORT OverlapsRange, IsEqual, IsGreater ;
FROM M2ALU IMPORT PushIntegerTree, PopIntegerTree, Addn, Sub, PushInt ;
FROM Indexing IMPORT Index, InitIndex, PutIndice, GetIndice, ForeachIndiceInIndexDo, HighIndice ;
FROM Lists IMPORT InitList, IncludeItemIntoList ;
FROM NameKey IMPORT KeyToCharStar ;
FROM SymbolConversion IMPORT GccKnowsAbout, Mod2Gcc, AddModGcc ;
FROM DynamicStrings IMPORT InitString, InitStringCharStar, ConCat, Mark, KillString ;
FROM m2tree IMPORT Tree ;
FROM m2block IMPORT RememberType ;
FROM m2type IMPORT GetMinFrom ;
FROM Storage IMPORT ALLOCATE ;
FROM M2Base IMPORT IsExpressionCompatible ;
FROM M2Printf IMPORT printf1 ;
FROM SymbolTable IMPORT NulSym, IsConst, IsFieldVarient, IsRecord, IsRecordField, GetVarientTag, GetType,
ForeachLocalSymDo, GetSymName, IsEnumeration, SkipType ;
TYPE
RangePair = POINTER TO RECORD
low, high: CARDINAL ;
tokenno : CARDINAL ;
END ;
ConflictingPair = POINTER TO RECORD
a, b: RangePair ;
END ;
CaseList = POINTER TO RECORD
maxRangeId : CARDINAL ;
rangeArray : Index ;
currentRange: RangePair ;
varientField: CARDINAL ;
END ;
CaseDescriptor = POINTER TO RECORD
elseClause : BOOLEAN ;
elseField : CARDINAL ;
record : CARDINAL ;
varient : CARDINAL ;
maxCaseId : CARDINAL ;
caseListArray: Index ;
currentCase : CaseList ;
next : CaseDescriptor ;
END ;
SetRange = POINTER TO RECORD
low, high: Tree ;
next : SetRange ;
END ;
VAR
caseStack : CaseDescriptor ;
caseId : CARDINAL ;
caseArray : Index ;
conflictArray: Index ;
FreeRangeList: SetRange ;
(*
PushCase - create a case entity and push it to an internal stack.
r, is NulSym if this is a CASE statement.
If, r, is a record then it indicates it includes one
or more varients reside in the record. The particular
varient is, v.
Return the case id.
*)
PROCEDURE PushCase (r: CARDINAL; v: CARDINAL) : CARDINAL ;
VAR
c: CaseDescriptor ;
BEGIN
INC(caseId) ;
NEW(c) ;
IF c=NIL
THEN
InternalError ('out of memory error')
ELSE
WITH c^ DO
elseClause := FALSE ;
elseField := NulSym ;
record := r ;
varient := v ;
maxCaseId := 0 ;
caseListArray := InitIndex(1) ;
next := caseStack ;
currentCase := NIL
END ;
caseStack := c ;
PutIndice(caseArray, caseId, c)
END ;
RETURN( caseId )
END PushCase ;
(*
PopCase - pop the top element of the case entity from the internal
stack.
*)
PROCEDURE PopCase ;
BEGIN
IF caseStack=NIL
THEN
InternalError ('case stack is empty')
END ;
caseStack := caseStack^.next
END PopCase ;
(*
ElseCase - indicates that this case varient does have an else clause.
*)
PROCEDURE ElseCase (f: CARDINAL) ;
BEGIN
WITH caseStack^ DO
elseClause := TRUE ;
elseField := f
END
END ElseCase ;
(*
BeginCaseList - create a new label list.
*)
PROCEDURE BeginCaseList (v: CARDINAL) ;
VAR
l: CaseList ;
BEGIN
NEW(l) ;
IF l=NIL
THEN
InternalError ('out of memory error')
END ;
WITH l^ DO
maxRangeId := 0 ;
rangeArray := InitIndex(1) ;
currentRange := NIL ;
varientField := v
END ;
WITH caseStack^ DO
INC(maxCaseId) ;
PutIndice(caseListArray, maxCaseId, l) ;
currentCase := l
END
END BeginCaseList ;
(*
EndCaseList - terminate the current label list.
*)
PROCEDURE EndCaseList ;
BEGIN
caseStack^.currentCase := NIL
END EndCaseList ;
(*
AddRange - add a range to the current label list.
*)
PROCEDURE AddRange (r1, r2: CARDINAL; tok: CARDINAL) ;
VAR
r: RangePair ;
BEGIN
NEW(r) ;
IF r=NIL
THEN
InternalError ('out of memory error')
ELSE
WITH r^ DO
low := r1 ;
high := r2 ;
tokenno := tok
END ;
WITH caseStack^.currentCase^ DO
INC(maxRangeId) ;
PutIndice(rangeArray, maxRangeId, r) ;
currentRange := r
END
END
END AddRange ;
(*
GetVariantTagType - returns the type associated with, variant.
*)
PROCEDURE GetVariantTagType (variant: CARDINAL) : CARDINAL ;
VAR
tag: CARDINAL ;
BEGIN
tag := GetVarientTag(variant) ;
IF IsFieldVarient(tag) OR IsRecordField(tag)
THEN
RETURN( GetType(tag) )
ELSE
RETURN( tag )
END
END GetVariantTagType ;
(*
CaseBoundsResolved - returns TRUE if all constants in the case list, c,
are known to GCC.
*)
PROCEDURE CaseBoundsResolved (tokenno: CARDINAL; c: CARDINAL) : BOOLEAN ;
VAR
resolved: BOOLEAN ;
p : CaseDescriptor ;
q : CaseList ;
r : RangePair ;
min,
max,
type,
i, j : CARDINAL ;
BEGIN
p := GetIndice(caseArray, c) ;
WITH p^ DO
IF varient#NulSym
THEN
(* not a CASE statement, but a varient record containing without an ELSE clause *)
type := GetVariantTagType(varient) ;
resolved := TRUE ;
IF NOT GccKnowsAbout(type)
THEN
(* do we need to add, type, to the list of types required to be resolved? *)
resolved := FALSE
END ;
min := GetTypeMin(type) ;
IF NOT GccKnowsAbout(min)
THEN
TryDeclareConstant(tokenno, min) ;
resolved := FALSE
END ;
max := GetTypeMax(type) ;
IF NOT GccKnowsAbout(max)
THEN
TryDeclareConstant(tokenno, max) ;
resolved := FALSE
END ;
IF NOT resolved
THEN
RETURN( FALSE )
END
END ;
i := 1 ;
WHILE i<=maxCaseId DO
q := GetIndice(caseListArray, i) ;
j := 1 ;
WHILE j<=q^.maxRangeId DO
r := GetIndice(q^.rangeArray, j) ;
IF r^.low#NulSym
THEN
IF IsConst(r^.low)
THEN
TryDeclareConstant(tokenno, r^.low) ;
IF NOT GccKnowsAbout(r^.low)
THEN
RETURN( FALSE )
END
ELSE
IF r^.high=NulSym
THEN
MetaError1('the CASE statement variant must be defined by a constant {%1Da:is a {%1d}}', r^.low)
ELSE
MetaError1('the CASE statement variant low value in a range must be defined by a constant {%1Da:is a {%1d}}',
r^.low)
END
END
END ;
IF r^.high#NulSym
THEN
IF IsConst(r^.high)
THEN
TryDeclareConstant(tokenno, r^.high) ;
IF NOT GccKnowsAbout(r^.high)
THEN
RETURN( FALSE )
END
ELSE
MetaError1('the CASE statement variant high value in a range must be defined by a constant {%1Da:is a {%1d}}',
r^.high)
END
END ;
INC(j)
END ;
INC(i)
END
END ;
RETURN( TRUE )
END CaseBoundsResolved ;
(*
IsSame - return TRUE if r, s, are in, e.
*)
PROCEDURE IsSame (e: ConflictingPair; r, s: RangePair) : BOOLEAN ;
BEGIN
WITH e^ DO
RETURN( ((a=r) AND (b=s)) OR ((a=s) AND (b=r)) )
END
END IsSame ;
(*
SeenBefore -
*)
PROCEDURE SeenBefore (r, s: RangePair) : BOOLEAN ;
VAR
i, h: CARDINAL ;
e : ConflictingPair ;
BEGIN
h := HighIndice(conflictArray) ;
i := 1 ;
WHILE i<=h DO
e := GetIndice(conflictArray, i) ;
IF IsSame(e, r, s)
THEN
RETURN( TRUE )
END ;
INC(i)
END ;
NEW(e) ;
WITH e^ DO
a := r ;
b := s
END ;
PutIndice(conflictArray, h+1, e) ;
RETURN( FALSE )
END SeenBefore ;
(*
Overlaps -
*)
PROCEDURE Overlaps (r, s: RangePair) : BOOLEAN ;
VAR
a, b, c, d: CARDINAL ;
BEGIN
a := r^.low ;
c := s^.low ;
IF r^.high=NulSym
THEN
b := a ;
IF s^.high=NulSym
THEN
d := c ;
IF OverlapsRange(Mod2Gcc(a), Mod2Gcc(b), Mod2Gcc(c), Mod2Gcc(d))
THEN
IF NOT SeenBefore(r, s)
THEN
MetaErrorT2 (r^.tokenno, 'case label {%1ad} is a duplicate with {%2ad}', a, c) ;
MetaErrorT2 (s^.tokenno, 'case label {%1ad} is a duplicate with {%2ad}', c, a)
END ;
RETURN( TRUE )
END
ELSE
d := s^.high ;
IF OverlapsRange(Mod2Gcc(a), Mod2Gcc(b), Mod2Gcc(c), Mod2Gcc(d))
THEN
IF NOT SeenBefore (r, s)
THEN
MetaErrorT3 (r^.tokenno, 'case label {%1ad} is a duplicate in the range {%2ad}..{%3ad}', a, c, d) ;
MetaErrorT3 (s^.tokenno, 'case range {%2ad}..{%3ad} is a duplicate of case label {%1ad}', c, d, a)
END ;
RETURN( TRUE )
END
END
ELSE
b := r^.high ;
IF s^.high=NulSym
THEN
d := c ;
IF OverlapsRange (Mod2Gcc(a), Mod2Gcc(b), Mod2Gcc(c), Mod2Gcc(d))
THEN
IF NOT SeenBefore(r, s)
THEN
MetaErrorT3 (r^.tokenno, 'case range {%1ad}..{%2ad} is a duplicate with case label {%3ad}', a, b, c) ;
MetaErrorT3 (s^.tokenno, 'case label {%1ad} is a duplicate with case range %{2ad}..{%3ad}', c, a, b)
END ;
RETURN( TRUE )
END
ELSE
d := s^.high ;
IF OverlapsRange(Mod2Gcc(a), Mod2Gcc(b), Mod2Gcc(c), Mod2Gcc(d))
THEN
IF NOT SeenBefore(r, s)
THEN
MetaErrorT4 (r^.tokenno, 'case range {%1ad}..{%2ad} overlaps case range {%3ad}..{%4ad}', a, b, c, d) ;
MetaErrorT4 (s^.tokenno, 'case range {%1ad}..{%2ad} overlaps case range {%3ad}..{%4ad}', c, d, a, b)
END ;
RETURN( TRUE )
END
END
END ;
RETURN( FALSE )
END Overlaps ;
(*
OverlappingCaseBound - returns TRUE if, r, overlaps any case bound in the
case statement, c.
*)
PROCEDURE OverlappingCaseBound (r: RangePair; c: CARDINAL) : BOOLEAN ;
VAR
p : CaseDescriptor ;
q : CaseList ;
s : RangePair ;
i, j : CARDINAL ;
overlap: BOOLEAN ;
BEGIN
p := GetIndice (caseArray, c) ;
overlap := FALSE ;
WITH p^ DO
i := 1 ;
WHILE i<=maxCaseId DO
q := GetIndice (caseListArray, i) ;
j := 1 ;
WHILE j<=q^.maxRangeId DO
s := GetIndice (q^.rangeArray, j) ;
IF (s#r) AND Overlaps (r, s)
THEN
overlap := TRUE
END ;
INC (j)
END ;
INC (i)
END
END ;
RETURN( overlap )
END OverlappingCaseBound ;
(*
OverlappingCaseBounds - returns TRUE if there were any overlapping bounds
in the case list, c. It will generate an error
messages for each overlapping bound found.
*)
PROCEDURE OverlappingCaseBounds (c: CARDINAL) : BOOLEAN ;
VAR
p : CaseDescriptor ;
q : CaseList ;
r : RangePair ;
i, j : CARDINAL ;
overlap: BOOLEAN ;
BEGIN
p := GetIndice(caseArray, c) ;
overlap := FALSE ;
WITH p^ DO
i := 1 ;
WHILE i<=maxCaseId DO
q := GetIndice(caseListArray, i) ;
j := 1 ;
WHILE j<=q^.maxRangeId DO
r := GetIndice(q^.rangeArray, j) ;
IF OverlappingCaseBound (r, c)
THEN
overlap := TRUE
END ;
INC(j)
END ;
INC(i)
END
END ;
RETURN( overlap )
END OverlappingCaseBounds ;
(*
NewRanges -
*)
PROCEDURE NewRanges () : SetRange ;
VAR
s: SetRange ;
BEGIN
IF FreeRangeList=NIL
THEN
NEW(s)
ELSE
s := FreeRangeList ;
FreeRangeList := FreeRangeList^.next
END ;
s^.next := NIL ;
RETURN( s )
END NewRanges ;
(*
NewSet -
*)
PROCEDURE NewSet (type: CARDINAL) : SetRange ;
VAR
s: SetRange ;
BEGIN
s := NewRanges() ;
WITH s^ DO
low := Mod2Gcc(GetTypeMin(type)) ;
high := Mod2Gcc(GetTypeMax(type)) ;
next := NIL
END ;
RETURN( s )
END NewSet ;
(*
DisposeRanges -
*)
PROCEDURE DisposeRanges (set: SetRange) : SetRange ;
VAR
t: SetRange ;
BEGIN
IF set#NIL
THEN
IF FreeRangeList=NIL
THEN
FreeRangeList := set
ELSE
t := set ;
WHILE t^.next#NIL DO
t := t^.next
END ;
t^.next := FreeRangeList ;
FreeRangeList := set
END
END ;
RETURN( NIL )
END DisposeRanges ;
(*
SubBitRange - subtracts bits, lo..hi, from, set.
*)
PROCEDURE SubBitRange (set: SetRange; lo, hi: Tree; tokenno: CARDINAL) : SetRange ;
VAR
h, i : SetRange ;
BEGIN
h := set ;
WHILE h#NIL DO
IF (h^.high=NIL) OR IsEqual(h^.high, h^.low)
THEN
IF IsEqual(h^.low, lo) OR OverlapsRange(lo, hi, h^.low, h^.low)
THEN
IF h=set
THEN
set := set^.next ;
h^.next := NIL ;
h := DisposeRanges(h) ;
h := set
ELSE
i := set ;
WHILE i^.next#h DO
i := i^.next
END ;
i^.next := h^.next ;
i := h ;
h := h^.next ;
i^.next := NIL ;
i := DisposeRanges(i)
END
ELSE
h := h^.next
END
ELSE
IF OverlapsRange(lo, hi, h^.low, h^.high)
THEN
IF IsGreater(h^.low, lo) OR IsGreater(hi, h^.high)
THEN
MetaErrorT0 (tokenno, 'variant case range lies outside tag value')
ELSE
IF IsEqual(h^.low, lo)
THEN
PushIntegerTree(hi) ;
PushInt(1) ;
Addn ;
h^.low := PopIntegerTree()
ELSIF IsEqual(h^.high, hi)
THEN
PushIntegerTree(lo) ;
PushInt(1) ;
Sub ;
h^.high := PopIntegerTree()
ELSE
(* lo..hi exist inside range h^.low..h^.high *)
i := NewRanges() ;
i^.next := h^.next ;
h^.next := i ;
i^.high := h^.high ;
PushIntegerTree(lo) ;
PushInt(1) ;
Sub ;
h^.high := PopIntegerTree() ;
PushIntegerTree(hi) ;
PushInt(1) ;
Addn ;
i^.low := PopIntegerTree()
END
END
ELSE
h := h^.next
END
END
END ;
RETURN( set )
END SubBitRange ;
(*
ExcludeCaseRanges - excludes all case ranges found in, p, from, set
*)
PROCEDURE ExcludeCaseRanges (set: SetRange; p: CaseDescriptor) : SetRange ;
VAR
i, j: CARDINAL ;
q : CaseList ;
r : RangePair ;
BEGIN
WITH p^ DO
i := 1 ;
WHILE i<=maxCaseId DO
q := GetIndice(caseListArray, i) ;
j := 1 ;
WHILE j<=q^.maxRangeId DO
r := GetIndice(q^.rangeArray, j) ;
IF r^.high=NulSym
THEN
set := SubBitRange(set, Mod2Gcc(r^.low), Mod2Gcc(r^.low), r^.tokenno)
ELSE
set := SubBitRange(set, Mod2Gcc(r^.low), Mod2Gcc(r^.high), r^.tokenno)
END ;
INC(j)
END ;
INC(i)
END
END ;
RETURN( set )
END ExcludeCaseRanges ;
VAR
High, Low : Tree ;
errorString: String ;
(*
DoEnumValues -
*)
PROCEDURE DoEnumValues (sym: CARDINAL) ;
BEGIN
IF (Low#NIL) AND IsEqual(Mod2Gcc(sym), Low)
THEN
errorString := ConCat(errorString, InitStringCharStar(KeyToCharStar(GetSymName(sym)))) ;
Low := NIL
END ;
IF (High#NIL) AND IsEqual(Mod2Gcc(sym), High)
THEN
errorString := ConCat(errorString, Mark(InitString('..'))) ;
errorString := ConCat(errorString, Mark(InitStringCharStar(KeyToCharStar(GetSymName(sym))))) ;
High := NIL
END
END DoEnumValues ;
(*
ErrorRange -
*)
PROCEDURE ErrorRange (p: CaseDescriptor; type: CARDINAL; set: SetRange) ;
BEGIN
type := SkipType(type) ;
IF IsEnumeration(type)
THEN
Low := set^.low ;
High := set^.high ;
IF IsEqual(Low, High)
THEN
High := NIL ;
errorString := InitString('enumeration value ') ;
ForeachLocalSymDo(type, DoEnumValues) ;
errorString := ConCat(errorString, InitString(' is ignored by the CASE variant record {%1D}'))
ELSE
errorString := InitString('enumeration values ') ;
ForeachLocalSymDo(type, DoEnumValues) ;
errorString := ConCat(errorString, InitString(' are ignored by the CASE variant record {%1D}'))
END ;
MetaErrorString1(errorString, p^.varient)
END
END ErrorRange ;
(*
ErrorRanges -
*)
PROCEDURE ErrorRanges (p: CaseDescriptor; type: CARDINAL; set: SetRange) ;
BEGIN
WHILE set#NIL DO
ErrorRange(p, type, set) ;
set := set^.next
END
END ErrorRanges ;
(*
MissingCaseBounds - returns TRUE if there were any missing bounds
in the varient record case list, c. It will
generate an error message for each missing
bounds found.
*)
PROCEDURE MissingCaseBounds (tokenno: CARDINAL; c: CARDINAL) : BOOLEAN ;
VAR
p : CaseDescriptor ;
type : CARDINAL ;
missing: BOOLEAN ;
set : SetRange ;
BEGIN
p := GetIndice(caseArray, c) ;
missing := FALSE ;
WITH p^ DO
IF (record#NulSym) AND (varient#NulSym) AND (NOT elseClause)
THEN
(* not a CASE statement, but a varient record containing without an ELSE clause *)
type := GetVariantTagType(varient) ;
set := NewSet(type) ;
set := ExcludeCaseRanges(set, p) ;
IF set#NIL
THEN
missing := TRUE ;
MetaErrorT2 (tokenno,
'not all variant record alternatives in the {%kCASE} clause are specified, hint you either need to specify each value of {%2ad} or use an {%kELSE} clause',
varient, type) ;
ErrorRanges(p, type, set)
END ;
set := DisposeRanges(set)
END
END ;
RETURN( missing )
END MissingCaseBounds ;
(*
InRangeList - returns TRUE if the value, tag, is defined in the case list.
PROCEDURE InRangeList (cl: CaseList; tag: CARDINAL) : BOOLEAN ;
VAR
i, h: CARDINAL ;
r : RangePair ;
a : Tree ;
BEGIN
WITH cl^ DO
i := 1 ;
h := HighIndice(rangeArray) ;
WHILE i<=h DO
r := GetIndice(rangeArray, i) ;
WITH r^ DO
IF high=NulSym
THEN
a := Mod2Gcc(low)
ELSE
a := Mod2Gcc(high)
END ;
IF OverlapsRange(Mod2Gcc(low), a, Mod2Gcc(tag), Mod2Gcc(tag))
THEN
RETURN( TRUE )
END
END ;
INC(i)
END
END ;
RETURN( FALSE )
END InRangeList ;
*)
(*
WriteCase - dump out the case list (internal debugging).
*)
PROCEDURE WriteCase (c: CARDINAL) ;
BEGIN
(* this debugging procedure should be finished. *)
printf1 ("%d", c)
END WriteCase ;
(*
checkTypes - checks to see that, constant, and, type, are compatible.
*)
PROCEDURE checkTypes (constant, type: CARDINAL) : BOOLEAN ;
VAR
consttype: CARDINAL ;
BEGIN
IF (constant#NulSym) AND IsConst(constant)
THEN
consttype := GetType(constant) ;
IF NOT IsExpressionCompatible(consttype, type)
THEN
MetaError2('the CASE statement variant tag {%1ad} must be type compatible with the constant {%2Da:is a {%2d}}',
type, constant) ;
RETURN( FALSE )
END
END ;
RETURN( TRUE )
END checkTypes ;
(*
inRange - returns TRUE if, min <= i <= max.
*)
PROCEDURE inRange (i, min, max: CARDINAL) : BOOLEAN ;
BEGIN
RETURN( OverlapsRange(Mod2Gcc(i), Mod2Gcc(i), Mod2Gcc(min), Mod2Gcc(max)) )
END inRange ;
(*
TypeCaseBounds - returns TRUE if all bounds in case list, c, are
compatible with the tagged type.
*)
PROCEDURE TypeCaseBounds (c: CARDINAL) : BOOLEAN ;
VAR
p : CaseDescriptor ;
q : CaseList ;
r : RangePair ;
min, max,
type,
i, j : CARDINAL ;
compatible: BOOLEAN ;
BEGIN
p := GetIndice(caseArray, c) ;
type := NulSym ;
WITH p^ DO
type := NulSym ;
IF varient#NulSym
THEN
(* not a CASE statement, but a varient record containing without an ELSE clause *)
type := GetVariantTagType(varient) ;
min := GetTypeMin(type) ;
max := GetTypeMax(type)
END ;
IF type=NulSym
THEN
RETURN( TRUE )
END ;
compatible := TRUE ;
i := 1 ;
WHILE i<=maxCaseId DO
q := GetIndice(caseListArray, i) ;
j := 1 ;
WHILE j<=q^.maxRangeId DO
r := GetIndice(q^.rangeArray, j) ;
IF (r^.low#NulSym) AND (NOT inRange(r^.low, min, max))
THEN
MetaError2('the CASE statement variant range {%1ad} exceeds that of the tag type {%2ad}',
r^.low, type) ;
compatible := FALSE
END ;
IF NOT checkTypes(r^.low, type)
THEN
compatible := FALSE
END ;
IF (r^.high#NulSym) AND (NOT inRange(r^.high, min, max))
THEN
MetaError2('the CASE statement variant range {%1ad} exceeds that of the tag type {%2ad}',
r^.high, type) ;
compatible := FALSE
END ;
IF NOT checkTypes(r^.high, type)
THEN
compatible := FALSE
END ;
INC(j)
END ;
INC(i)
END ;
RETURN( compatible )
END
END TypeCaseBounds ;
BEGIN
caseStack := NIL ;
caseId := 0 ;
caseArray := InitIndex(1) ;
conflictArray := InitIndex(1) ;
FreeRangeList := NIL
END M2CaseList.

View File

@@ -0,0 +1,67 @@
(* M2Check.def perform rigerous type checking for fully declared symbols.
Copyright (C) 2020-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2Check ;
(*
Title : M2Check
Author : Gaius Mulley
System : GNU Modula-2
Date : Fri Mar 6 15:32:10 2020
Revision : $Version$
Description: provides a module to check the symbol type compatibility.
It assumes that the declaration of all dependants
is complete.
*)
(*
ParameterTypeCompatible - returns TRUE if the nth procedure parameter formal
is compatible with actual. If the string is empty then
no error is issued.
*)
PROCEDURE ParameterTypeCompatible (token: CARDINAL; format: ARRAY OF CHAR;
procedure, formal, actual, nth: CARDINAL;
isvar: BOOLEAN) : BOOLEAN ;
(*
AssignmentTypeCompatible - returns TRUE if the des and the expr are assignment compatible.
If the string is empty then no error is issued.
*)
PROCEDURE AssignmentTypeCompatible (token: CARDINAL; format: ARRAY OF CHAR;
des, expr: CARDINAL) : BOOLEAN ;
(*
ExpressionTypeCompatible - returns TRUE if the expressions, left and right,
are expression compatible.
If the string is empty then no error is issued.
*)
PROCEDURE ExpressionTypeCompatible (token: CARDINAL; format: ARRAY OF CHAR;
left, right: CARDINAL;
strict, isin: BOOLEAN) : BOOLEAN ;
END M2Check.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,54 @@
(* M2Code.def coordinate the activity of the front end.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2Code ;
(*
Title : M2Code
Author : Gaius Mulley
Date : 6/8/87
System : UNIX (GNU Modula-2)
Description: M2Code provides a module which coordinates the activity of the front
end optimization routines and the gcc tree generation.
*)
FROM SYSTEM IMPORT WORD ;
EXPORT QUALIFIED Code, CodeBlock ;
(*
Code - calls procedures to generates trees from the quadruples.
All front end quadruple optimization is performed via this call.
*)
PROCEDURE Code ;
(*
CodeBlock - generates all code for this block and also declares all types
and procedures for this block. It will also optimize quadruples
within this scope.
*)
PROCEDURE CodeBlock (scope: WORD) ;
END M2Code.

View File

@@ -0,0 +1,528 @@
(* M2Code.mod coordinate the activity of the front end.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2Code ;
FROM SYSTEM IMPORT WORD ;
FROM M2Options IMPORT Statistics, DisplayQuadruples, OptimizeUncalledProcedures,
(* OptimizeDynamic, *) OptimizeCommonSubExpressions,
StyleChecking, Optimizing, WholeProgram ;
FROM M2Error IMPORT InternalError ;
FROM M2Students IMPORT StudentVariableCheck ;
FROM SymbolTable IMPORT GetMainModule, IsProcedure,
IsModuleWithinProcedure,
CheckHiddenTypeAreAddress, IsModule, IsDefImp,
DebugLineNumbers,
ForeachProcedureDo,
ForeachInnerModuleDo, GetSymName ;
FROM M2Printf IMPORT printf2, printf1, printf0 ;
FROM NameKey IMPORT Name ;
FROM M2Batch IMPORT ForeachSourceModuleDo ;
FROM M2Quads IMPORT CountQuads, GetFirstQuad, DisplayQuadList, DisplayQuadRange,
BackPatchSubrangesAndOptParam, VariableAnalysis,
LoopAnalysis, ForLoopAnalysis, GetQuad, QuadOperator ;
FROM M2Pass IMPORT SetPassToNoPass, SetPassToCodeGeneration ;
FROM M2BasicBlock IMPORT BasicBlock,
InitBasicBlocks, InitBasicBlocksFromRange,
KillBasicBlocks, FreeBasicBlocks,
ForeachBasicBlockDo ;
FROM M2Optimize IMPORT FoldBranches, RemoveProcedures ;
FROM M2GenGCC IMPORT ConvertQuadsToTree ;
FROM M2GCCDeclare IMPORT FoldConstants, StartDeclareScope,
DeclareProcedure, InitDeclarations,
DeclareModuleVariables, MarkExported ;
FROM M2Scope IMPORT ScopeBlock, InitScopeBlock, KillScopeBlock, ForeachScopeBlockDo ;
FROM m2top IMPORT StartGlobalContext, EndGlobalContext, SetFlagUnitAtATime ;
FROM M2Error IMPORT FlushErrors, FlushWarnings ;
FROM M2Swig IMPORT GenerateSwigFile ;
FROM m2flex IMPORT GetTotalLines ;
FROM FIO IMPORT FlushBuffer, StdOut ;
FROM M2Quiet IMPORT qprintf0 ;
FROM M2SSA IMPORT DiscoverSSA ;
CONST
MaxOptimTimes = 10 ; (* upper limit of no of times we run through all optimization *)
Debugging = TRUE ;
VAR
Total,
Count,
OptimTimes,
DeltaProc,
Proc,
DeltaConst,
Const,
DeltaJump,
Jump,
DeltaBasicB,
BasicB : CARDINAL ;
(*
Percent - calculates the percentage from numerator and divisor
*)
PROCEDURE Percent (numerator, divisor: CARDINAL) ;
VAR
value: CARDINAL ;
BEGIN
printf0 (' (') ;
IF divisor=0
THEN
printf0 ('overflow error')
ELSE
value := numerator*100 DIV divisor ;
printf1 ('%3d', value)
END ;
printf0 ('\%)')
END Percent ;
(*
OptimizationAnalysis - displays some simple front end optimization statistics.
*)
PROCEDURE OptimizationAnalysis ;
VAR
value: CARDINAL ;
BEGIN
IF Statistics
THEN
Count := CountQuads() ;
printf1 ('M2 initial number of quadruples: %6d', Total) ;
Percent (Total, Total) ; printf0 ('\n');
printf1 ('M2 constant folding achieved : %6d', Const) ;
Percent (Const, Total) ; printf0 ('\n');
printf1 ('M2 branch folding achieved : %6d', Jump) ;
Percent (Jump, Total) ; printf0 ('\n');
value := Const+Jump+Proc ;
printf1 ('Front end optimization removed : %6d', value) ;
Percent (value, Total) ; printf0 ('\n') ;
printf1 ('Front end final : %6d', Count) ;
Percent (Count, Total) ; printf0 ('\n') ;
Count := GetTotalLines () ;
printf1 ('Total source lines compiled : %6d\n', Count) ;
FlushBuffer (StdOut)
END ;
IF DisplayQuadruples
THEN
printf0 ('after all front end optimization\n') ;
DisplayQuadList
END
END OptimizationAnalysis ;
(*
RemoveUnreachableCode -
*)
PROCEDURE RemoveUnreachableCode ;
BEGIN
IF WholeProgram
THEN
ForeachSourceModuleDo(RemoveProcedures)
ELSE
RemoveProcedures(GetMainModule())
END
END RemoveUnreachableCode ;
(*
DoModuleDeclare - declare all constants, types, variables, procedures for the
main module or all modules.
*)
PROCEDURE DoModuleDeclare ;
BEGIN
IF WholeProgram
THEN
ForeachSourceModuleDo (StartDeclareScope)
ELSE
StartDeclareScope (GetMainModule ())
END
END DoModuleDeclare ;
(*
PrintModule -
*)
(*
PROCEDURE PrintModule (sym: CARDINAL) ;
VAR
n: Name ;
BEGIN
n := GetSymName (sym) ;
printf1 ('module %a\n', n)
END PrintModule ;
*)
(*
DoCodeBlock - generate code for the main module or all modules.
*)
PROCEDURE DoCodeBlock ;
BEGIN
IF WholeProgram
THEN
(* ForeachSourceModuleDo(PrintModule) ; *)
CodeBlock (GetMainModule ())
ELSE
CodeBlock (GetMainModule ())
END
END DoCodeBlock ;
(*
DetermineSubExpTemporaries -
*)
PROCEDURE DetermineSubExpTemporaries ;
BEGIN
IF WholeProgram
THEN
ForeachSourceModuleDo (DiscoverSSA)
ELSE
DiscoverSSA (GetMainModule ())
END
END DetermineSubExpTemporaries ;
(*
Code - calls procedures to generates trees from the quadruples.
All front end quadruple optimization is performed via this call.
*)
PROCEDURE Code ;
BEGIN
CheckHiddenTypeAreAddress ;
SetPassToNoPass ;
BackPatchSubrangesAndOptParam ;
Total := CountQuads () ;
ForLoopAnalysis ; (* must be done before any optimization as the index variable increment quad might change *)
IF DisplayQuadruples
THEN
printf0 ('before any optimization\n') ;
DisplayQuadList
END ;
(* now is a suitable time to check for student errors as *)
(* we know all the front end symbols must be resolved. *)
IF StyleChecking
THEN
StudentVariableCheck
END ;
SetPassToCodeGeneration ;
SetFlagUnitAtATime (Optimizing) ;
StartGlobalContext ;
InitDeclarations ; (* default and fixed sized types are all declared from now on. *)
RemoveUnreachableCode ;
IF DisplayQuadruples
THEN
printf0 ('after dead procedure elimination\n') ;
DisplayQuadList
END ;
DetermineSubExpTemporaries ;
IF DisplayQuadruples
THEN
printf0 ('after identifying simple subexpression temporaries\n') ;
DisplayQuadList
END ;
qprintf0 (' symbols to gcc trees\n') ;
DoModuleDeclare ;
FlushWarnings ;
FlushErrors ;
qprintf0 (' statements to gcc trees\n') ;
DoCodeBlock ;
MarkExported (GetMainModule ()) ;
GenerateSwigFile (GetMainModule ()) ;
DebugLineNumbers (GetMainModule ()) ;
qprintf0 (' gcc trees given to the gcc backend\n') ;
EndGlobalContext ;
OptimizationAnalysis
END Code ;
(*
InitialDeclareAndCodeBlock - declares all objects within scope,
*)
PROCEDURE InitialDeclareAndOptimize (start, end: CARDINAL) ;
BEGIN
Count := CountQuads() ;
FreeBasicBlocks(InitBasicBlocksFromRange(start, end)) ;
BasicB := Count - CountQuads() ;
Count := CountQuads() ;
FoldBranches(start, end) ;
Jump := Count - CountQuads() ;
Count := CountQuads()
END InitialDeclareAndOptimize ;
(*
DeclareAndCodeBlock - declares all objects within scope,
*)
PROCEDURE SecondDeclareAndOptimize (start, end: CARDINAL) ;
BEGIN
REPEAT
FoldConstants(start, end) ;
DeltaConst := Count - CountQuads () ;
Count := CountQuads () ;
FreeBasicBlocks(InitBasicBlocksFromRange (start, end)) ;
DeltaBasicB := Count - CountQuads () ;
Count := CountQuads () ;
FreeBasicBlocks (InitBasicBlocksFromRange (start, end)) ;
FoldBranches(start, end) ;
DeltaJump := Count - CountQuads () ;
Count := CountQuads () ;
FreeBasicBlocks(InitBasicBlocksFromRange (start, end)) ;
INC (DeltaBasicB, Count - CountQuads ()) ;
Count := CountQuads () ;
(* now total the optimization components *)
INC (Proc, DeltaProc) ;
INC (Const, DeltaConst) ;
INC (Jump, DeltaJump) ;
INC (BasicB, DeltaBasicB)
UNTIL (OptimTimes>=MaxOptimTimes) OR
((DeltaProc=0) AND (DeltaConst=0) AND (DeltaJump=0) AND (DeltaBasicB=0)) ;
IF (DeltaProc#0) OR (DeltaConst#0) OR (DeltaJump#0) OR (DeltaBasicB#0)
THEN
printf0 ('optimization finished although more reduction may be possible (increase MaxOptimTimes)\n')
END
END SecondDeclareAndOptimize ;
(*
InitOptimizeVariables -
*)
PROCEDURE InitOptimizeVariables ;
BEGIN
Count := CountQuads () ;
OptimTimes := 0 ;
DeltaProc := 0 ;
DeltaConst := 0 ;
DeltaJump := 0 ;
DeltaBasicB := 0
END InitOptimizeVariables ;
(*
Init -
*)
PROCEDURE Init ;
BEGIN
Proc := 0 ;
Const := 0 ;
Jump := 0 ;
BasicB := 0
END Init ;
(*
BasicBlockVariableAnalysis -
*)
PROCEDURE BasicBlockVariableAnalysis (start, end: CARDINAL) ;
VAR
bb: BasicBlock ;
BEGIN
bb := InitBasicBlocksFromRange(start, end) ;
ForeachBasicBlockDo (bb, VariableAnalysis) ;
KillBasicBlocks (bb)
END BasicBlockVariableAnalysis ;
(*
DisplayQuadsInScope -
*)
(*
PROCEDURE DisplayQuadsInScope (sb: ScopeBlock) ;
BEGIN
printf0 ('Quads in scope\n') ;
ForeachScopeBlockDo (sb, DisplayQuadRange) ;
printf0 ('===============\n')
END DisplayQuadsInScope ;
*)
(*
OptimizeScopeBlock -
*)
PROCEDURE OptimizeScopeBlock (sb: ScopeBlock) ;
VAR
OptimTimes,
Previous,
Current : CARDINAL ;
BEGIN
InitOptimizeVariables ;
OptimTimes := 1 ;
Current := CountQuads () ;
ForeachScopeBlockDo (sb, InitialDeclareAndOptimize) ;
ForeachScopeBlockDo (sb, BasicBlockVariableAnalysis) ;
REPEAT
ForeachScopeBlockDo (sb, SecondDeclareAndOptimize) ;
Previous := Current ;
Current := CountQuads () ;
INC (OptimTimes)
UNTIL (OptimTimes=MaxOptimTimes) OR (Current=Previous) ;
ForeachScopeBlockDo (sb, LoopAnalysis)
END OptimizeScopeBlock ;
(*
DisplayQuadNumbers - the range, start..end.
*)
(*
PROCEDURE DisplayQuadNumbers (start, end: CARDINAL) ;
BEGIN
IF DisplayQuadruples
THEN
printf2 ('Coding [%d..%d]\n', start, end)
END
END DisplayQuadNumbers ;
*)
(*
CodeProceduresWithinBlock - codes the procedures within the module scope.
*)
PROCEDURE CodeProceduresWithinBlock (scope: CARDINAL) ;
BEGIN
ForeachProcedureDo (scope, CodeBlock)
END CodeProceduresWithinBlock ;
(*
CodeProcedures -
*)
PROCEDURE CodeProcedures (scope: CARDINAL) ;
BEGIN
IF IsDefImp (scope) OR IsModule (scope)
THEN
ForeachProcedureDo (scope, CodeBlock)
END
END CodeProcedures ;
(*
CodeBlock - generates all code for this block and also declares
all types and procedures for this block. It will
also optimize quadruples within this scope.
*)
PROCEDURE CodeBlock (scope: WORD) ;
VAR
sb: ScopeBlock ;
n : Name ;
BEGIN
IF DisplayQuadruples
THEN
n := GetSymName (scope) ;
printf1 ('before coding block %a\n', n)
END ;
sb := InitScopeBlock (scope) ;
OptimizeScopeBlock (sb) ;
IF IsProcedure (scope)
THEN
IF DisplayQuadruples
THEN
n := GetSymName(scope) ;
printf1('before coding procedure %a\n', n) ;
ForeachScopeBlockDo(sb, DisplayQuadRange) ;
printf0('===============\n')
END ;
ForeachScopeBlockDo(sb, ConvertQuadsToTree)
ELSIF IsModuleWithinProcedure(scope)
THEN
IF DisplayQuadruples
THEN
n := GetSymName(scope) ;
printf1('before coding module %a within procedure\n', n) ;
ForeachScopeBlockDo(sb, DisplayQuadRange) ;
printf0('===============\n')
END ;
ForeachScopeBlockDo(sb, ConvertQuadsToTree) ;
ForeachProcedureDo(scope, CodeBlock)
ELSE
IF DisplayQuadruples
THEN
n := GetSymName(scope) ;
printf1('before coding module %a\n', n) ;
ForeachScopeBlockDo(sb, DisplayQuadRange) ;
printf0('===============\n')
END ;
ForeachScopeBlockDo(sb, ConvertQuadsToTree) ;
IF WholeProgram
THEN
ForeachSourceModuleDo(CodeProcedures)
ELSE
ForeachProcedureDo(scope, CodeBlock)
END ;
ForeachInnerModuleDo(scope, CodeProceduresWithinBlock)
END ;
KillScopeBlock(sb)
END CodeBlock ;
BEGIN
Init
END M2Code.

View File

@@ -0,0 +1,142 @@
(* M2ColorString.def provides procedures for obtaining GCC color strings.
Copyright (C) 2019-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius@glam.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2ColorString ; (*!m2pim+gm2*)
(*
Title : M2ColorString
Author : Gaius Mulley
System : GNU Modula-2
Date : Sat Apr 13 19:21:03 2019
Revision : $Version$
Description: provides procedures for obtaining GCC color strings.
*)
FROM DynamicStrings IMPORT String ;
(*
SetEnableColor - sets the global variable to, b, and returns
the previous value.
*)
PROCEDURE SetEnableColor (b: BOOLEAN) : BOOLEAN ;
(*
quoteOpen - adds an open quote to string, s.
*)
PROCEDURE quoteOpen (s: String) : String ;
(*
quoteClose - adds a close quote to string, s.
*)
PROCEDURE quoteClose (s: String) : String ;
(*
endColor - stops using color.
*)
PROCEDURE endColor (s: String) : String ;
(*
quoteColor - adds quote color to string, s.
*)
PROCEDURE quoteColor (s: String) : String ;
(*
errorColor - adds error color to string, s.
*)
PROCEDURE errorColor (s: String) : String ;
(*
warningColor - adds warning color to string, s.
*)
PROCEDURE warningColor (s: String) : String ;
(*
noteColor - adds note color to string, s.
*)
PROCEDURE noteColor (s: String) : String ;
(*
locusColor - adds locus color to string, s.
*)
PROCEDURE locusColor (s: String) : String ;
(*
insertColor - adds fixit-insert color to string, s.
*)
PROCEDURE insertColor (s: String) : String ;
(*
deleteColor - adds fixit-insert color to string, s.
*)
PROCEDURE deleteColor (s: String) : String ;
(*
filenameColor - adds filename color to string, s.
*)
PROCEDURE filenameColor (s: String) : String ;
(*
typeColor - adds type color to string, s.
*)
PROCEDURE typeColor (s: String) : String ;
(*
range1Color - adds type color to string, s.
*)
PROCEDURE range1Color (s: String) : String ;
(*
range2Color - adds type color to string, s.
*)
PROCEDURE range2Color (s: String) : String ;
END M2ColorString.

View File

@@ -0,0 +1,218 @@
(* M2ColorString.mod provides procedures for obtaining GCC color strings.
Copyright (C) 2019-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius@glam.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2ColorString ;
FROM m2color IMPORT colorize_start, colorize_stop, open_quote, close_quote ;
FROM DynamicStrings IMPORT InitString, InitStringCharStar,
ConCat, ConCatChar, Mark, string, KillString,
Dup, char, Length, Mult ;
FROM StrLib IMPORT StrLen ;
FROM libc IMPORT printf ;
VAR
EnableColor: BOOLEAN ;
(*
SetEnableColor - sets the global variable to, b, and returns
the previous value.
*)
PROCEDURE SetEnableColor (b: BOOLEAN) : BOOLEAN ;
VAR
previous: BOOLEAN ;
BEGIN
previous := EnableColor ;
EnableColor := b ;
RETURN previous
END SetEnableColor ;
(*
append - appends color string, name, to the end of string, s,
and returns, s.
*)
PROCEDURE append (s: String; name: ARRAY OF CHAR) : String ;
VAR
c: String ;
BEGIN
c := InitStringCharStar (colorize_start (EnableColor, name, StrLen (name))) ;
s := ConCat (s, c) ;
c := KillString (c) ;
RETURN s
END append ;
(*
quoteOpen - adds an open quote to string, s.
*)
PROCEDURE quoteOpen (s: String) : String ;
BEGIN
RETURN ConCat (append (s, "quote"), Mark (InitStringCharStar (open_quote ())))
END quoteOpen ;
(*
quoteClose - adds a close quote to string, s.
*)
PROCEDURE quoteClose (s: String) : String ;
BEGIN
s := endColor (s) ;
s := append (s, "quote") ;
s := ConCat (s, Mark (InitStringCharStar (close_quote ()))) ;
s := endColor (s) ;
RETURN s
END quoteClose ;
(*
endColor - stops using color.
*)
PROCEDURE endColor (s: String) : String ;
VAR
c: String ;
BEGIN
c := InitStringCharStar (colorize_stop (EnableColor)) ;
s := ConCat (s, c) ;
c := KillString (c) ;
RETURN s
END endColor ;
(*
quoteColor - adds quote color to string, s.
*)
PROCEDURE quoteColor (s: String) : String ;
BEGIN
RETURN append (s, "quote")
END quoteColor ;
(*
errorColor - adds error color to string, s.
*)
PROCEDURE errorColor (s: String) : String ;
BEGIN
RETURN append (s, "error")
END errorColor ;
(*
warningColor - adds warning color to string, s.
*)
PROCEDURE warningColor (s: String) : String ;
BEGIN
RETURN append (s, "warning")
END warningColor ;
(*
noteColor - adds note color to string, s.
*)
PROCEDURE noteColor (s: String) : String ;
BEGIN
RETURN append (s, "note")
END noteColor ;
(*
locusColor - adds locus color to string, s.
*)
PROCEDURE locusColor (s: String) : String ;
BEGIN
RETURN append (s, "locus")
END locusColor ;
(*
insertColor - adds fixit-insert color to string, s.
*)
PROCEDURE insertColor (s: String) : String ;
BEGIN
RETURN append (s, "fixit-insert")
END insertColor ;
(*
deleteColor - adds fixit-insert color to string, s.
*)
PROCEDURE deleteColor (s: String) : String ;
BEGIN
RETURN append (s, "fixit-delete")
END deleteColor ;
(*
filenameColor - adds filename color to string, s.
*)
PROCEDURE filenameColor (s: String) : String ;
BEGIN
RETURN append (s, "diff-filename")
END filenameColor ;
(*
typeColor - adds type color to string, s.
*)
PROCEDURE typeColor (s: String) : String ;
BEGIN
RETURN append (s, "type")
END typeColor ;
(*
range1Color - adds type color to string, s.
*)
PROCEDURE range1Color (s: String) : String ;
BEGIN
RETURN append (s, "range1")
END range1Color ;
(*
range2Color - adds type color to string, s.
*)
PROCEDURE range2Color (s: String) : String ;
BEGIN
RETURN append (s, "range2")
END range2Color ;
BEGIN
EnableColor := TRUE
END M2ColorString.

View File

@@ -0,0 +1,70 @@
(* M2Comp.def continually calls the compiler for every source file.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2Comp ;
(*
Author : Gaius Mulley
Title : M2Comp
Date : 29/5/87
Description: Continually calls the compiler for every source file
referenced in the Modula-2 compiler.
*)
FROM SYSTEM IMPORT ADDRESS ;
EXPORT QUALIFIED CompilingDefinitionModule,
CompilingImplementationModule,
CompilingProgramModule,
compile ;
(*
compile - compile the filename.
*)
PROCEDURE compile (filename: ADDRESS) ;
(*
CompilingDefinitionModule - returns true if the current module being
compiled is a definition module.
*)
PROCEDURE CompilingDefinitionModule () : BOOLEAN ;
(*
CompilingImplementationModule - returns true if the current module being
compiled is an implementation module.
*)
PROCEDURE CompilingImplementationModule () : BOOLEAN ;
(*
CompilingProgramModule - returns true if the current module being
compiled is a program module.
*)
PROCEDURE CompilingProgramModule () : BOOLEAN ;
END M2Comp.

View File

@@ -0,0 +1,652 @@
(* M2Comp.mod continually calls the compiler for every source file.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2Comp ;
FROM M2Options IMPORT Statistics, Quiet, WholeProgram, ExtendedOpaque, GenModuleList ;
FROM M2Pass IMPORT SetPassToPass0, SetPassToPass1, SetPassToPass2, SetPassToPassC, SetPassToPass3,
SetPassToNoPass, SetPassToPassHidden ;
FROM M2Reserved IMPORT toktype ;
FROM M2Search IMPORT FindSourceDefFile, FindSourceModFile ;
FROM M2Code IMPORT Code ;
FROM M2LexBuf IMPORT OpenSource, CloseSource, ResetForNewPass, currenttoken, GetToken, ReInitialize, currentstring, GetTokenNo ;
FROM M2FileName IMPORT CalculateFileName ;
FROM M2Preprocess IMPORT PreprocessModule ;
FROM libc IMPORT exit ;
FROM M2Error IMPORT ErrorStringAt, ErrorStringAt2, ErrorStringsAt2,
WriteFormat0, FlushErrors, FlushWarnings, ResetErrorScope ;
FROM M2MetaError IMPORT MetaErrorString1, MetaError0, MetaError1 ;
FROM FormatStrings IMPORT Sprintf1 ;
FROM P0SymBuild IMPORT P0Init, P1Init ;
IMPORT m2flex ;
IMPORT P0SyntaxCheck ;
IMPORT P1Build ;
IMPORT P2Build ;
IMPORT PCBuild ;
IMPORT P3Build ;
IMPORT PHBuild ;
IMPORT PCSymBuild ;
FROM M2Batch IMPORT GetSource, GetModuleNo, GetDefinitionModuleFile, GetModuleFile,
AssociateModule, AssociateDefinition, MakeImplementationSource,
MakeProgramSource ;
FROM SymbolTable IMPORT GetSymName, IsDefImp, NulSym,
IsHiddenTypeDeclared, GetFirstUsed, GetMainModule, SetMainModule,
ResolveConstructorTypes, SanityCheckConstants, IsDefinitionForC,
IsBuiltinInModule, PutModLink, IsDefLink, IsModLink ;
FROM FIO IMPORT StdErr ;
FROM NameKey IMPORT Name, GetKey, KeyToCharStar, makekey ;
FROM M2Printf IMPORT fprintf1 ;
FROM M2Quiet IMPORT qprintf0, qprintf1, qprintf2 ;
FROM DynamicStrings IMPORT String, InitString, KillString, InitStringCharStar, Dup, Mark, string ;
CONST
Debugging = FALSE ;
VAR
ModuleType : (None, Definition, Implementation, Program) ;
(*
CompilingDefinitionModule - returns true if the current module being
compiled is a definition module.
*)
PROCEDURE CompilingDefinitionModule() : BOOLEAN ;
BEGIN
RETURN( ModuleType=Definition )
END CompilingDefinitionModule ;
(*
CompilingImplementationModule - returns true if the current module being
compiled is an implementation module.
*)
PROCEDURE CompilingImplementationModule() : BOOLEAN ;
BEGIN
RETURN( ModuleType=Implementation )
END CompilingImplementationModule ;
(*
CompilingProgramModule - returns true if the current module being
compiled is a program module.
*)
PROCEDURE CompilingProgramModule() : BOOLEAN ;
BEGIN
RETURN( ModuleType=Program )
END CompilingProgramModule ;
(*
NeedToParseImplementation -
*)
PROCEDURE NeedToParseImplementation (sym: CARDINAL) : BOOLEAN ;
BEGIN
RETURN (IsDefImp(sym) AND IsHiddenTypeDeclared(sym) AND ExtendedOpaque) OR
(IsDefImp(sym) AND IsBuiltinInModule(sym)) OR
(WholeProgram AND (NOT IsDefinitionForC(sym)))
END NeedToParseImplementation ;
(*
Compile - compile file, s, using a 5 pass technique.
*)
PROCEDURE Compile (s: String) ;
BEGIN
DoPass0(s) ;
FlushWarnings ; FlushErrors ;
ResetForNewPass ; ResetErrorScope ;
qprintf0('Pass 1: scopes, enumerated types, imports and exports\n') ;
DoPass1 ;
FlushWarnings ; FlushErrors ;
qprintf0('Pass 2: constants and types\n') ;
ResetForNewPass ; ResetErrorScope ;
DoPass2 ;
FlushWarnings ; FlushErrors ;
qprintf0('Pass C: aggregate constants\n') ;
ResetForNewPass ; ResetErrorScope ;
DoPassC ;
FlushWarnings ; FlushErrors ;
qprintf0('Pass 3: quadruple generation\n') ;
ResetForNewPass ; ResetErrorScope ;
DoPass3 ;
FlushWarnings ; FlushErrors ;
qprintf0('Pass 4: gcc tree generation\n') ;
Code ;
FlushWarnings ; FlushErrors
END Compile ;
(*
compile - compile the filename.
*)
PROCEDURE compile (filename: ADDRESS) ;
VAR
f: String ;
BEGIN
f := InitStringCharStar(filename) ;
Compile(f) ;
f := KillString(f) ;
END compile ;
(*
ExamineCompilationUnit - opens the source file to obtain the module name and kind of module.
*)
PROCEDURE ExamineCompilationUnit (VAR name: ADDRESS; VAR isdefimp: BOOLEAN) ;
BEGIN
isdefimp := FALSE ; (* default to program module *)
(* stop if we see eof, ';' or '[' *)
WHILE (currenttoken#eoftok) AND (currenttoken#semicolontok) AND (currenttoken#lsbratok) DO
IF (currenttoken=implementationtok) OR (currenttoken=definitiontok)
THEN
isdefimp := TRUE ;
GetToken
END ;
IF currenttoken=identtok
THEN
name := currentstring ;
RETURN
END ;
GetToken
END ;
m2flex.M2Error(string(InitString('failed to find module name'))) ;
exit(1)
END ExamineCompilationUnit ;
(*
PeepInto - peeps into source, s, and initializes a definition/implementation or
program module accordingly.
*)
PROCEDURE PeepInto (s: String) ;
VAR
name : ADDRESS ;
isdefimp: BOOLEAN ;
BEGIN
IF OpenSource(PreprocessModule(s))
THEN
ExamineCompilationUnit(name, isdefimp) ;
IF isdefimp
THEN
SetMainModule(MakeImplementationSource(GetTokenNo(), makekey(name)))
ELSE
SetMainModule(MakeProgramSource(GetTokenNo(), makekey(name)))
END ;
CloseSource ;
ReInitialize
ELSE
fprintf1(StdErr, 'failed to open %s\n', s) ;
exit(1)
END
END PeepInto ;
(*
DoPass0 -
*)
PROCEDURE DoPass0 (s: String) ;
VAR
Main,
Sym : CARDINAL ;
i : CARDINAL ;
SymName,
FileName: String ;
BEGIN
P0Init ;
SetPassToPass0 ;
PeepInto(s) ;
Main := GetMainModule() ;
i := 1 ;
Sym := GetModuleNo(i) ;
qprintf1('Compiling: %s\n', s) ;
qprintf0('Pass 0: lexical analysis, parsing, modules and associated filenames\n') ;
WHILE Sym#NulSym DO
SymName := InitStringCharStar(KeyToCharStar(GetSymName(Sym))) ;
IF IsDefImp(Sym)
THEN
IF FindSourceDefFile(SymName, FileName)
THEN
ModuleType := Definition ;
IF OpenSource(AssociateDefinition(PreprocessModule(FileName), Sym))
THEN
IF NOT P0SyntaxCheck.CompilationUnit()
THEN
WriteFormat0('compilation failed') ;
CloseSource ;
RETURN
END ;
qprintf2 (' Module %-20s : %s', SymName, FileName) ;
IF IsDefinitionForC (Sym)
THEN
qprintf0 (' (for C)')
END ;
IF IsDefLink (Sym)
THEN
qprintf0 (' (linking)')
END ;
qprintf0 ('\n') ;
CloseSource
ELSE
(* Unrecoverable error. *)
MetaErrorString1 (Sprintf1 (InitString ('file {%%1EUAF%s} containing module {%%1a} cannot be found'),
FileName), Sym)
END
ELSE
(* Unrecoverable error. *)
MetaError1 ('the file containing the definition module {%1EMAa} cannot be found', Sym)
END ;
ModuleType := Implementation
ELSE
ModuleType := Program
END ;
IF (Main=Sym) OR NeedToParseImplementation(Sym)
THEN
(* only need to read implementation module if hidden types are declared or it is the main module *)
IF Main=Sym
THEN
FileName := Dup(s)
ELSE
IF FindSourceModFile (SymName, FileName)
THEN
END
END ;
IF FileName#NIL
THEN
IF OpenSource (AssociateModule (PreprocessModule (FileName), Sym))
THEN
IF NOT P0SyntaxCheck.CompilationUnit()
THEN
WriteFormat0 ('compilation failed') ;
CloseSource ;
RETURN
END ;
qprintf2 (' Module %-20s : %s', SymName, FileName) ;
IF IsModLink (Sym)
THEN
qprintf0 (' (linking)')
END ;
qprintf0 ('\n') ;
CloseSource
ELSE
(* It is quite legitimate to implement a module in C (and pretend it was a M2
implementation) providing that it is not the main program module and the
definition module do not declare a hidden type when -fextended-opaque
is used. *)
IF (NOT WholeProgram) OR (Sym=Main) OR IsHiddenTypeDeclared(Sym)
THEN
(* Unrecoverable error. *)
MetaErrorString1 (Sprintf1 (InitString ('file {%%1EUAF%s} containing module {%%1a} cannot be found'),
FileName), Sym) ;
END
END
END
ELSIF GenModuleList
THEN
IF NOT IsDefinitionForC (Sym)
THEN
(* The implementation is only useful if -fgen-module-list= is
used and we do not insist upon it. *)
IF FindSourceModFile (SymName, FileName)
THEN
qprintf2 (' Module %-20s : %s (linking)\n', SymName, FileName) ;
IF OpenSource (AssociateModule (PreprocessModule (FileName), Sym))
THEN
PutModLink (Sym, TRUE) ; (* This source is only used to determine link time info. *)
IF NOT P0SyntaxCheck.CompilationUnit ()
THEN
WriteFormat0 ('compilation failed') ;
CloseSource ;
RETURN
END ;
CloseSource
END
END
END
END ;
SymName := KillString (SymName) ;
FileName := KillString (FileName) ;
INC (i) ;
Sym := GetModuleNo (i)
END ;
SetPassToNoPass
END DoPass0 ;
(*
DoPass1 - parses the sources of all modules necessary to compile
the required module, Main.
*)
PROCEDURE DoPass1 ;
VAR
name : Name ;
Sym : CARDINAL ;
i : CARDINAL ;
FileName: String ;
BEGIN
P1Init ;
SetPassToPass1 ;
i := 1 ;
Sym := GetModuleNo(i) ;
WHILE Sym#NulSym DO
FileName := GetDefinitionModuleFile(Sym) ;
IF FileName#NIL
THEN
IF Debugging
THEN
name := GetSymName(Sym) ;
qprintf1(' Module %a\n', name)
END ;
IF OpenSource(FileName)
THEN
ModuleType := Definition ;
IF NOT P1Build.CompilationUnit()
THEN
MetaError0('compilation failed') ;
CloseSource ;
RETURN
END ;
CloseSource
ELSE
fprintf1(StdErr, 'failed to open %s\n', FileName) ;
exit(1)
END ;
ModuleType := Implementation
ELSE
ModuleType := Program
END ;
FileName := GetModuleFile(Sym) ;
IF FileName#NIL
THEN
IF Debugging
THEN
name := GetSymName(Sym) ;
qprintf1(' Module %a\n', name)
END ;
IF OpenSource(FileName)
THEN
IF NOT P1Build.CompilationUnit()
THEN
MetaError0('compilation failed') ;
CloseSource ;
RETURN
END ;
CloseSource
ELSE
fprintf1(StdErr, 'failed to open %s\n', FileName) ;
exit(1)
END
END ;
INC(i) ;
Sym := GetModuleNo(i)
END ;
SetPassToNoPass
END DoPass1 ;
(*
DoPass2 - parses the sources of all modules necessary to compile
the required module, Main.
*)
PROCEDURE DoPass2 ;
VAR
name : Name ;
Sym : CARDINAL ;
i : CARDINAL ;
FileName: String ;
BEGIN
SetPassToPass2 ;
i := 1 ;
Sym := GetModuleNo(i) ;
WHILE Sym#NulSym DO
FileName := GetDefinitionModuleFile(Sym) ;
IF FileName#NIL
THEN
IF Debugging
THEN
name := GetSymName(Sym) ;
qprintf1(' Module %a\n', name)
END ;
IF OpenSource(FileName)
THEN
ModuleType := Definition ;
IF NOT P2Build.CompilationUnit()
THEN
MetaError0('compilation failed') ;
CloseSource ;
RETURN
END ;
CloseSource
ELSE
fprintf1(StdErr, 'failed to open %s\n', FileName) ;
exit(1)
END ;
ModuleType := Implementation
ELSE
ModuleType := Program
END ;
FileName := GetModuleFile(Sym) ;
IF FileName#NIL
THEN
IF Debugging
THEN
name := GetSymName(Sym) ;
qprintf1(' Module %a\n', name)
END ;
IF OpenSource(FileName)
THEN
IF NOT P2Build.CompilationUnit()
THEN
MetaError0('compilation failed') ;
CloseSource ;
RETURN
END ;
CloseSource
ELSE
fprintf1(StdErr, 'failed to open %s\n', FileName) ;
exit(1)
END
END ;
INC(i) ;
Sym := GetModuleNo(i)
END ;
SetPassToNoPass
END DoPass2 ;
(*
DoPassC - parses the sources of all modules necessary to compile
the required module, Main.
*)
PROCEDURE DoPassC ;
VAR
name : Name ;
Sym : CARDINAL ;
i : CARDINAL ;
FileName: String ;
BEGIN
SetPassToPassC ;
i := 1 ;
Sym := GetModuleNo(i) ;
WHILE Sym#NulSym DO
FileName := GetDefinitionModuleFile(Sym) ;
IF FileName#NIL
THEN
IF Debugging
THEN
name := GetSymName(Sym) ;
qprintf1(' Module %a\n', name)
END ;
IF OpenSource(FileName)
THEN
ModuleType := Definition ;
IF NOT PCBuild.CompilationUnit()
THEN
MetaError0('compilation failed') ;
CloseSource ;
RETURN
END ;
CloseSource
ELSE
fprintf1(StdErr, 'failed to open %s\n', FileName) ;
exit(1)
END ;
ModuleType := Implementation
ELSE
ModuleType := Program
END ;
FileName := GetModuleFile(Sym) ;
IF FileName#NIL
THEN
IF Debugging
THEN
name := GetSymName(Sym) ;
qprintf1(' Module %a\n', name)
END ;
IF OpenSource(FileName)
THEN
IF NOT PCBuild.CompilationUnit()
THEN
MetaError0('compilation failed') ;
CloseSource ;
RETURN
END ;
CloseSource
ELSE
fprintf1(StdErr, 'failed to open %s\n', FileName) ;
exit(1)
END
END ;
INC(i) ;
Sym := GetModuleNo(i)
END ;
PCSymBuild.ResolveConstTypes ;
ResolveConstructorTypes ;
SanityCheckConstants ;
SetPassToNoPass
END DoPassC ;
(*
DoPass3 - parses the sources of all modules necessary to compile
the required module, Main.
*)
PROCEDURE DoPass3 ;
VAR
Main,
Sym : CARDINAL ;
i : CARDINAL ;
FileName: String ;
BEGIN
SetPassToPass3 ;
Main := GetMainModule() ;
i := 1 ;
Sym := GetModuleNo(i) ;
WHILE Sym#NulSym DO
FileName := GetDefinitionModuleFile(Sym) ;
IF FileName#NIL
THEN
IF OpenSource(FileName)
THEN
ModuleType := Definition ;
IF NOT P3Build.CompilationUnit()
THEN
MetaError0('compilation failed') ;
CloseSource ;
RETURN
END ;
CloseSource
ELSE
fprintf1(StdErr, 'failed to open %s\n', FileName) ;
exit(1)
END ;
ModuleType := Implementation
ELSE
ModuleType := Program
END ;
FileName := GetModuleFile(Sym) ;
IF FileName#NIL
THEN
IF OpenSource(FileName)
THEN
IF (Main=Sym) OR WholeProgram
THEN
IF NOT P3Build.CompilationUnit()
THEN
MetaError0('compilation failed') ;
CloseSource ;
RETURN
END
ELSE
(*
not the main module .mod therefore must be implementing
a hidden type - we dont want to generate any
StatementSequence quadrupes but we do want to build TYPEs
and ConstExpressions.
*)
SetPassToNoPass ;
SetPassToPassHidden ;
IF NOT PHBuild.CompilationUnit()
THEN
MetaError0('compilation failed') ;
CloseSource ;
RETURN
END ;
SetPassToNoPass ;
SetPassToPass3
END ;
CloseSource
ELSE
fprintf1(StdErr, 'failed to open %s\n', FileName) ;
exit(1)
END
END ;
INC(i) ;
Sym := GetModuleNo(i)
END ;
SetPassToNoPass
END DoPass3 ;
BEGIN
ModuleType := None
END M2Comp.

View File

@@ -0,0 +1,39 @@
(* M2Const.def maintain and resolve the types of constants.
Copyright (C) 2010-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2Const ;
(*
Title : M2Const
Author : Gaius Mulley
System : GNU Modula-2
Date : Thu Dec 23 15:02:59 2010
Revision : $Version$
Description: provides a module which maintains and resolves the types of constants.
*)
EXPORT QUALIFIED constType ;
TYPE
constType = (unknown, set, str, constructor, array, cast, boolean, ztype, rtype, ctype, procedure, char) ;
END M2Const.

View File

@@ -0,0 +1,501 @@
(* M2Const.mod maintain and resolve the types of constants.
Copyright (C) 2010-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2Const ;
(*
CONST
Debugging = FALSE ;
DebugConsts = FALSE ;
TYPE
constList = POINTER TO cList ;
cList = RECORD
constsym : CARDINAL ;
constmeta: constType ;
expr : CARDINAL ;
type : CARDINAL ;
next : constList ;
END ;
VAR
headOfConsts: constList ;
PROCEDURE stop ; BEGIN END stop ;
(*
addToConstList - add a constant, sym, to the head of the constants list.
*)
PROCEDURE addToConstList (sym: CARDINAL) ;
VAR
h: constList ;
BEGIN
h := headOfConsts ;
WHILE h#NIL DO
IF h^.constsym=sym
THEN
InternalError ('should never see the same symbol id declared twice')
END ;
h := h^.next
END ;
NEW(h) ;
WITH h^ DO
constsym := sym ;
constmeta := unknown ;
expr := NulSym ;
type := NulSym ;
next := headOfConsts
END ;
headOfConsts := h
END addToConstList ;
(*
FixupConstAsString - fixes up a constant, sym, which will have the string type.
*)
PROCEDURE FixupConstAsString (sym: CARDINAL) ;
BEGIN
fixupConstMeta(sym, str)
END FixupConstAsString ;
(*
FixupConstType - fixes up a constant, sym, which will have the type, consttype.
*)
PROCEDURE FixupConstType (sym: CARDINAL; consttype: CARDINAL) ;
VAR
h: constList ;
BEGIN
h := headOfConsts ;
WHILE h#NIL DO
WITH h^ DO
IF constsym=sym
THEN
IF constmeta=str
THEN
InternalError ('cannot fix up a constant to have a type if it is already known as a string')
END ;
type := consttype ;
PutConst(sym, consttype) ;
RETURN
END
END ;
h := h^.next
END
END FixupConstType ;
(*
FixupProcedureType - creates a proctype from a procedure.
*)
PROCEDURE FixupProcedureType (p: CARDINAL) : CARDINAL ;
VAR
par,
t : CARDINAL ;
n, i: CARDINAL ;
BEGIN
IF IsProcedure(p)
THEN
t := MakeProcType(CheckAnonymous(NulName)) ;
i := 1 ;
n := NoOfParam(p) ;
WHILE i<=n DO
par := GetParam(p, i) ;
IF IsParameterVar(par)
THEN
PutProcTypeVarParam(t, GetType(par), IsParameterUnbounded(par))
ELSE
PutProcTypeParam(t, GetType(par), IsParameterUnbounded(par))
END ;
INC(i)
END ;
IF GetType(p)#NulSym
THEN
PutFunction(t, GetType(p))
END ;
RETURN( t )
ELSE
InternalError ('expecting a procedure')
END ;
RETURN( NulSym )
END FixupProcedureType ;
(*
FixupConstProcedure - fixes up a constant, sym, which will be equivalent to e.
*)
PROCEDURE FixupConstProcedure (sym: CARDINAL; e: CARDINAL) ;
VAR
h: constList ;
BEGIN
h := headOfConsts ;
WHILE h#NIL DO
WITH h^ DO
IF constsym=sym
THEN
expr := e ;
type := FixupProcedureType(e) ;
PutConst(sym, type) ;
RETURN
END
END ;
h := h^.next
END
END FixupConstProcedure ;
(*
FixupConstExpr - fixes up a constant, sym, which will be equivalent to e.
*)
PROCEDURE FixupConstExpr (sym: CARDINAL; e: CARDINAL) ;
VAR
h: constList ;
BEGIN
h := headOfConsts ;
WHILE h#NIL DO
WITH h^ DO
IF constsym=sym
THEN
expr := e ;
RETURN
END
END ;
h := h^.next
END
END FixupConstExpr ;
(*
fixupConstMeta - fixes up symbol, sym, to have the, meta, constType.
*)
PROCEDURE FixupConstMeta (sym: CARDINAL; meta: constType) ;
VAR
h: constList ;
BEGIN
h := headOfConsts ;
WHILE h#NIL DO
WITH h^ DO
IF constsym=sym
THEN
constmeta := meta ;
RETURN
END
END ;
h := h^.next
END
END FixupConstMeta ;
(*
fixupConstCast -
*)
PROCEDURE fixupConstCast (sym: CARDINAL; castType: CARDINAL) ;
VAR
h: constList ;
BEGIN
h := headOfConsts ;
WHILE h#NIL DO
WITH h^ DO
IF constsym=sym
THEN
type := castType ;
RETURN
END
END ;
h := h^.next
END
END fixupConstCast ;
(*
findConstType -
*)
PROCEDURE findConstType (sym: CARDINAL) : CARDINAL ;
VAR
h: constList ;
t: CARDINAL ;
BEGIN
h := headOfConsts ;
WHILE h#NIL DO
WITH h^ DO
IF constsym=sym
THEN
t := GetType(sym) ;
IF t=NulSym
THEN
RETURN( NulSym )
ELSE
RETURN( t )
END
END
END ;
h := h^.next
END ;
RETURN( NulSym )
END findConstType ;
(*
findConstMeta -
*)
PROCEDURE findConstMeta (sym: CARDINAL) : constType ;
VAR
h: constList ;
BEGIN
h := headOfConsts ;
WHILE h#NIL DO
WITH h^ DO
IF constsym=sym
THEN
RETURN( constmeta )
END
END ;
h := h^.next
END ;
RETURN( unknown )
END findConstMeta ;
(*
ReportUnresolvedConstTypes - emits an error message for any unresolved constant type.
*)
PROCEDURE ReportUnresolvedConstTypes ;
VAR
h: constList ;
BEGIN
h := headOfConsts ;
WHILE h#NIL DO
WITH h^ DO
IF (constmeta#unknown) AND (constmeta#str) AND (type=NulSym)
THEN
MetaError1('unable to resolve the type of the constant {%1Dad}', h^.constsym)
END
END ;
h := h^.next
END
END ReportUnresolvedConstTypes ;
(*
DebugMeta -
*)
PROCEDURE DebugMeta (h: constList) ;
VAR
n: Name ;
BEGIN
IF DebugConsts
THEN
WITH h^ DO
n := GetSymName(constsym) ;
printf1('constant %a ', n) ;
IF type=NulSym
THEN
printf0('type is unknown\n')
ELSE
printf0('type is known\n')
END
END
END
END DebugMeta ;
(*
constTypeResolved -
*)
PROCEDURE constTypeResolved (h: constList) : BOOLEAN ;
BEGIN
RETURN( h^.type#NulSym )
END constTypeResolved ;
(*
constExprResolved -
*)
PROCEDURE constExprResolved (h: constList) : BOOLEAN ;
BEGIN
RETURN( h^.expr#NulSym )
END constExprResolved ;
(*
findConstMetaExpr -
*)
PROCEDURE findConstMetaExpr (h: constList) : constType ;
BEGIN
RETURN( h^.constmeta )
END findConstMetaExpr ;
(*
constResolveViaMeta -
*)
PROCEDURE constResolveViaMeta (h: constList) : BOOLEAN ;
VAR
n: Name ;
BEGIN
WITH h^ DO
IF findConstMetaExpr(h)=str
THEN
PutConstString(constsym, MakeKey('')) ;
IF DebugConsts
THEN
n := GetSymName(constsym) ;
printf1('resolved constant %a as a string\n', n)
END ;
RETURN( TRUE )
END
END ;
RETURN( FALSE )
END constResolveViaMeta ;
(*
constResolvedViaType -
*)
PROCEDURE constResolvedViaType (h: constList) : BOOLEAN ;
VAR
n: Name ;
BEGIN
WITH h^ DO
type := findConstType(expr) ;
IF type#NulSym
THEN
PutConst(constsym, type) ;
IF DebugConsts
THEN
n := GetSymName(constsym) ;
printf1('resolved type of constant %a\n', n)
END ;
RETURN( TRUE )
END
END ;
RETURN( FALSE )
END constResolvedViaType ;
(*
resolveConstType -
*)
PROCEDURE resolveConstType (h: constList) : BOOLEAN ;
BEGIN
WITH h^ DO
IF (constmeta=unknown) OR (constmeta=str)
THEN
(* do nothing *)
ELSE
DebugMeta(h) ;
IF constTypeResolved(h)
THEN
(* nothing to do *)
ELSE
IF constExprResolved(h)
THEN
IF constResolveViaMeta(h)
THEN
RETURN( TRUE )
ELSIF constResolvedViaType(h)
THEN
RETURN( TRUE )
END
END
END
END
END ;
RETURN( FALSE )
END resolveConstType ;
(*
ResolveConstTypes - resolves the types of all aggegrate constants.
*)
PROCEDURE ResolveConstTypes ;
VAR
h : constList ;
changed: BOOLEAN ;
BEGIN
REPEAT
changed := FALSE ;
h := headOfConsts ;
WHILE h#NIL DO
changed := resolveConstType(h) ;
h := h^.next
END
UNTIL NOT changed ;
ReportUnresolvedConstTypes
END ResolveConstTypes ;
(*
SkipConst - returns the symbol which is a pseudonum of, sym.
*)
PROCEDURE SkipConst (sym: CARDINAL) : CARDINAL ;
VAR
init: CARDINAL ;
h : constList ;
BEGIN
init := sym ;
h := headOfConsts ;
WHILE h#NIL DO
IF (h^.constsym=sym) AND (h^.expr#NulSym)
THEN
sym := h^.expr ;
IF sym=init
THEN
(* circular definition found *)
RETURN( sym )
END ;
h := headOfConsts
ELSE
h := h^.next
END
END ;
RETURN( sym )
END SkipConst ;
BEGIN
headOfConsts := NIL
*)
BEGIN
END M2Const.

View File

@@ -0,0 +1,49 @@
(* M2Debug.def simple debugging facilities in the Modula-2 compiler.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2Debug ;
(*
Author : Gaius Mulley
Title : M2Debug
Date : 30/5/87
Description: Implements the Debugging facilities in the Modula-2 compiler.
Last update: 30/5/87
*)
EXPORT QUALIFIED Assert, WriteDebug ;
(*
Assert - tests the boolean, q. If false then an error is reported
and the execution is HALTed.
*)
PROCEDURE Assert (q: BOOLEAN) ;
(*
WriteDebug - only writes a string if the debugging mode is on.
*)
PROCEDURE WriteDebug (a: ARRAY OF CHAR) ;
END M2Debug.

View File

@@ -0,0 +1,57 @@
(* M2Debug.mod simple debugging facilities in the Modula-2 compiler.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2Debug ;
FROM StrIO IMPORT WriteString, WriteLn ;
FROM M2Error IMPORT InternalError ;
FROM M2Options IMPORT CompilerDebugging ;
(*
Assert - tests the boolean, q. If false then an error is reported
and the execution is HALTed.
*)
PROCEDURE Assert (q: BOOLEAN) ;
BEGIN
IF NOT q
THEN
InternalError ('assert failed')
END
END Assert ;
(*
WriteDebug - only writes a string if the debugging mode is on.
*)
PROCEDURE WriteDebug (a: ARRAY OF CHAR) ;
BEGIN
IF CompilerDebugging
THEN
WriteString(a) ; WriteLn
END
END WriteDebug ;
END M2Debug.

View File

@@ -0,0 +1,51 @@
(* M2DebugStack.def display parameter stack.
Copyright (C) 2011-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2DebugStack ;
(*
Title : M2DebugStack
Author : Gaius Mulley
System : GNU Modula-2
Date : Mon Dec 5 16:19:43 2011
Revision : $Version$
Description: provides a procedure which displays the
compile time stack neatly and with annotation.
*)
FROM SYSTEM IMPORT WORD ;
FROM DynamicStrings IMPORT String ;
TYPE
ProcedureWord = PROCEDURE (CARDINAL) : WORD ;
ProcedureString = PROCEDURE (CARDINAL) : String ;
(*
DebugStack - displays the stack.
*)
PROCEDURE DebugStack (amount: CARDINAL;
opt, opf, opa, opd, oprw, optk: ProcedureWord;
opanno: ProcedureString) ;
END M2DebugStack.

View File

@@ -0,0 +1,884 @@
(* M2DebugStack.mod display parameter stack.
Copyright (C) 2011-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2DebugStack ;
FROM DynamicStrings IMPORT InitString, KillString, Dup, Index, Slice, char,
ConCat, ConCatChar, InitStringCharStar, Length, Mark ;
FROM SymbolTable IMPORT IsConstLit, IsConstSet, IsConstructor, IsConst,
IsArray, IsVar, IsEnumeration, IsFieldEnumeration,
IsUnbounded, IsProcType, IsProcedure, IsPointer, IsParameter,
IsParameterVar, IsType, IsRecord, IsRecordField, IsVarient,
IsModule, IsDefImp, IsSet, IsSubrange, GetSymName, NulSym ;
FROM StringConvert IMPORT CardinalToString ;
FROM NameKey IMPORT Name, KeyToCharStar ;
FROM FIO IMPORT File, StdOut ;
FROM SFIO IMPORT WriteS ;
FROM M2Error IMPORT InternalError ;
FROM M2Printf IMPORT printf0, printf1, printf2, printf3, printf4 ;
CONST
Debugging = FALSE ;
VAR
OperandTok,
OperandT,
OperandF,
OperandA,
OperandD,
OperandRW : ProcedureWord ;
OperandAnno: ProcedureString ;
(*
x - checks to see that a=b.
*)
PROCEDURE x (a, b: String) : String ;
BEGIN
IF a#b
THEN
InternalError ('different string returned')
END ;
RETURN( a )
END x ;
(*
IsWhite - returns TRUE if, ch, is a space.
*)
PROCEDURE IsWhite (ch: CHAR) : BOOLEAN ;
BEGIN
RETURN( ch=' ' )
END IsWhite ;
(*
ConCatWord - joins sentances, a, b, together.
*)
PROCEDURE ConCatWord (a, b: String) : String ;
BEGIN
IF (Length(a)=1) AND (char(a, 0)='a')
THEN
a := x(a, ConCatChar(a, 'n'))
ELSIF (Length(a)>1) AND (char(a, -1)='a') AND IsWhite(char(a, -2))
THEN
a := x(a, ConCatChar(a, 'n'))
END ;
IF (Length(a)>0) AND (NOT IsWhite(char(a, -1)))
THEN
a := x(a, ConCatChar(a, ' '))
END ;
RETURN( x(a, ConCat(a, b)) )
END ConCatWord ;
(*
symDesc -
*)
PROCEDURE symDesc (sym: CARDINAL; o: String) : String ;
BEGIN
IF sym = NulSym
THEN
RETURN( ConCatWord(o, Mark(InitString('NulSym'))) )
ELSIF IsConstLit(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('constant literal'))) )
ELSIF IsConstSet(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('constant set'))) )
ELSIF IsConstructor(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('constructor'))) )
ELSIF IsConst(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('constant'))) )
ELSIF IsArray(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('array'))) )
ELSIF IsVar(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('variable'))) )
ELSIF IsEnumeration(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('enumeration type'))) )
ELSIF IsFieldEnumeration(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('enumeration field'))) )
ELSIF IsUnbounded(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('unbounded parameter'))) )
ELSIF IsProcType(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('procedure type'))) )
ELSIF IsProcedure(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('procedure'))) )
ELSIF IsPointer(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('pointer'))) )
ELSIF IsParameter(sym)
THEN
IF IsParameterVar(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('var parameter'))) )
ELSE
RETURN( ConCatWord(o, Mark(InitString('parameter'))) )
END
ELSIF IsType(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('type'))) )
ELSIF IsRecord(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('record'))) )
ELSIF IsRecordField(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('record field'))) )
ELSIF IsVarient(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('varient record'))) )
ELSIF IsModule(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('module'))) )
ELSIF IsDefImp(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('definition or implementation module'))) )
ELSIF IsSet(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('set'))) )
ELSIF IsSubrange(sym)
THEN
RETURN( ConCatWord(o, Mark(InitString('subrange'))) )
ELSE
RETURN( o )
END
END symDesc ;
(*
Output - output string, s, to Stdout. It also disposes of the string, s.
*)
PROCEDURE Output (s: String) ;
BEGIN
s := WriteS(StdOut, s) ;
s := KillString(s)
END Output ;
(*
GetComment -
*)
PROCEDURE GetComment (s: String) : INTEGER ;
VAR
c: INTEGER ;
BEGIN
c := Index(s, '|', 0) ;
WHILE c>=0 DO
INC(c) ;
IF c>=VAL(INTEGER, Length(s))
THEN
RETURN -1
ELSIF char(s, c)='|'
THEN
RETURN c+1
END ;
c := Index(s, '|', c)
END ;
RETURN -1
END GetComment ;
(*
doName - concatenate namekey, o, to, p.
*)
PROCEDURE doName (p: String; o: WORD) : String ;
BEGIN
RETURN ConCat(p, InitStringCharStar(KeyToCharStar(o))) ;
END doName ;
(*
doSymName - concatenate symbol, o, name to, p.
*)
PROCEDURE doSymName (p: String; o: WORD) : String ;
BEGIN
RETURN ConCat(p, InitStringCharStar(KeyToCharStar(GetSymName(o)))) ;
END doSymName ;
(*
doNumber - convert, o, to a cardinal and increment the length, l,
by the number of characters required to represent, o.
*)
PROCEDURE doNumber (p: String; o: WORD) : String ;
BEGIN
RETURN ConCat(p, CardinalToString(VAL(CARDINAL, o), 0, ' ', 10, TRUE))
END doNumber ;
(*
doSymbol - handles a symbol indicated by, o.
*)
PROCEDURE doSymbol (p: String; o: WORD) : String ;
BEGIN
RETURN symDesc(o, p)
END doSymbol ;
(*
doOperand -
*)
PROCEDURE doOperand (p, s: String; VAR i: INTEGER; e: INTEGER; o: WORD) : String ;
BEGIN
INC(i) ;
IF i<e
THEN
CASE char(s, i) OF
's': (* symbol number *)
INC(i) ;
RETURN doSymbol(p, o) |
'd': (* decimal number *)
INC(i) ;
RETURN doNumber(p, o) |
'a': (* symbol name key *)
INC(i) ;
RETURN doSymName(p, o) |
'n': (* ascii name key *)
INC(i) ;
RETURN doName(p, o)
ELSE
InternalError ("incorrect format specifier expecting one of 's', 'd' or 'a'")
END
END ;
RETURN p
END doOperand ;
(*
doPercent -
*)
PROCEDURE doPercent (o, s: String;
VAR i: INTEGER; e: INTEGER; n: CARDINAL) : String ;
BEGIN
INC(i) ;
IF i<e
THEN
CASE char(s, i) OF
'1': RETURN doOperand(o, s, i, e, OperandT(n)) |
'2': RETURN doOperand(o, s, i, e, OperandF(n)) |
'3': RETURN doOperand(o, s, i, e, OperandTok(n))
ELSE
InternalError ('unrecognised format specifier - expecting 1, 2 or 3 after the %')
END
END ;
InternalError ('end of field found before format specifier - expecting 1, 2 or 3 after the %')
END doPercent ;
(*
doNameLength - increment, l, by the ascii length of string determined by, o.
*)
PROCEDURE doNameLength (VAR l: CARDINAL; o: WORD) ;
VAR
s: String ;
BEGIN
s := InitStringCharStar(KeyToCharStar(o)) ;
INC(l, Length(s)) ;
s := KillString(s)
END doNameLength ;
(*
doSymNameLength - increment, l, by the ascii length of symbol, o.
*)
PROCEDURE doSymNameLength (VAR l: CARDINAL; o: WORD) ;
VAR
s: String ;
BEGIN
s := InitStringCharStar(KeyToCharStar(GetSymName(o))) ;
INC(l, Length(s)) ;
s := KillString(s)
END doSymNameLength ;
(*
doNumberLength - convert, o, to a cardinal and increment the length, l,
by the number of characters required to represent, o.
*)
PROCEDURE doNumberLength (VAR l: CARDINAL; o: WORD) ;
VAR
s: String ;
BEGIN
s := CardinalToString(VAL(CARDINAL, o), 0, ' ', 10, TRUE) ;
INC(l, Length(s)) ;
s := KillString(s)
END doNumberLength ;
(*
doSymbolLength - handles a symbol indicated by, o.
*)
PROCEDURE doSymbolLength (VAR l: CARDINAL; o: WORD) ;
VAR
s: String ;
BEGIN
s := symDesc(o, InitString('')) ;
INC(l, Length(s)) ;
s := KillString(s)
END doSymbolLength ;
(*
doOperandLength -
*)
PROCEDURE doOperandLength (s: String; VAR i: INTEGER; e: INTEGER; VAR l: CARDINAL; o: WORD) ;
BEGIN
INC(i) ;
IF i<e
THEN
CASE char(s, i) OF
's': (* symbol number *)
INC(i) ;
doSymbolLength(l, o) |
'd': (* decimal number *)
INC(i) ;
doNumberLength(l, o) |
'a': (* ascii name key *)
INC(i) ;
doSymNameLength(l, o) |
'n': (* ascii name key *)
INC(i) ;
doNameLength(l, o)
ELSE
InternalError ("incorrect format specifier expecting one of 's', 'd' or 'a'")
END
END
END doOperandLength ;
(*
doPercentLength -
*)
PROCEDURE doPercentLength (s: String; VAR i: INTEGER; e: INTEGER;
VAR l: CARDINAL; n: CARDINAL) ;
BEGIN
INC(i) ;
IF i<e
THEN
CASE char(s, i) OF
'1': doOperandLength(s, i, e, l, OperandT(n)) |
'2': doOperandLength(s, i, e, l, OperandF(n)) |
'3': doOperandLength(s, i, e, l, OperandTok(n)) |
ELSE
InternalError ('unrecognised format specifier - expecting 1, 2 or 3 after the %')
END
END
END doPercentLength ;
(*
doFieldLength - compute the string length given in annotation
at position, n, on the stack between characters
b and e.
The string description between: b..e can contain any
of these patterns:
%a ascii name key.
%s symbol number.
%d decimal cardinal number.
| indicates the next field.
*)
PROCEDURE doFieldLength (b, e: INTEGER; n: CARDINAL) : CARDINAL ;
VAR
l: CARDINAL ;
i: INTEGER ;
s: String ;
BEGIN
IF b=-1
THEN
RETURN( 0 )
END ;
s := OperandAnno(n) ;
IF e=-1
THEN
e := Length(s)
END ;
l := 0 ;
i := b ;
WHILE i<e DO
CASE char(s, i) OF
'|': RETURN l |
'%': doPercentLength(s, i, e, l, n) ;
ELSE
INC(l)
END ;
INC(i)
END ;
RETURN l
END doFieldLength ;
(*
stop -
*)
PROCEDURE stop ;
BEGIN
END stop ;
(*
doMaxCard - returns the maximum of two CARDINALs.
*)
PROCEDURE doMaxCard (a, b: CARDINAL) : CARDINAL ;
BEGIN
IF (a>100) OR (b>100)
THEN
stop
END ;
IF a>b
THEN
RETURN a
ELSE
RETURN b
END
END doMaxCard ;
(*
GetAnnotationFieldLength -
*)
PROCEDURE GetAnnotationFieldLength (n: CARDINAL; f: CARDINAL) : CARDINAL ;
VAR
c, e: INTEGER ;
BEGIN
c := GetComment(OperandAnno(n)) ;
IF c>0
THEN
IF Debugging
THEN
printf0('full anno is: ') ; Output(Dup(OperandAnno(n))) ; printf0('\n') ;
printf0('comment field is: ') ; Output(Slice(OperandAnno(n), c, 0)) ; printf0('\n')
END ;
e := Index(OperandAnno(n), '|', c) ;
IF f=0
THEN
RETURN doFieldLength(c, e, n)
ELSE
IF e>=0
THEN
INC(e)
END ;
RETURN doFieldLength(e, -1, n)
END
ELSE
RETURN 0
END
END GetAnnotationFieldLength ;
(*
GetAnnotationLength -
*)
PROCEDURE GetAnnotationLength (n: CARDINAL; f: CARDINAL) : CARDINAL ;
VAR
l: CARDINAL ;
BEGIN
IF OperandAnno(n)=NIL
THEN
l := 0 ;
IF f=0
THEN
doNumberLength(l, OperandT(n))
ELSE
doNumberLength(l, OperandF(n))
END ;
RETURN l
ELSE
RETURN GetAnnotationFieldLength(n, f)
END
END GetAnnotationLength ;
(*
GetFieldLength - returns the number of characters used in field, f,
at position, n, on the stack.
*)
PROCEDURE GetFieldLength (n: CARDINAL; f: CARDINAL) : CARDINAL ;
VAR
c, b, e: INTEGER ;
BEGIN
c := GetComment(OperandAnno(n)) ;
IF c>1
THEN
e := c-2
ELSE
e := Length(OperandAnno(n))
END ;
IF f=0
THEN
b := 0
ELSE
b := Index(OperandAnno(n), '|', 0) ;
IF b=-1
THEN
RETURN 0
ELSE
INC(b)
END
END ;
RETURN doFieldLength(b, e, n)
END GetFieldLength ;
(*
GetMaxFieldAnno - returns the maximum number of characters required
by either the annotation or field, f, at position, n,
on the stack.
*)
PROCEDURE GetMaxFieldAnno (n: CARDINAL; f: CARDINAL) : CARDINAL ;
BEGIN
RETURN doMaxCard(GetAnnotationLength(n, f), GetFieldLength(n, f))
END GetMaxFieldAnno ;
(*
GetStackFieldLengths - assigns, tn, and, fn, with the
maximum field width values.
*)
PROCEDURE GetStackFieldLengths (VAR tn, fn, tk: CARDINAL; amount: CARDINAL) ;
VAR
i: CARDINAL ;
BEGIN
i := 1 ;
tn := 0 ;
fn := 0 ;
tk := 0 ;
WHILE i<=amount DO
tn := doMaxCard(tn, GetMaxFieldAnno(i, 0)) ;
fn := doMaxCard(fn, GetMaxFieldAnno(i, 1)) ;
tk := doMaxCard(tk, GetMaxFieldAnno(i, 2)) ;
INC(i)
END
END GetStackFieldLengths ;
(*
DisplayRow -
*)
PROCEDURE DisplayRow (tn, fn, tk: CARDINAL; initOrFinal: BOOLEAN) ;
VAR
i: CARDINAL ;
BEGIN
printf0('+-') ;
FOR i := 1 TO tn DO
printf0('-')
END ;
IF (fn=0) AND (tk=0)
THEN
IF initOrFinal
THEN
printf0('-+-')
ELSE
printf0('-|-')
END
ELSE
IF initOrFinal
THEN
printf0('-+-')
ELSE
printf0('-|-')
END ;
IF fn#0
THEN
FOR i := 1 TO fn DO
printf0('-')
END
END ;
IF initOrFinal
THEN
printf0('-+-')
ELSE
printf0('-|-')
END ;
IF tk#0
THEN
FOR i := 1 TO tk DO
printf0('-')
END ;
printf0('-+\n')
END
END
END DisplayRow ;
(*
SkipToField -
*)
PROCEDURE SkipToField (s: String; n: CARDINAL) : INTEGER ;
VAR
i, h: INTEGER ;
BEGIN
i := 0 ;
h := Length(s) ;
WHILE (n>0) AND (i<h) DO
IF Index(s, '|', i)>0
THEN
DEC(n) ;
IF (i<h) AND (char(s, i+1)='|')
THEN
(* comment seen, no field available *)
RETURN -1
END ;
i := Index(s, '|', i)
ELSE
RETURN -1
END ;
INC(i)
END ;
IF i=h
THEN
i := -1
END ;
RETURN i
END SkipToField ;
(*
Pad - padds out string, s, to paddedLength characters.
*)
PROCEDURE Pad (o: String; paddedLength: CARDINAL) : String ;
VAR
i: CARDINAL ;
BEGIN
i := Length(o) ;
IF i<paddedLength
THEN
REPEAT
o := ConCatChar(o, ' ') ;
INC(i)
UNTIL i=paddedLength
END ;
RETURN o
END Pad ;
(*
doField - compute the string length given in annotation
at position, n, on the stack between characters
b and e.
The string description between: b..e can contain any
of these patterns:
%a ascii name key.
%s symbol number.
%d decimal cardinal number.
| indicates the next field.
*)
PROCEDURE doField (s: String; n: CARDINAL; f: CARDINAL; l: CARDINAL) : String ;
VAR
h, i, j: INTEGER ;
o : String ;
BEGIN
h := Length(s) ;
i := SkipToField(s, f) ;
o := InitString('') ;
IF i>=0
THEN
j := SkipToField(s, f+1) ;
IF j=-1
THEN
j := h
END ;
WHILE i<h DO
CASE char(s, i) OF
'|': i := h |
'%': o := doPercent(o, s, i, h, n)
ELSE
o := ConCatChar(o, char(s, i)) ;
INC(i)
END
END
END ;
o := Pad(o, l) ;
RETURN o
END doField ;
(*
doAnnotation -
*)
PROCEDURE doAnnotation (s: String; n: CARDINAL;
field: CARDINAL; width: CARDINAL) : String ;
VAR
c : INTEGER ;
cf, o: String ;
BEGIN
c := GetComment(s) ;
IF c>=0
THEN
cf := Slice(s, c, 0) ;
o := doField(cf, n, field, width) ;
cf := KillString(cf) ;
RETURN o
ELSE
RETURN InitString('')
END
END doAnnotation ;
(*
DisplayFields -
*)
PROCEDURE DisplayFields (n: CARDINAL; tn, fn, tk: CARDINAL) ;
VAR
s : String ;
t, f, k: CARDINAL ;
BEGIN
s := OperandAnno(n) ;
IF s=NIL
THEN
t := OperandT(n) ;
f := OperandF(n) ;
k := OperandTok(n) ;
printf0('| ') ;
Output(Pad(CardinalToString(VAL(CARDINAL, t), 0, ' ', 10, TRUE), tn)) ;
printf0(' | ') ;
Output(Pad(CardinalToString(VAL(CARDINAL, f), 0, ' ', 10, TRUE), fn)) ;
printf0(' | ') ;
Output(Pad(CardinalToString(VAL(CARDINAL, k), 0, ' ', 10, TRUE), tk)) ;
printf0(' |\n')
ELSE
IF tn>0
THEN
printf0('| ') ;
Output(doField(s, n, 0, tn))
END ;
IF fn>0
THEN
printf0(' | ') ;
Output(doField(s, n, 1, fn))
END ;
IF tk>0
THEN
printf0(' | ') ;
Output(doField(s, n, 2, tk))
END ;
printf0(' |\n') ;
IF tn>0
THEN
printf0('| ') ;
Output(doAnnotation(s, n, 0, tn))
END ;
IF fn>0
THEN
printf0(' | ') ;
Output(doAnnotation(s, n, 1, fn))
END ;
IF tk>0
THEN
printf0(' | ') ;
Output(doAnnotation(s, n, 2, tk))
END ;
printf0(' |\n')
END
END DisplayFields ;
(*
DebugStack - displays the stack.
*)
PROCEDURE DebugStack (amount: CARDINAL;
opt, opf, opa, opd, oprw, optk: ProcedureWord;
opanno: ProcedureString) ;
VAR
i : CARDINAL ;
tn, fn, tk: CARDINAL ;
BEGIN
OperandT := opt ;
OperandF := opf ;
OperandA := opa ;
OperandD := opd ;
OperandRW := oprw ;
OperandAnno := opanno ;
OperandTok := optk ;
GetStackFieldLengths(tn, fn, tk, amount) ;
i := 1 ;
WHILE i<=amount DO
IF i=1
THEN
DisplayRow(tn, fn, tk, TRUE)
END ;
DisplayFields(i, tn, fn, tk) ;
DisplayRow(tn, fn, tk, i=amount) ;
INC(i)
END
END DebugStack ;
END M2DebugStack.

View File

@@ -0,0 +1,54 @@
(* M2Defaults.def provides path and argument defaults.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2Defaults;
(*
Title : M2Defaults
Author : Gaius Mulley
System : UNIX (gm2)
Date : Fri Dec 13 13:04:51 1991
Last edit : Fri Dec 13 13:04:51 1991
Description: Provides mechanisms to collect the default
search path and command line options.
*)
FROM DynamicStrings IMPORT String ;
EXPORT QUALIFIED GetSearchPath, GetOptions ;
(*
GetSearchPath - returns a string, which is a copy of the environment variable
M2PATH.
*)
PROCEDURE GetSearchPath () : String ;
(*
GetOptions - returns a string, which is a copy of the environment variable
M2OPTIONS
*)
PROCEDURE GetOptions () : String ;
END M2Defaults.

View File

@@ -0,0 +1,64 @@
(* M2Defaults.mod provides path and argument defaults.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2Defaults;
FROM DynamicStrings IMPORT InitString, KillString ;
FROM SEnvironment IMPORT GetEnvironment ;
(*
GetSearchPath - sets string, a, to the environment variable
M2PATH.
*)
PROCEDURE GetSearchPath () : String ;
VAR
s, p: String ;
BEGIN
s := InitString('M2PATH') ;
IF GetEnvironment(s, p)
THEN
END ;
s := KillString(s) ;
RETURN( p )
END GetSearchPath ;
(*
GetOptions - returns a string, which is a copy of the environment variable
M2OPTIONS
*)
PROCEDURE GetOptions () : String ;
VAR
s, p: String ;
BEGIN
s := InitString('M2OPTIONS') ;
IF GetEnvironment(s, p)
THEN
END ;
s := KillString(s) ;
RETURN( p )
END GetOptions ;
END M2Defaults.

View File

@@ -0,0 +1,43 @@
(* M2DriverOptions.def provides procedures to handle driver options.
Copyright (C) 2011-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2DriverOptions ;
(*
Title : M2DriverOptions
Author : Gaius Mulley
System : GNU Modula-2
Date : Tue Dec 18 13:52:08 2012
Revision : $Version$
Description: provides procedures to handle driver options.
*)
FROM DynamicStrings IMPORT String ;
(*
ScanCppArgs - scans the cpp arguments and builds up the cpp command line.
*)
PROCEDURE ScanCppArgs (i: CARDINAL) : CARDINAL ;
END M2DriverOptions.

View File

@@ -0,0 +1,95 @@
(* M2DriverOptions.mod provides procedures to handle driver options.
Copyright (C) 2011-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2DriverOptions ;
FROM DynamicStrings IMPORT String, Length, InitString, Mark, Slice, EqualArray,
InitStringCharStar, ConCatChar, ConCat, KillString,
PushAllocation, PopAllocationExemption, char ;
FROM SArgs IMPORT GetArg, Narg ;
FROM M2Options IMPORT CppRemember ;
(*
CppArgument - some options might have arguments, remember these as well.
*)
PROCEDURE CppArgument (i: CARDINAL; option: String) : CARDINAL ;
VAR
arg: String ;
BEGIN
IF GetArg (arg, i+1) AND (char (arg, 0) # '-')
THEN
(* arg exists and is not an option and might be an argument to a specific option. *)
IF EqualArray (option, '-I')
THEN
INC (i) ;
CppRemember (arg) (* arg will be a path for -I. *)
ELSIF EqualArray (option, '-D')
THEN
INC (i) ;
CppRemember (arg) (* arg will be define for -D. *)
ELSIF EqualArray (option, '-isystem')
THEN
INC (i) ;
CppRemember (arg) (* arg will be a path for -isystem. *)
ELSIF EqualArray (option, '-imultiarch')
THEN
INC (i) ;
CppRemember (arg) (* arg will be a definition for -imultiarch. *)
END
END ;
RETURN i
END CppArgument ;
(*
ScanCppArgs - scans the cpp arguments and builds up the cpp command line.
*)
PROCEDURE ScanCppArgs (i: CARDINAL) : CARDINAL ;
VAR
option: String ;
BEGIN
IF GetArg (option, i) AND EqualArray (option, '-fcpp-begin')
THEN
INC (i) ;
WHILE GetArg (option, i) DO
IF EqualArray (option, '-fcpp-end')
THEN
RETURN i
ELSE
(* do not remember the filename. *)
IF char (option, 0)='-'
THEN
CppRemember (option) ;
i := CppArgument (i, option)
END
END ;
INC (i)
END
END ;
RETURN i
END ScanCppArgs ;
END M2DriverOptions.

View File

@@ -0,0 +1,59 @@
(* M2Emit.def connects Modula-2 error reporting to GCC.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2Emit ;
FROM DynamicStrings IMPORT String ;
FROM m2linemap IMPORT location_t ;
(*
EmitError - pass the error to GCC or the gm2 tools output routines.
*)
PROCEDURE EmitError (error, note: BOOLEAN; token: CARDINAL; message: String) ;
(*
InternalError - issue an internal error, message.
*)
PROCEDURE InternalError (message: ARRAY OF CHAR) ;
(*
UnknownLocation - return the unknown location (using GCC linemap for cc1gm2)
and constants for gm2l and gm2m.
*)
PROCEDURE UnknownLocation () : location_t ;
(*
BuiltinsLocation - return the builtins location (using GCC linemap for cc1gm2)
and constants for gm2l and gm2m.
*)
PROCEDURE BuiltinsLocation () : location_t ;
END M2Emit.

View File

@@ -0,0 +1,82 @@
(* M2Emit.mod issue errors to the GCC error reporting substructure.
Copyright (C) 2019-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2Emit ;
IMPORT m2linemap ;
FROM M2LexBuf IMPORT TokenToLocation ;
FROM m2linemap IMPORT ErrorAtf, WarningAtf, NoteAtf, internal_error ;
FROM DynamicStrings IMPORT string ;
FROM SYSTEM IMPORT ADR ;
(*
EmitError - pass the error to GCC.
*)
PROCEDURE EmitError (error, note: BOOLEAN; token: CARDINAL; message: String) ;
BEGIN
IF error
THEN
ErrorAtf (TokenToLocation (token), string (message))
ELSIF note
THEN
NoteAtf (TokenToLocation (token), string (message))
ELSE
WarningAtf (TokenToLocation (token), string (message))
END
END EmitError ;
(*
InternalError - issue an internal error, message.
*)
PROCEDURE InternalError (message: ARRAY OF CHAR) ;
BEGIN
internal_error (ADR (message))
END InternalError ;
(*
UnknownLocation - return the unknown location (using GCC linemap for cc1gm2)
and constants for gm2l and gm2m.
*)
PROCEDURE UnknownLocation () : location_t ;
BEGIN
RETURN m2linemap.UnknownLocation ()
END UnknownLocation ;
(*
BuiltinsLocation - return the builtins location (using GCC linemap for cc1gm2)
and constants for gm2l and gm2m.
*)
PROCEDURE BuiltinsLocation () : location_t ;
BEGIN
RETURN m2linemap.BuiltinsLocation ()
END BuiltinsLocation ;
END M2Emit.

View File

@@ -0,0 +1,364 @@
(* M2Error.def error reporting interface.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2Error ;
(*
Title : M2Error
Author : Gaius Mulley
System : UNIX (gm2)
Description: provides an interface between the string handling modules
and the compiler.
*)
FROM SYSTEM IMPORT BYTE ;
FROM DynamicStrings IMPORT String ;
FROM NameKey IMPORT Name ;
EXPORT QUALIFIED Error, ErrorScope,
InternalError,
WriteFormat0, WriteFormat1, WriteFormat2, WriteFormat3,
NewError, ErrorFormat0, ErrorFormat1, ErrorFormat2, ErrorFormat3,
ErrorString,
NewWarning, NewNote, SetColor,
FlushErrors, FlushWarnings, ChainError,
ErrorStringAt, ErrorStringAt2, ErrorStringsAt2,
WarnStringAt, WarnStringAt2, WarnStringsAt2,
ErrorAbort0,
WarnFormat0, WarnFormat1, MoveError,
AnnounceScope, EnterImplementationScope,
EnterModuleScope, EnterDefinitionScope, EnterProgramScope,
EnterProcedureScope, DepthScope, GetAnnounceScope,
DefaultProgramModule, DefaultImplementationModule,
DefaultDefinitionModule, DefaultInnerModule, DefaultProcedure,
EnterErrorScope, GetCurrentErrorScope, ResetErrorScope,
LeaveErrorScope ;
TYPE
Error ;
ErrorScope ;
(*
InternalError - displays an internal error message together with the compiler source
file and line number.
This function is not buffered and is used when the compiler is about
to give up.
*)
PROCEDURE InternalError (message: ARRAY OF CHAR) <* noreturn *> ;
(* ***************************************************************************
The following routines are used for normal syntax and semantic error reporting
*************************************************************************** *)
(*
WriteFormat0 - displays the source module and line together
with the encapsulated format string.
Used for simple error messages tied to the current token.
*)
PROCEDURE WriteFormat0 (a: ARRAY OF CHAR) ;
(*
WriteFormat1 - displays the source module and line together
with the encapsulated format string.
Used for simple error messages tied to the current token.
*)
PROCEDURE WriteFormat1 (a: ARRAY OF CHAR; w: ARRAY OF BYTE) ;
(*
WriteFormat2 - displays the module and line together with the encapsulated
format strings.
Used for simple error messages tied to the current token.
*)
PROCEDURE WriteFormat2 (a: ARRAY OF CHAR; w1, w2: ARRAY OF BYTE) ;
(*
WriteFormat3 - displays the module and line together with the encapsulated
format strings.
Used for simple error messages tied to the current token.
*)
PROCEDURE WriteFormat3 (a: ARRAY OF CHAR; w1, w2, w3: ARRAY OF BYTE) ;
(*
NewError - creates and returns a new error handle.
*)
PROCEDURE NewError (AtTokenNo: CARDINAL) : Error ;
(*
NewWarning - creates and returns a new error handle suitable for a warning.
A warning will not stop compilation.
*)
PROCEDURE NewWarning (AtTokenNo: CARDINAL) : Error ;
(*
NewNote - creates and returns a new error handle suitable for a note.
A note will not stop compilation.
*)
PROCEDURE NewNote (AtTokenNo: CARDINAL) : Error ;
(*
ChainError - creates and returns a new error handle, this new error
is associated with, e, and is chained onto the end of, e.
*)
PROCEDURE ChainError (AtTokenNo: CARDINAL; e: Error) : Error ;
(*
MoveError - repositions an error, e, to token, AtTokenNo, and returns, e.
*)
PROCEDURE MoveError (e: Error; AtTokenNo: CARDINAL) : Error ;
(*
SetColor - informs the error module that this error will have had colors
assigned to it. If an error is issued without colors assigned
then the default colors will be assigned to the legacy error
messages.
*)
PROCEDURE SetColor (e: Error) : Error ;
(*
ErrorFormat routines provide a printf capability for the error handle.
*)
PROCEDURE ErrorFormat0 (e: Error; a: ARRAY OF CHAR) ;
PROCEDURE ErrorFormat1 (e: Error; a: ARRAY OF CHAR; w: ARRAY OF BYTE) ;
PROCEDURE ErrorFormat2 (e: Error; a: ARRAY OF CHAR; w1, w2: ARRAY OF BYTE) ;
PROCEDURE ErrorFormat3 (e: Error; a: ARRAY OF CHAR; w1, w2, w3: ARRAY OF BYTE) ;
PROCEDURE ErrorString (e: Error; str: String) ;
(* ***************************************************************************
The following routines are useful for positioning and warnings and errors
at tokens. The strings are emitted later, so the caller must not destroy
the strings.
*************************************************************************** *)
PROCEDURE ErrorStringAt (s: String; tok: CARDINAL) ;
PROCEDURE ErrorStringAt2 (s: String; tok1, tok2: CARDINAL) ;
PROCEDURE ErrorStringsAt2 (s1, s2: String; tok1, tok2: CARDINAL) ;
PROCEDURE WarnStringAt (s: String; tok: CARDINAL) ;
PROCEDURE WarnStringAt2 (s: String; tok1, tok2: CARDINAL) ;
PROCEDURE WarnStringsAt2 (s1, s2: String; tok1, tok2: CARDINAL) ;
(*
WarnFormat0 - displays the source module and line together
with the encapsulated format string.
Used for simple warning messages tied to the current token.
*)
PROCEDURE WarnFormat0 (a: ARRAY OF CHAR) ;
(*
WarnFormat1 - displays the source module and line together
with the encapsulated format string.
Used for simple warning messages tied to the current token.
*)
PROCEDURE WarnFormat1 (a: ARRAY OF CHAR; w: ARRAY OF BYTE) ;
(*
FlushErrors - switches the output channel to the error channel
and then writes out all errors.
If an error is present the compilation is terminated.
All warnings are ignored.
*)
PROCEDURE FlushErrors ;
(*
FlushWarnings - switches the output channel to the error channel
and then writes out all warnings.
If an error is present the compilation is terminated,
if warnings only were emitted then compilation will
continue.
*)
PROCEDURE FlushWarnings ;
(*
ErrorAbort0 - aborts compiling, it flushes all warnings and errors before aborting.
*)
PROCEDURE ErrorAbort0 (a: ARRAY OF CHAR) ;
(*
AnnounceScope - return the error string message with a scope description prepended
assuming that scope has changed.
*)
PROCEDURE AnnounceScope (e: Error; message: String) : String ;
(*
EnterImplementationScope - signifies to the error routines that the front end
has started to compile implementation module scopeName.
*)
PROCEDURE EnterImplementationScope (scopename: Name) ;
(*
EnterProgramScope - signifies to the error routines that the front end
has started to compile program module scopeName.
*)
PROCEDURE EnterProgramScope (scopename: Name) ;
(*
EnterModuleScope - signifies to the error routines that the front end
has started to compile an inner module scopeName.
*)
PROCEDURE EnterModuleScope (scopename: Name) ;
(*
EnterDefinitionScope - signifies to the error routines that the front end
has started to compile definition module scopeName.
*)
PROCEDURE EnterDefinitionScope (scopename: Name) ;
(*
EnterProcedureScope - signifies to the error routines that the front end
has started to compile definition module scopeName.
*)
PROCEDURE EnterProcedureScope (scopename: Name) ;
(*
DepthScope - returns the depth of the scope stack.
*)
PROCEDURE DepthScope () : CARDINAL ;
(*
GetAnnounceScope - return message with the error scope attached to message.
filename and message are treated as read only by this
procedure function.
*)
PROCEDURE GetAnnounceScope (filename, message: String) : String ;
(*
DefaultProgramModule - sets up an unnamed program scope before the Ident is seen.
*)
PROCEDURE DefaultProgramModule ;
(*
DefaultImplementationModule - sets up an unnamed implementation
scope before the Ident is seen.
*)
PROCEDURE DefaultImplementationModule ;
(*
DefaultDefinitionModule - sets up an unnamed definition
scope before the Ident is seen.
*)
PROCEDURE DefaultDefinitionModule ;
(*
DefaultInnerModule - sets up an unnamed inner
scope before the Ident is seen.
*)
PROCEDURE DefaultInnerModule ;
(*
DefaultProcedure - sets up an unnamed procedure
scope before the Ident is seen.
*)
PROCEDURE DefaultProcedure ;
(*
EnterErrorScope - pushes the currentScope and sets currentScope to scope.
*)
PROCEDURE EnterErrorScope (scope: ErrorScope) ;
(*
LeaveErrorScope - leave the current scope and pop into the previous one.
*)
PROCEDURE LeaveErrorScope ;
(*
GetCurrentErrorScope - returns currentScope.
*)
PROCEDURE GetCurrentErrorScope () : ErrorScope ;
(*
ResetErrorScope - should be called at the start of each pass to
reset the error scope index.
*)
PROCEDURE ResetErrorScope ;
END M2Error.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,42 @@
(* M2EvalSym.def Evaluates all the symbol values within the symbol table.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2EvalSym ;
(*
Title : M2EvalSym
Author : Gaius Mulley
Date : 7/8/87
LastEdit : 7/8/87
System : UNIX (GNU Modula-2)
Description: Evaluates all the symbol values within the symbol table.
*)
EXPORT QUALIFIED Evaluate ;
(*
Evaluate - evaluate all the symbols in the symbol table.
*)
PROCEDURE Evaluate ;
END M2EvalSym.

View File

@@ -0,0 +1,74 @@
(* M2FileName.def construct file names.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2FileName ;
(*
Author : Gaius Mulley
Title : M2FileName
Date : 3/4/86 [$Date: 2013/07/08 10:27:56 $]
SYSTEM : UNIX (GNU Modula-2)
Description: construct file names.
Version : $Revision: 1.11 $
*)
FROM DynamicStrings IMPORT String ;
EXPORT QUALIFIED CalculateFileName, CalculateStemName, ExtractExtension ;
(*
CalculateFileName - calculates and returns a new string filename
given a module and an extension. This file name
length will be operating system specific.
String, Extension, is concatenated onto
Module and thus it is safe to `Mark' the extension
for garbage collection.
*)
PROCEDURE CalculateFileName (Module, Extension: String) : String ;
(*
CalculateStemName - calculates the stem name for given a module.
This name length will be operating system and
compiler specific.
*)
PROCEDURE CalculateStemName (Module: String) : String ;
(*
ExtractExtension - given a, filename, return the filename without
the extension, Ext.
*)
PROCEDURE ExtractExtension (filename, ext: String) : String ;
(*
ExtractModule - given a, filename, return the module name including any
extension. A new string is returned.
*)
PROCEDURE ExtractModule (filename: String) : String ;
END M2FileName.

View File

@@ -0,0 +1,106 @@
(* M2FileName.mod construct file names.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2FileName ;
FROM ASCII IMPORT nul ;
FROM DynamicStrings IMPORT InitString, Mark, Slice, Dup, ConCatChar, ConCat, Length, Equal, Index ;
CONST
MaxFileName = 0 ; (* zero means no limits *)
MaxStemName = 0 ;
Directory = '/' ;
(*
currently there are no limits on filename length, this may
be incorrect on some systems.
*)
(*
CalculateFileName - calculates and returns a new string filename given a module
and an extension. String, Extension, is concatenated onto
Module and thus it is safe to `Mark' the extension for garbage
collection.
*)
PROCEDURE CalculateFileName (Module, Extension: String) : String ;
BEGIN
IF MaxFileName=0
THEN
RETURN( ConCat(ConCatChar(Slice(Module, 0, MaxFileName), '.'), Extension) )
ELSE
RETURN( ConCat(ConCatChar(Slice(Module, 0, MaxFileName-Length(Extension)-1), '.'), Extension) )
END
END CalculateFileName ;
(*
CalculateStemName - calculates the stem name for given a module.
This name length will be operating system and
compiler specific.
*)
PROCEDURE CalculateStemName (Module: String) : String ;
BEGIN
RETURN( Slice(Module, 0, MaxStemName) )
END CalculateStemName ;
(*
ExtractExtension - given a, filename, return the filename without
the extension, Ext.
*)
PROCEDURE ExtractExtension (filename, ext: String) : String ;
BEGIN
IF Equal(ext, Mark(Slice(filename, -Length(ext), 0)))
THEN
RETURN( Slice(filename, 0, -Length(ext)) )
ELSE
RETURN( filename )
END
END ExtractExtension ;
(*
ExtractModule - given a, filename, return the module name including any
extension. A new string is returned.
*)
PROCEDURE ExtractModule (filename: String) : String ;
VAR
i: INTEGER ;
BEGIN
i := Index(filename, Directory, 0) ;
IF i=-1
THEN
RETURN( Dup(filename) )
ELSE
RETURN( Slice(filename, i+1, 0) )
END
END ExtractModule ;
END M2FileName.

View File

@@ -0,0 +1,245 @@
(* M2GCCDeclare.def declares Modula-2 types to GCC.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2GCCDeclare ;
(*
Title : M2GCCDeclare
Author : Gaius Mulley
System : UNIX (gm2)
Date : Sat Jul 17 10:28:43 1999
Last edit : Sat Jul 17 10:28:43 1999
Description: declares Modula-2 types to GCC,
only declares a type once all subcomponents are known.
*)
FROM SYSTEM IMPORT WORD ;
FROM m2tree IMPORT Tree ;
EXPORT QUALIFIED FoldConstants,
DeclareConstant, TryDeclareConstant,
DeclareConstructor, TryDeclareConstructor,
DeclareLocalVariables, PromoteToString, DeclareLocalVariable,
InitDeclarations, StartDeclareScope, EndDeclareScope,
DeclareModuleVariables, IsProcedureGccNested,
DeclareProcedure, PoisonSymbols, DeclareParameters,
DeclareM2linkGlobals,
CompletelyResolved, MarkExported, PrintSym,
ConstantKnownAndUsed,
PutToBeSolvedByQuads,
GetTypeMin, GetTypeMax,
WalkAction, IsAction ;
TYPE
WalkAction = PROCEDURE (WORD) ;
IsAction = PROCEDURE (WORD) : BOOLEAN ;
(*
FoldConstants - a wrapper for ResolveConstantExpressions.
*)
PROCEDURE FoldConstants (start, end: CARDINAL) ;
(*
StartDeclareScope - declares types, variables associated with this scope.
*)
PROCEDURE StartDeclareScope (scope: CARDINAL) ;
(*
EndDeclareScope -
*)
PROCEDURE EndDeclareScope ;
(*
DeclareParameters -
*)
PROCEDURE DeclareParameters (sym: CARDINAL) ;
(*
DeclareConstant - if, sym, is a constant then declare it.
The constant must be solvable at this point.
*)
PROCEDURE DeclareConstant (tokenno: CARDINAL; sym: CARDINAL) ;
(*
DeclareConstructor - if, sym, is a constructor then declare it.
The constructor must be solvable at this point.
*)
PROCEDURE DeclareConstructor (tokenno: CARDINAL; quad: CARDINAL; sym: CARDINAL) ;
(*
TryDeclareConstant - try and declare a constant. If, sym, is a
constant try and declare it, if we cannot
then enter it into the to do list.
*)
PROCEDURE TryDeclareConstant (tokenno: CARDINAL; sym: CARDINAL) ;
(*
TryDeclareConstructor - try and declare a constructor. If, sym, is a
constructor try and declare it, if we cannot
then enter it into the to do list.
*)
PROCEDURE TryDeclareConstructor (tokenno: CARDINAL; sym: CARDINAL) ;
(*
DeclareLocalVariables - lists the Local variables for procedure
together with their offset.
*)
PROCEDURE DeclareLocalVariables (procedure: CARDINAL) ;
(*
DeclareLocalVariable - declare a local variable var.
*)
PROCEDURE DeclareLocalVariable (var: CARDINAL) ;
(*
DeclareProcedure - declares procedure, sym, or all procedures inside
module sym.
*)
PROCEDURE DeclareProcedure (sym: WORD) ;
(*
DeclareModuleVariables - declares Module variables for a module
which inside a procedure.
*)
PROCEDURE DeclareModuleVariables (sym: CARDINAL) ;
(*
DeclareM2linkGlobals - will create M2LINK.StaticInitialization
and M2LINK.ForcedModuleInitOrder providing
they have not already been created.
*)
PROCEDURE DeclareM2linkGlobals (tokenno: CARDINAL) ;
(*
IsProcedureGccNested - returns TRUE if procedure, sym, will be considered
as nested by GCC.
This will occur if either its outer defining scope
is a procedure or is a module which is inside a
procedure.
*)
PROCEDURE IsProcedureGccNested (sym: CARDINAL) : BOOLEAN ;
(*
PoisonSymbols - poisons all gcc symbols from procedure, sym.
A debugging aid.
*)
PROCEDURE PoisonSymbols (sym: CARDINAL) ;
(*
PromoteToString - declare, sym, and then promote it to a string.
Note that if sym is a single character we do
*not* record it as a string
but as a char however we always
return a string constant.
*)
PROCEDURE PromoteToString (tokenno: CARDINAL; sym: CARDINAL) : Tree ;
(*
CompletelyResolved - returns TRUE if a symbol has been completely resolved
and is not partially declared (such as a record,
array or procedure type).
*)
PROCEDURE CompletelyResolved (sym: CARDINAL) : BOOLEAN ;
(*
ConstantKnownAndUsed -
*)
PROCEDURE ConstantKnownAndUsed (sym: CARDINAL; t: Tree) ;
(*
PutToBeSolvedByQuads - places, sym, in this list.
*)
PROCEDURE PutToBeSolvedByQuads (sym: CARDINAL) ;
(*
MarkExported - tell GCC to mark all exported procedures in module sym.
*)
PROCEDURE MarkExported (sym: CARDINAL) ;
(*
GetTypeMin - returns a symbol corresponding to MIN(type)
*)
PROCEDURE GetTypeMin (type: CARDINAL) : CARDINAL ;
(*
GetTypeMax - returns a symbol corresponding to MAX(type)
*)
PROCEDURE GetTypeMax (type: CARDINAL) : CARDINAL ;
(*
PrintSym - prints limited information about a symbol.
*)
PROCEDURE PrintSym (sym: CARDINAL) ;
(*
InitDeclarations - initializes default types and the source filename.
*)
PROCEDURE InitDeclarations ;
END M2GCCDeclare.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,103 @@
(* M2GenGCC.def convert the quadruples into GCC trees.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2GenGCC ;
(*
Title : M2GenGCC
Author : Gaius Mulley
System : UNIX (gm2)
Date : Fri Jul 9 13:05:13 1999
Last edit : Fri Jul 9 13:05:13 1999
Description: provides an interface to GCC, essentially convert the
internal quadruples of m2f into a GCC tree structure.
*)
FROM M2GCCDeclare IMPORT WalkAction ;
FROM m2tree IMPORT Tree ;
FROM m2linemap IMPORT location_t ;
EXPORT QUALIFIED ConvertQuadsToTree, ResolveConstantExpressions,
GetHighFromUnbounded, StringToChar,
LValueToGenericPtr, ZConstToTypedConst,
DoCopyString ;
(*
ConvertQuadsToTree - runs through the quadruple list, Start..End, and converts it into
the GCC tree structure.
*)
PROCEDURE ConvertQuadsToTree (Start, End: CARDINAL) ;
(*
ResolveConstantExpressions - resolves constant expressions from the quadruple list.
It returns TRUE if one or more constants were folded.
When a constant symbol value is solved, the call back
p(sym) is invoked.
*)
PROCEDURE ResolveConstantExpressions (p: WalkAction; start, end: CARDINAL) : BOOLEAN ;
(*
GetHighFromUnbounded - returns a Tree containing the value of
param.HIGH.
*)
PROCEDURE GetHighFromUnbounded (location: location_t; dim, param: CARDINAL) : Tree ;
(*
StringToChar - if type=Char and str is a string (of size <= 1)
then convert the string into a character constant.
*)
PROCEDURE StringToChar (t: Tree; type, str: CARDINAL) : Tree ;
(*
LValueToGenericPtr - returns a Tree representing symbol, sym.
It coerces a lvalue into an internal pointer type
*)
PROCEDURE LValueToGenericPtr (location: location_t; sym: CARDINAL) : Tree ;
(*
ZConstToTypedConst - checks whether op1 and op2 are constants and
coerces, t, appropriately.
*)
PROCEDURE ZConstToTypedConst (t: Tree; op1, op2: CARDINAL) : Tree ;
(*
DoCopyString - returns trees:
t number of bytes to be copied (including the nul)
op3t the string with the extra nul character
providing it fits.
*)
PROCEDURE DoCopyString (tokenno: CARDINAL; VAR length, op3t: Tree; op1t, op3: CARDINAL) ;
END M2GenGCC.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,58 @@
(* M2Graph.def maintains the dependancy graph depth.
Copyright (C) 2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2Graph ;
FROM Lists IMPORT List ;
TYPE
Graph ;
(*
InitGraph - creates and returns an empty graph.
*)
PROCEDURE InitGraph () : Graph ;
(*
KillGraph - deletes graph and all nodes.
*)
PROCEDURE KillGraph (VAR g: Graph) ;
(*
AddDependent - adds moduleSym <- dependSym into the graph.
*)
PROCEDURE AddDependent (graph: Graph; moduleSym, dependSym: CARDINAL) ;
(*
SortGraph - returns a List containing the sorted graph.
*)
PROCEDURE SortGraph (g: Graph; topModule: CARDINAL) : List ;
END M2Graph.

View File

@@ -0,0 +1,234 @@
(* M2Graph.mod maintains the dependancy graph depth.
Copyright (C) 2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2Graph ;
FROM Storage IMPORT ALLOCATE ;
FROM StrLib IMPORT StrEqual, StrCopy ;
FROM NumberIO IMPORT WriteCard ;
FROM StrIO IMPORT WriteString, WriteLn ;
FROM NameKey IMPORT Name, WriteKey ;
FROM Lists IMPORT InitList, KillList, IncludeItemIntoList, RemoveItemFromList ;
FROM Indexing IMPORT Index, HighIndice, IncludeIndiceIntoIndex, InitIndex, KillIndex, GetIndice ;
FROM M2Printf IMPORT printf0, printf1, printf2 ;
FROM SymbolTable IMPORT GetSymName, IsDefinitionForC, IsModule ;
CONST
Debugging = FALSE ;
TYPE
state = (initial, started, ordered) ;
node = POINTER TO RECORD
moduleSym: CARDINAL ; (* SymbolTable entry for module. *)
deps : Index ;
nstate : state ;
END ;
Graph = POINTER TO RECORD
nodes: Index ;
END ;
(*
InitGraph - creates and returns an empty graph.
*)
PROCEDURE InitGraph () : Graph ;
VAR
g: Graph ;
BEGIN
NEW (g) ;
g^.nodes := InitIndex (1) ;
RETURN g
END InitGraph ;
(*
KillNode - deletes the dynamic storage associated with nptr.
*)
PROCEDURE KillNode (nptr: node) ;
BEGIN
nptr^.deps := KillIndex (nptr^.deps)
END KillNode ;
(*
KillGraph - deletes graph and all nodes.
*)
PROCEDURE KillGraph (VAR g: Graph) ;
VAR
i, n: CARDINAL ;
nptr: node ;
BEGIN
n := HighIndice (g^.nodes) ;
i := 1 ;
WHILE i <= n DO
nptr := GetIndice (g^.nodes, i) ;
KillNode (nptr) ;
INC (i)
END ;
g := NIL
END KillGraph ;
(*
initNode - create a new node in graph and return the node.
*)
PROCEDURE initNode (graph: Graph; moduleSym: CARDINAL) : node ;
VAR
nptr: node ;
BEGIN
NEW (nptr) ;
nptr^.moduleSym := moduleSym ;
nptr^.deps := InitIndex (1) ;
nptr^.nstate := initial ;
IncludeIndiceIntoIndex (graph^.nodes, nptr) ;
RETURN nptr
END initNode ;
(*
getNode - returns a node from graph representing moduleSym.
If the node does not exist it is created.
*)
PROCEDURE getNode (graph: Graph; moduleSym: CARDINAL) : node ;
VAR
i, n: CARDINAL ;
nptr: node ;
BEGIN
i := 1 ;
n := HighIndice (graph^.nodes) ;
WHILE i <= n DO
nptr := GetIndice (graph^.nodes, i) ;
IF nptr^.moduleSym = moduleSym
THEN
RETURN nptr
END ;
INC (i)
END ;
RETURN initNode (graph, moduleSym)
END getNode ;
(*
createDependent - mptr imports from dptr.
*)
PROCEDURE createDependent (mptr, dptr: node) ;
BEGIN
IncludeIndiceIntoIndex (mptr^.deps, dptr)
END createDependent ;
(*
AddDependent - adds moduleSym <- dependSym into the graph.
*)
PROCEDURE AddDependent (graph: Graph; moduleSym, dependSym: CARDINAL) ;
VAR
mptr, dptr: node ;
BEGIN
IF (IsModule (moduleSym) OR (NOT IsDefinitionForC (moduleSym))) AND
(IsModule (dependSym) OR (NOT IsDefinitionForC (dependSym)))
THEN
mptr := getNode (graph, moduleSym) ;
dptr := getNode (graph, dependSym) ;
createDependent (mptr, dptr)
END
END AddDependent ;
(*
SortGraph - returns a List containing the sorted graph.
*)
PROCEDURE SortGraph (g: Graph; topModule: CARDINAL) : List ;
VAR
sorted: List ;
nptr : node ;
BEGIN
InitList (sorted) ;
setNodesInitial (g) ;
nptr := getNode (g, topModule) ;
resolveImports (sorted, nptr) ;
RemoveItemFromList (sorted, topModule) ;
IncludeItemIntoList (sorted, topModule) ; (* Ensure topModule is last. *)
RETURN sorted
END SortGraph ;
(*
resolveImports - recursively resolve imports using ISO Modula-2
rules for the order of module initialization.
*)
PROCEDURE resolveImports (sorted: List; nptr: node) ;
VAR
i, n: CARDINAL ;
name: Name ;
BEGIN
IF nptr^.nstate = initial
THEN
nptr^.nstate := started ;
name := GetSymName (nptr^.moduleSym) ;
i := 1 ;
n := HighIndice (nptr^.deps) ;
IF Debugging
THEN
printf2 ("resolving %a %d dependents\n", name, n)
END ;
WHILE i <= n DO
resolveImports (sorted, GetIndice (nptr^.deps, i)) ;
INC (i)
END ;
nptr^.nstate := ordered ;
IncludeItemIntoList (sorted, nptr^.moduleSym)
END
END resolveImports ;
(*
setNodesInitial - changes the state of all nodes in graph to initial.
*)
PROCEDURE setNodesInitial (g: Graph) ;
VAR
i, n: CARDINAL ;
nptr: node ;
BEGIN
i := 1 ;
n := HighIndice (g^.nodes) ;
WHILE i <= n DO
nptr := GetIndice (g^.nodes, i) ;
nptr^.nstate := initial ;
INC (i)
END
END setNodesInitial ;
END M2Graph.

View File

@@ -0,0 +1,106 @@
(* M2Lex.def provides a non tokenised lexical analyser.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
DEFINITION MODULE M2Lex ;
(*
Title : M2Lex
Author : Gaius Mulley
Date : Date: Sat 16-09-1989 Time: 17:54:22.58
LastEdit : Date: Sat 16-09-1989 Time: 17:54:22.58
System : UNIX (GNU Modula-2)
Description: Provides a non tokenised version of M2Lexical.
Symbols are distinct MODULA-2 symbols.
*)
EXPORT QUALIFIED MaxLine,
GetSymbol,
PutSymbol,
CurrentSymbol,
LastSymbol,
OpenSource,
CloseSource,
SymIs,
IsSym,
WriteError ;
CONST
MaxLine = 1024 ;
VAR
LastSymbol,
CurrentSymbol : ARRAY [0..MaxLine] OF CHAR ;
(*
OpenSource - Attempts to open the source file, a.
The success of the operation is returned.
*)
PROCEDURE OpenSource (a: ARRAY OF CHAR) : BOOLEAN ;
(*
CloseSource - Closes the current open file.
*)
PROCEDURE CloseSource ;
(*
SymIs - if Name is equal to the CurrentSymbol the next Symbol is read
and true is returned, otherwise false is returned.
*)
PROCEDURE SymIs (Name: ARRAY OF CHAR) : BOOLEAN ;
(*
IsSym - returns the result of the comparison between CurrentSymbol
and Name.
*)
PROCEDURE IsSym (Name: ARRAY OF CHAR) : BOOLEAN ;
(*
GetSymbol - gets the next Symbol into CurrentSymbol.
*)
PROCEDURE GetSymbol ;
(*
PutSymbol - pushes a symbol, Name, back onto the input.
GetSymbol will set CurrentSymbol to, Name.
*)
PROCEDURE PutSymbol (Name: ARRAY OF CHAR) ;
(*
WriteError - displays the source line and points to the symbol in error.
The message, a, is displayed.
*)
PROCEDURE WriteError (a: ARRAY OF CHAR) ;
END M2Lex.

View File

@@ -0,0 +1,418 @@
(* M2Lex.mod provides a non tokenised lexical analyser.
Copyright (C) 2001-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
This file is part of GNU Modula-2.
GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
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/>. *)
IMPLEMENTATION MODULE M2Lex ;
FROM FIO IMPORT File, OpenToRead, ReadChar, Close, IsNoError ;
FROM StrIO IMPORT ReadString, WriteString, WriteLn ;
FROM StdIO IMPORT Write ;
FROM NumberIO IMPORT WriteCard ;
FROM ASCII IMPORT nul, lf, cr, EOL ;
FROM StrLib IMPORT StrCopy, StrEqual, StrLen ;
CONST
LineBuf = 1 ;
Wrap = LineBuf+1 ;
eof = 032C ;
MaxStack= 10 ;
VAR
f: File ;
Opened : BOOLEAN ;
CurrentChar : CHAR ;
NextChar : CHAR ;
FileName : ARRAY [0..MaxLine] OF CHAR ;
Lines : ARRAY [0..LineBuf] OF ARRAY [0..255] OF CHAR ;
(* Need two lines since the delimiter of the CurrentSymbol *)
(* maybe on the next line. *)
HighNext : CARDINAL ; (* Length of the NextChar line. *)
CurLine : CARDINAL ; (* Line number of the Current Char Line. *)
NextLine : CARDINAL ; (* Line number of the Next Char Line. *)
IndexCur : CARDINAL ; (* Index to the Lines array for Current Ln *)
IndexNext : CARDINAL ; (* Index to the Lines array for NextChar Ln *)
CurSym : CARDINAL ; (* Character start of the CurrentSymbol *)
CurSymLine : CARDINAL ; (* Line number of the CurrentSymbol *)
CurCharIndex : CARDINAL ; (* Character number of CurChar. *)
NextCharIndex : CARDINAL ; (* Character number of NextChar. *)
Eof : BOOLEAN ; (* End of source file. *)
InQuotes : BOOLEAN ; (* If we are in quotes. *)
QuoteChar : CHAR ; (* Quote character expected. *)
Stack : ARRAY [0..MaxStack] OF ARRAY [0..255] OF CHAR ;
StackPtr : CARDINAL ;
(*
IsSym - returns the result of the comparison between CurrentSymbol
and Name.
*)
PROCEDURE IsSym (Name: ARRAY OF CHAR) : BOOLEAN ;
BEGIN
RETURN( StrEqual(CurrentSymbol, Name) )
END IsSym ;
(*
SymIs - if Name is equal to the CurrentSymbol the next Symbol is read
and true is returned, otherwise false is returned.
*)
PROCEDURE SymIs (Name: ARRAY OF CHAR) : BOOLEAN ;
BEGIN
IF StrEqual(CurrentSymbol, Name)
THEN
GetSymbol ;
RETURN( TRUE )
ELSE
RETURN( FALSE )
END
END SymIs ;
(*
WriteError - displays the source line and points to the symbol in error.
The message, a, is displayed.
*)
PROCEDURE WriteError (a: ARRAY OF CHAR) ;
VAR
i: CARDINAL ;
BEGIN
WriteString(FileName) ; Write(':') ; WriteCard(CurSymLine, 0) ; Write(':') ; WriteString(a) ;
WriteLn ;
WriteString( Lines[IndexCur] ) ; WriteLn ;
i := CurSym ;
WHILE i>0 DO
Write(' ') ;
DEC(i)
END ;
i := StrLen(CurrentSymbol) ;
WHILE i>0 DO
Write('^') ;
DEC(i)
END ;
WriteLn ;
WriteString(a) ; WriteLn ;
END WriteError ;
(*
OpenSource - Attempts to open the source file, a.
The success of the operation is returned.
*)
PROCEDURE OpenSource (a: ARRAY OF CHAR) : BOOLEAN ;
BEGIN
f := OpenToRead(a) ;
IF IsNoError(f)
THEN
StrCopy(a, FileName) ;
Opened := TRUE ;
Init ;
RETURN( TRUE )
ELSE
Opened := FALSE ;
Eof := TRUE ;
RETURN( FALSE )
END
END OpenSource ;
(*
CloseSource - Closes the current open file.
*)
PROCEDURE CloseSource ;
BEGIN
IF Opened=TRUE
THEN
Opened := FALSE ;
Close( f )
END
END CloseSource ;
(*
GetSymbol - gets the next Symbol into CurrentSymbol.
*)
PROCEDURE GetSymbol ;
BEGIN
StrCopy( CurrentSymbol, LastSymbol ) ;
IF StackPtr>0
THEN
DEC(StackPtr) ;
StrCopy( Stack[StackPtr], CurrentSymbol )
ELSE
ReadSymbol( CurrentSymbol )
END
END GetSymbol ;
(*
PutSymbol - pushes a symbol, Name, back onto the input.
GetSymbol will set CurrentSymbol to, Name.
*)
PROCEDURE PutSymbol (Name: ARRAY OF CHAR) ;
BEGIN
IF StackPtr=MaxStack
THEN
WriteError('Maximum push back symbol exceeded - Increase CONST MaxStack')
ELSE
StrCopy(Name, Stack[StackPtr]) ;
INC(StackPtr)
END
END PutSymbol ;
PROCEDURE ReadSymbol (VAR a: ARRAY OF CHAR) ;
VAR
high,
i : CARDINAL ;
ok : BOOLEAN ;
BEGIN
high := HIGH(a) ;
IF NOT Eof
THEN
IF InQuotes
THEN
i := 0 ;
IF CurrentChar=QuoteChar
THEN
InQuotes := FALSE ;
a[i] := QuoteChar ;
INC(i) ;
AdvanceChar
ELSE
(* Fill in string or character *)
i := 0 ;
REPEAT
a[i] := CurrentChar ;
INC(i) ;
AdvanceChar
UNTIL (CurrentChar=QuoteChar) OR Eof OR (i>high) ;
END
ELSE
(* Get rid of all excess spaces *)
REPEAT
IF CurrentChar=' '
THEN
WHILE (CurrentChar=' ') AND (NOT Eof) DO
AdvanceChar
END ;
ok := FALSE
ELSIF (CurrentChar='(') AND (NextChar='*')
THEN
ConsumeComments ;
ok := FALSE
ELSE
ok := TRUE
END
UNTIL ok ;
i := 0 ;
CurSym := CurCharIndex ;
CurSymLine := CurLine ;
IF (CurrentChar='"') OR (CurrentChar="'")
THEN
InQuotes := TRUE ;
QuoteChar := CurrentChar ;
a[i] := CurrentChar ;
AdvanceChar ;
INC(i)
ELSIF DoubleDelimiter()
THEN
a[i] := CurrentChar ;
AdvanceChar ;
INC(i) ;
a[i] := CurrentChar ;
AdvanceChar ;
INC(i)
ELSIF Delimiter()
THEN
a[i] := CurrentChar ;
AdvanceChar ;
INC(i)
ELSE
REPEAT
a[i] := CurrentChar ;
AdvanceChar ;
INC(i)
UNTIL Delimiter() OR (i>high) OR (CurrentChar=' ') OR Eof
END
END
ELSE
(* eof *)
i := 0 ;
a[i] := eof ;
INC(i)
END ;
IF i<=HIGH(a)
THEN
a[i] := nul
END
END ReadSymbol ;
(*
ConsumeComments - consumes Modula-2 comments.
*)
PROCEDURE ConsumeComments ;
VAR
Level: CARDINAL ;
BEGIN
Level := 0 ;
REPEAT
IF (CurrentChar='(') AND (NextChar='*')
THEN
INC(Level)
ELSIF (CurrentChar='*') AND (NextChar=')')
THEN
DEC(Level)
END ;
AdvanceChar ;
UNTIL (Level=0) OR Eof ;
AdvanceChar
END ConsumeComments;
(* Delimiter returns true if and only if CurrentChar is a delimiter *)
PROCEDURE Delimiter() : BOOLEAN ;
BEGIN
IF (CurrentChar='-') OR
(CurrentChar='+') OR (CurrentChar='*') OR (CurrentChar='\') OR
(CurrentChar='|') OR (CurrentChar='(') OR (CurrentChar=')') OR
(CurrentChar='"') OR (CurrentChar="'") OR (CurrentChar='{')
THEN
RETURN( TRUE )
ELSIF
(CurrentChar='}') OR (CurrentChar='[') OR (CurrentChar=']') OR
(CurrentChar='#') OR (CurrentChar='=') OR (CurrentChar='<')
THEN
RETURN( TRUE )
ELSIF
(CurrentChar='>') OR (CurrentChar='.') OR (CurrentChar=';') OR
(CurrentChar=':') OR (CurrentChar='^') OR (CurrentChar=',')
THEN
RETURN( TRUE )
ELSE
RETURN( FALSE )
END
END Delimiter ;
PROCEDURE DoubleDelimiter () : BOOLEAN ;
BEGIN
RETURN (
((CurrentChar='>') AND (NextChar='=')) OR
((CurrentChar='<') AND (NextChar='=')) OR
((CurrentChar='<') AND (NextChar='>')) OR
((CurrentChar=':') AND (NextChar='=')) OR
((CurrentChar='.') AND (NextChar='.'))
)
END DoubleDelimiter ;
PROCEDURE AdvanceChar ;
BEGIN
IF NOT Eof
THEN
CurrentChar := NextChar ;
CurCharIndex := NextCharIndex ;
IndexCur := IndexNext ;
CurLine := NextLine ;
IF CurrentChar=eof
THEN
Eof := TRUE
ELSIF NextCharIndex=HighNext
THEN
IndexNext := (IndexCur+1) MOD Wrap ;
HighNext := 0 ;
REPEAT
NextChar := ReadChar(f) ;
IF NOT IsNoError(f)
THEN
NextChar := eof ;
Lines[IndexNext][HighNext] := NextChar ;
INC( HighNext )
END ;
WHILE (NextChar#eof) AND (NextChar#lf) AND (NextChar#cr) AND (HighNext<MaxLine) DO
Lines[IndexNext][HighNext] := NextChar ;
INC( HighNext ) ;
NextChar := ReadChar(f) ;
IF NOT IsNoError(f)
THEN
NextChar := eof
END
END ;
IF (NextChar=eof) OR (NextChar=lf) OR (NextChar=cr)
THEN
IF InQuotes
THEN
Lines[IndexNext][HighNext] := ' ' ; (* Space for delimiter *)
Lines[IndexNext][HighNext+1] := nul ;
WriteError('missing end of quote on this source line') ; HALT
END ;
INC( NextLine )
END
UNTIL HighNext>0 ;
IF HighNext>=MaxLine THEN WriteError('Line too long') ; HALT END ;
Lines[IndexNext][HighNext] := ' ' ; (* Space for delimiter *)
Lines[IndexNext][HighNext+1] := nul ;
NextCharIndex := 0 ;
NextChar := Lines[IndexNext][NextCharIndex]
ELSE
INC(NextCharIndex) ;
NextChar := Lines[IndexNext][NextCharIndex]
END
END
END AdvanceChar ;
PROCEDURE Init ;
BEGIN
StackPtr := 0 ;
InQuotes := FALSE ;
Eof := FALSE ;
IndexCur := 1 ;
IndexNext := 0 ;
CurCharIndex := 0 ;
Lines[IndexCur][0] := nul ;
HighNext := 0 ;
NextCharIndex := 0 ;
CurLine := 1 ;
NextLine := 1 ;
CurrentChar := ' ' ;
NextChar := ' ' ;
StrCopy("", CurrentSymbol) ;
StrCopy("", LastSymbol) ;
IndexCur := IndexNext
END Init ;
BEGIN
Init
END M2Lex.

Some files were not shown because too many files have changed in this diff Show More