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>