diff options
author | Gaius Mulley <gaiusmod2@gmail.com> | 2024-09-16 13:57:34 +0100 |
---|---|---|
committer | Gaius Mulley <gaiusmod2@gmail.com> | 2024-09-16 13:57:34 +0100 |
commit | f6e629a7134c6b83be4542b8cd26b7c4483d17f4 (patch) | |
tree | 8eaff5c6ee38c96492397ab6df9953bff4c0d876 /gcc/m2/gm2-gcc | |
parent | 7fb1117310def905f8d151196b8655247dff68ee (diff) | |
download | gcc-f6e629a7134c6b83be4542b8cd26b7c4483d17f4.zip gcc-f6e629a7134c6b83be4542b8cd26b7c4483d17f4.tar.gz gcc-f6e629a7134c6b83be4542b8cd26b7c4483d17f4.tar.bz2 |
PR modula2/116181 Use GCC tree location_t and separate pointer types
This patch fixes all remaining -Wodr warnings in the modula-2 front end.
It removes the m2 Tree and m2 Location definitions and uses tree and
location_t throughout. This allows the bootstrap tool mc to pick up the
GCC definitions for these data types (for the C translation of m2 sources).
The patch introduces a new module CDataTypes which contain two pointer
types: CharStar and ConstCharStar. These map onto their C counterparts
when processed by mc however currently gm2 treats them as ADDRESS.
It might be sensible to have the gm2 versions of these data types
implemented though a builtin module in the future.
gcc/m2/ChangeLog:
PR modula2/116181
* Make-lang.in (GM2-GCC-DEFS): Add gcctypes.def and
CDataTypes.def.
(MC-LIB-DEFS): Add CDataTypes.def.
* Make-maintainer.in (m2/gm2-pge-boot/$(SRC_PREFIX)M2RTS.o):
Change include path to pge-boot.
(m2/gm2-pge-boot/$(SRC_PREFIX)SymbolKey.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)NameKey.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)Lists.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)Output.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)bnflex.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)RTentity.h): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)RTentity.o): Ditto.
(m2/gm2-pge-boot/$(SRC_PREFIX)%.o): Ditto.
(GM2PATH): Add -I$(srcdir)/m2/gm2-gcc.
(m2/mc-boot-gen/$(SRC_PREFIX)%.h): Add -I$(srcdir)/m2/gm2-gcc.
(m2/mc-boot-gen/$(SRC_PREFIX)%.cc): Ditto.
* gm2-compiler/M2ALU.def (PushIntegerTree): Replace Tree with tree.
(PopIntegerTree): Ditto.
(PushRealTree): Ditto.
(PopRealTree): Ditto.
(PushComplexTree): Ditto.
(PopComplexTree): Ditto.
(PushSetTree): Ditto.
(PopSetTree): Ditto.
(PopConstructorTree): Ditto.
(ConstructSetConstant): Ditto.
(BuildRange): Ditto.
(CheckOrResetOverflow): Ditto.
(PushTypeOfTree): Ditto.
* gm2-compiler/M2ALU.mod (Tree): Replace with ...
(tree): ... this.
(gcctypes): Import location_t and tree.
(m2linemap): Remove import of location_t.
* gm2-compiler/M2Base.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2Base.mod (gcctypes): Import of location_t.
(m2linemap): Remove import of location_t.
* gm2-compiler/M2Bitset.mod (m2tree): Remove import of Tree.
* gm2-compiler/M2CaseList.mod (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2Emit.def (gcctypes): Import location_t.
* gm2-compiler/M2GCCDeclare.def (gcctypes): Import tree.
(PromoteToString): Replace Tree with tree.
(PromoteToCString): Ditto.
(ConstantKnownAndUsed): Ditto.
* gm2-compiler/M2GCCDeclare.mod (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2GenGCC.def (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
(GetHighFromUnbounded): Replace Tree with tree.
(StringToChar): Ditto.
(LValueToGenericPtr): Ditto.
(ZConstToTypedConst): Ditto.
(PrepareCopyString): Ditto.
* gm2-compiler/M2GenGCC.mod (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2LangDump.def (gcctypes): Import tree.
(m2tree): Remove import of Tree.
(Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2LangDump.mod (Tree): Replace with ...
(tree): ... this.
* gm2-compiler/M2LexBuf.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2LexBuf.mod (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2Options.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2Options.mod (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2Range.def (m2linemap): Replace with ...
(gcctypes): ... this.
(CDataTypes): Import ConstCharStar.
(CodeErrorCheck): Replace Tree with tree.
(OverlapsRange): Ditto.
(IsEqual): Ditto.
(IsGreaterOrEqual): Ditto.
(IsGreater): Ditto.
(BuildIfCallWholeHandlerLoc): Replace Tree with tree.
Replace ADDRESS with ConstCharStar.
(BuildIfCallRealHandlerLoc): Ditto.
(GetMinMax): Ditto.
* gm2-compiler/M2Range.mod (m2tree): Remove Tree.
(CodeErrorCheck): Replace Tree with tree.
(OverlapsRange): Ditto.
(IsEqual): Ditto.
(IsGreaterOrEqual): Ditto.
(IsGreater): Ditto.
(GetMinMax): Ditto.
(BuildIfCallWholeHandlerLoc): Replace Tree with tree.
Replace ADDRESS with ConstCharStar.
(BuildIfCallRealHandlerLoc): Ditto.
* gm2-compiler/M2System.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/M2System.mod (m2linemap): Replace with ...
(gcctypes): ... this.
(CreateMinMaxFor): Replace Tree with tree.
(CreateType): Ditto.
(AttemptToCreateType): Ditto.
(CreateSetType): Ditto.
(AttemptToCreateSetType): Ditto.
* gm2-compiler/P2SymBuild.mod (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-compiler/SymbolConversion.def (m2tree): Replace with ...
(gcctypes): ... this.
(Mod2Gcc): Replace Tree with tree.
(Gcc2Mod): Ditto.
(AddModGcc): Ditto.
* gm2-compiler/SymbolConversion.mod (m2tree): Replace with ...
(gcctypes): ... this.
(Mod2Gcc): Replace Tree with tree.
(Gcc2Mod): Ditto.
(AddModGcc): Ditto.
(Mod2GccWithoutGCCPoison): Ditto.
* gm2-compiler/SymbolTable.def (m2tree): Replace with ...
(gcctypes): ... this.
(PutModuleFinallyFunction): Replace Tree with tree.
(GetModuleFinallyFunction): Ditto.
* gm2-compiler/SymbolTable.mod (m2tree): Replace with ...
(gcctypes): ... this.
(PutModuleFinallyFunction): Replace Tree with tree.
(GetModuleFinallyFunction): Ditto.
* gm2-compiler/m2flex.def (m2linemap): Replace with ...
(gcctypes): ... this.
* gm2-gcc/init.def (PerCompilationInit): Replace ADDRESS with ConstCharStar.
(CDataTypes): Import ConstCharStar.
* gm2-gcc/m2block.def (SYSTEM): Remove import.
(CDataTypes): Import ConstCharStar.
(m2linemap): Remove import.
(m2tree): Remove import.
(gcctypes): Import tree.
(global_constant): Replace Tree with tree.
(RememberInitModuleFunction): Ditto.
(DumpGlobalConstants): Ditto.
(RememberConstant): Ditto.
(RememberType): Ditto.
(pushDecl): Ditto.
(popFunctionScope): Ditto.
(pushFunctionScope): Ditto.
(finishFunctionCode): Ditto.
(finishFunctionDecl): Ditto.
(GetErrorNode): Ditto.
(includeDecl): Ditto.
(GetGlobals): Ditto.
(GetGlobalContext): Ditto.
(begin_statement_list): Ditto.
(push_statement_list): Ditto.
(pop_statement_list): Ditto.
(getLabel): Replace Tree with tree.
Replace ADDRESS with ConstCharStar.
* gm2-gcc/m2builtins.def (CDataTypes): Import ConstCharStar.
(GetBuiltinConst): Replace Tree with tree.
(GetBuiltinConstType): Ditto.
(GetBuiltinTypeInfoType): Ditto.
(GetBuiltinTypeInfo): Ditto.
(BuiltinExists): Ditto.
(BuildBuiltinTree): Ditto.
(BuiltinMemCopy): Ditto.
(BuiltinMemSet): Ditto.
(BuiltInAlloca): Ditto.
(BuiltInIsfinite): Ditto.
* gm2-gcc/m2convert.def (CDataTypes): Import ConstCharStar.
(ToWord): Ditto.
(ToCardinal): Ditto.
(ToInteger): Ditto.
(ToBitset): Ditto.
(ConvertToPtr): Ditto.
(BuildConvert): Ditto.
(ConvertConstantAndCheck): Ditto.
(ConvertString): Ditto.
(GenericToType): Ditto.
* gm2-gcc/m2decl.cc (m2decl_BuildParameterDeclaration): Add
const attribute.
* gm2-gcc/m2decl.def (CDataTypes): Import ConstCharStar.
(BuildModuleCtor): Ditto.
(DeclareModuleCtor): Ditto.
(DeclareM2linkForcedModuleInitOrder): Ditto.
(DeclareM2linkStaticInitialization): Ditto.
(BuildPtrToTypeString): Ditto.
(BuildIntegerConstant): Ditto.
(BuildStringConstantType): Ditto.
(DeclareKnownVariable): Ditto.
(DeclareKnownConstant): Ditto.
(BuildParameterDeclaration): Ditto.
(BuildEndFunctionDeclaration): Ditto.
(RememberVariables): Ditto.
(BuildConstLiteralNumber): Ditto.
(BuildStringConstant): Ditto.
(BuildCStringConstant): Ditto.
(GetDeclContext): Ditto.
* gm2-gcc/m2decl.h (m2decl_BuildParameterDeclaration): Add
const attribute.
* gm2-gcc/m2except.def (CDataTypes): Import ConstCharStar.
(BuildThrow): Ditto.
(BuildTryBegin): Ditto.
(BuildTryEnd): Ditto.
(BuildCatchBegin): Ditto.
(BuildCatchEnd): Ditto.
* gm2-gcc/m2expr.def (CDataTypes): Import ConstCharStar.
(CSTIntToString): Ditto.
(CSTIntToChar): Ditto.
(CheckConstStrZtypeRange): Ditto.
(CompareTrees): Ditto.
(GetPointerOne): Ditto.
(GetPointerZero): Ditto.
(GetWordOne): Ditto.
(GetWordZero): Ditto.
(GetIntegerOne): Ditto.
(GetIntegerZero): Ditto.
(GetCardinalOne): Ditto.
(GetCardinalZero): Ditto.
(GetSizeOfInBits): Ditto.
(GetSizeOf): Ditto.
(BuildLogicalRotate): Ditto.
(BuildLRRn): Ditto.
(BuildLRLn): Ditto.
(BuildMask): Ditto.
(BuildMult): Ditto.
(BuildMultCheck): Ditto.
(BuildLRR): Ditto.
(BuildLRL): Ditto.
(BuildLogicalShift): Ditto.
(BuildLSR): Ditto.
(BuildLSL): Ditto.
(BuildDivM2): Ditto.
(BuildDivM2Check): Ditto.
(BuildModM2): Ditto.
(BuildModM2Check): Ditto.
(BuildModFloor): Ditto.
(BuildDivCeil): Ditto.
(BuildModCeil): Ditto.
(BuildDivFloor): Ditto.
(BuildModTrunc): Ditto.
(BuildDivTrunc): Ditto.
(BuildDivTruncCheck): Ditto.
(BuildRDiv): Ditto.
(BuildSubCheck): Ditto.
(BuildAddCheck): Ditto.
(BuildSub): Ditto.
(BuildAdd): Ditto.
(FoldAndStrip): Ditto.
(StringLength): Ditto.
(TreeOverflow): Ditto.
(RemoveOverflow): Ditto.
(BuildCoerce): Ditto.
(BuildTrunc): Ditto.
(BuildNegate): Ditto.
(BuildNegateCheck): Ditto.
(BuildSetNegate): Ditto.
(BuildTBitSize): Ditto.
(BuildSize): Ditto.
(BuildAddr): Ditto.
(BuildOffset1): Ditto.
(BuildOffset): Ditto.
(BuildLogicalOrAddress): Ditto.
(BuildLogicalOr): Ditto.
(BuildLogicalAnd): Ditto.
(BuildSymmetricDifference): Ditto.
(BuildLogicalDifference): Ditto.
(BuildLessThan): Ditto.
(BuildGreaterThan): Ditto.
(BuildLessThanOrEqual): Ditto.
(BuildGreaterThanOrEqual): Ditto.
(BuildEqualTo): Ditto.
(BuildNotEqualTo): Ditto.
(BuildIsSuperset): Ditto.
(BuildIsNotSuperset): Ditto.
(BuildIsSubset): Ditto.
(BuildIsNotSubset): Ditto.
(BuildIfConstInVar): Ditto.
(BuildIfNotConstInVar): Ditto.
(BuildIfVarInVar): Ditto.
(BuildIfNotVarInVar): Ditto.
(BuildForeachWordInSetDoIfExpr): Ditto.
(BuildIfInRangeGoto): Ditto.
(BuildIfNotInRangeGoto): Ditto.
(BuildArray): Ditto.
(BuildComponentRef): Ditto.
(BuildIndirect): Ditto.
(IsTrue): Ditto.
(IsFalse): Ditto.
(GetCstInteger): Ditto.
(AreConstantsEqual): Ditto.
(AreRealOrComplexConstantsEqual): Ditto.
(DetermineSign): Ditto.
(BuildCap): Ditto.
(BuildAbs): Ditto.
(BuildRe): Ditto.
(BuildIm): Ditto.
(BuildCmplx): Ditto.
(BuildBinaryForeachWordDo): Ditto.
(BuildBinarySetDo): Ditto.
(ConstantExpressionWarning): Ditto.
(BuildAddAddress): Ditto.
(calcNbits): Ditto.
(OverflowZType): Ditto.
(BuildCondIfExpression): Ditto.
* gm2-gcc/m2linemap.def (CDataTypes): Import ConstCharStar.
* gm2-gcc/m2misc.def (m2tree): Replace with ...
(gcctypes): ... this.
(DebugTree): Replace Tree with tree.
* gm2-gcc/m2pp.def (m2tree): Replace with ...
(gcctypes): ... this.
(DumpGimpleFd): Replace Tree with tree.
* gm2-gcc/m2statement.cc (m2statement_BuildBuiltinCallTree):
Remove unused location parameter.
* gm2-gcc/m2statement.def (m2linemap): Replace with ...
(gcctypes): ... this.
(CDataTypes): Import CharStar.
(DoJump): Replace Tree with tree.
Replace ADDRESS with CharStar.
(BuildStartFunctionCode): Replace Tree with tree.
(BuildEndFunctionCode): Ditto.
(BuildReturnValueCode): Ditto.
(BuildAssignmentTree): Ditto.
(BuildAssignmentStatement): Ditto.
(BuildGoto): Ditto.
(DeclareLabel): Ditto.
(BuildIfThenDoEnd): Ditto.
(BuildIfThenElseEnd): Ditto.
(BuildParam): Ditto.
(BuildFunctionCallTree): Ditto.
(BuildProcedureCallTree): Ditto.
(BuildIndirectProcedureCallTree): Ditto.
(BuildFunctValue): Ditto.
(BuildCall2): Ditto.
(BuildCall3): Ditto.
(SetLastFunction): Ditto.
(GetLastFunction): Ditto.
(GetParamTree): Ditto.
(BuildTryFinally): Ditto.
(BuildCleanUp): Ditto.
(BuildAsm): Ditto.
(BuildUnaryForeachWordDo): Ditto.
(BuildExcludeVarConst): Ditto.
(BuildExcludeVarVar): Ditto.
(BuildIncludeVarConst): Ditto.
(BuildIncludeVarVar): Ditto.
(BuildStart): Ditto.
(BuildEnd): Ditto.
(BuildCallInner): Ditto.
(BuildBuiltinCallTree): Remove unused location parameter.
* gm2-gcc/m2statement.h (m2statement_BuildBuiltinCallTree): Remove
unused location parameter.
* gm2-gcc/m2tree.def (gcctypes): Import tree.
(IsAConstant): Replace Tree with tree.
(IsOrdinal): Ditto.
(IsTreeOverflow): Ditto.
(skip_const_decl): Ditto.
(skip_type_decl): Ditto.
(is_type): Ditto.
(is_array): Ditto.
(is_var): Ditto.
(debug_tree): Ditto.
(IstreeOverflow): Ditto.
* gm2-gcc/m2treelib.def (m2linemap): Replace with ...
(gcctypes): ... this.
(get_set_address_if_var): Ditto.
(get_set_field_rhs): Ditto.
(get_set_field_lhs): Ditto.
(get_set_address): Ditto.
(get_set_value): Ditto.
(get_field_no): Ditto.
(get_rvalue): Ditto.
(DoCall): Ditto.
(build_modify_expr): Ditto.
(do_jump_if_bit): Ditto.
* gm2-gcc/m2type.def (m2linemap): Replace with ...
(gcctypes): ... this.
(m2tree): Remove.
(CDataTypes): Import ConstCharStar and charStar.
(ValueInTypeRange): Replace Tree with tree.
(ValueOutOfTypeRange): Ditto.
(ExceedsTypeRange): Ditto.
(WithinTypeRange): Ditto.
(BuildSubrangeType): Ditto.
(BuildCharConstant): Ditto.
(BuildCharConstantChar): Ditto.
(BuildArrayConstructorElement): Ditto.
(BuildEndArrayConstructor): Ditto.
(BuildStartArrayConstructor): Ditto.
(BuildRecordConstructorElement): Ditto.
(BuildEndRecordConstructor): Ditto.
(BuildStartRecordConstructor): Ditto.
(BuildEndSetConstructor): Ditto.
(BuildSetConstructorElement): Ditto.
(BuildStartSetConstructor): Ditto.
(BuildSetType): Ditto.
(BuildConstPointerType): Ditto.
(BuildPointerType): Ditto.
(BuildEnumerator): Ditto.
(BuildEndEnumeration): Ditto.
(BuildStartEnumeration): Ditto.
(BuildTypeDeclaration): Ditto.
(GetMaxFrom): Ditto.
(GetMinFrom): Ditto.
(GetDefaultType): Ditto.
(BuildEndType): Ditto.
(BuildStartType): Ditto.
(BuildVariableArrayAndDeclare): Ditto.
(BuildProcTypeParameterDeclaration): Ditto.
(BuildStartFunctionType): Ditto.
(BuildEndFunctionType): Ditto.
(GetTreeType): Ditto.
(DeclareKnownType): Ditto.
(GetM2ZType): Ditto.
(GetM2RType): Ditto.
(BuildSetTypeFromSubrange): Ditto.
(BuildSmallestTypeRange): Ditto.
(GetBooleanType): Ditto.
(GetBooleanFalse): Ditto.
(GetBooleanTrue): Ditto.
(GetPackedBooleanType): Ditto.
(GetCharType): Ditto.
(GetByteType): Ditto.
(GetVoidType): Ditto.
(GetBitnumType): Ditto.
(GetRealType): Ditto.
(GetLongRealType): Ditto.
(GetShortRealType): Ditto.
(GetLongIntType): Ditto.
(GetPointerType): Ditto.
(GetCardinalType): Ditto.
(GetIntegerType): Ditto.
(GetWordType): Ditto.
(GetM2CardinalType): Ditto.
(GetBitsetType): Ditto.
(GetM2CType): Ditto.
(GetProcType): Ditto.
(GetM2ComplexType): Ditto.
(GetM2LongComplexType): Ditto.
(GetM2ShortComplexType): Ditto.
(GetM2Complex128): Ditto.
(GetM2Complex96): Ditto.
(GetM2Complex64): Ditto.
(GetM2Complex32): Ditto.
(GetM2Real128): Ditto.
(GetM2Real96): Ditto.
(GetM2Real64): Ditto.
(GetM2Real32): Ditto.
(GetM2Bitset32): Ditto.
(GetM2Bitset16): Ditto.
(GetM2Bitset8): Ditto.
(GetM2Word64): Ditto.
(GetM2Word32): Ditto.
(GetM2Word16): Ditto.
(GetM2Cardinal64): Ditto.
(GetM2Cardinal32): Ditto.
(GetM2Cardinal16): Ditto.
(GetM2Cardinal8): Ditto.
(GetM2Integer64): Ditto.
(GetM2Integer32): Ditto.
(GetM2Integer16): Ditto.
(GetM2Integer8): Ditto.
(GetISOLocType): Ditto.
(GetISOByteType): Ditto.
(GetISOWordType): Ditto.
(GetShortCardType): Ditto.
(GetM2ShortCardType): Ditto.
(GetShortIntType): Ditto.
(GetM2ShortIntType): Ditto.
(GetM2LongCardType): Ditto.
(GetM2LongIntType): Ditto.
(GetM2LongRealType): Ditto.
(GetM2RealType): Ditto.
(GetM2ShortRealType): Ditto.
(GetM2IntegerType): Ditto.
(GetM2CharType): Ditto.
(GetCSizeTType): Ditto.
(GetCSSizeTType): Ditto.
(BuildArrayStringConstructor): Ditto.
(RealToTree): Ditto.
(BuildStartRecord): Ditto.
(BuildStartUnion): Ditto.
(BuildStartVarient): Ditto.
(BuildEndVarient): Ditto.
(BuildStartFieldVarient): Ditto.
(BuildEndFieldVarient): Ditto.
(BuildStartFieldRecord): Ditto.
(BuildFieldRecord): Ditto.
(ChainOn): Ditto.
(ChainOnParamValue): Ditto.
(AddStringToTreeList): Ditto.
(BuildEndRecord): Ditto.
(SetAlignment): Ditto.
(SetDeclPacked): Ditto.
(SetTypePacked): Ditto.
(SetRecordFieldOffset): Ditto.
(BuildPackedFieldRecord): Ditto.
(BuildNumberOfArrayElements): Ditto.
(AddStatement): Ditto.
(MarkFunctionReferenced): Ditto.
(BuildArrayIndexType): Ditto.
(GetArrayNoOfElements): Ditto.
(BuildEndArrayType): Ditto.
(PutArrayType): Ditto.
(BuildStartArrayType): Ditto.
(IsAddress): Ditto.
(SameRealType): Ditto.
* m2.flex (Gm2linemap.h): Include.
* mc-boot/GDynamicStrings.cc: Rebuild.
* mc-boot/GFIO.cc: Ditto.
* mc-boot/GIndexing.cc: Ditto.
* mc-boot/GM2Dependent.cc: Ditto.
* mc-boot/GSArgs.cc: Ditto.
* mc-boot/GStringConvert.cc: Ditto.
* mc-boot/Gdecl.cc: Ditto.
* mc-boot/Gdecl.h: Ditto.
* mc-boot/Gdtoa.h: Ditto.
* mc-boot/Gkeyc.cc: Ditto.
* mc-boot/Gkeyc.h: Ditto.
* mc-boot/Glibc.h: Ditto.
* mc-boot/GmcComp.cc: Ditto.
* mc-boot/GmcLexBuf.cc: Ditto.
* mc-boot/GmcPreprocess.cc: Ditto.
* mc-boot/GmcStream.cc: Ditto.
* mc-boot/Gmcp1.cc: Ditto.
* mc-boot/Gmcp3.cc: Ditto.
* mc-boot/Gmcp4.cc: Ditto.
* mc-boot/Gmcp5.cc: Ditto.
* mc-boot/GnameKey.cc: Ditto.
* mc-boot/Gvarargs.cc: Ditto.
* mc/decl.def (putDefUnqualified): New procedure function.
(isDefUnqualified): Ditto.
* mc/decl.mod (defT): Add unqualified field.
(charStarN): New variable.
(constCharStarN): Ditto.
(checkGccType): New procedure.
(checkCDataTypes): Ditto.
(import): Call checkGccType and checkCDataTypes.
(putDefUnqualified): New procedure function.
(isDefUnqualified): Ditto.
* mc/keyc.def (useGccTree): New procedure.
(useGccLocation): Ditto.
* mc/keyc.mod (checkGccConfigSystem): Call checkGccConfigSystem.
(useGccTree): New procedure.
(useGccLocation): Ditto.
* mc/mcp1.bnf (decl): Import putDefUnqualified.
(Export): Call putDefUnqualified.
* gm2-gcc/CDataTypes.def: New file.
* gm2-gcc/gcctypes.def: New file.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'gcc/m2/gm2-gcc')
-rw-r--r-- | gcc/m2/gm2-gcc/CDataTypes.def | 33 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/gcctypes.def | 36 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/init.def | 4 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2block.def | 42 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2builtins.def | 39 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2convert.def | 21 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2decl.cc | 2 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2decl.def | 44 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2decl.h | 2 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2except.def | 13 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2expr.def | 228 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2linemap.def | 8 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2misc.def | 4 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2pp.def | 4 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2statement.cc | 2 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2statement.def | 72 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2statement.h | 2 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2tree.def | 26 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2treelib.def | 23 | ||||
-rw-r--r-- | gcc/m2/gm2-gcc/m2type.def | 269 |
20 files changed, 465 insertions, 409 deletions
diff --git a/gcc/m2/gm2-gcc/CDataTypes.def b/gcc/m2/gm2-gcc/CDataTypes.def new file mode 100644 index 0000000..38953d7 --- /dev/null +++ b/gcc/m2/gm2-gcc/CDataTypes.def @@ -0,0 +1,33 @@ +(* CDataTypes provides a placeholder module for C address types. + +Copyright (C) 2024 Free Software Foundation, Inc. +Contributed by Gaius Mulley <gaiusmod2@gmail.com>. + +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 CDataTypes ; (*!m2pim*) + +FROM SYSTEM IMPORT ADDRESS ; + +EXPORT UNQUALIFIED CharStar, ConstCharStar ; + +TYPE + CharStar = ADDRESS ; + ConstCharStar = ADDRESS ; + + +END CDataTypes. diff --git a/gcc/m2/gm2-gcc/gcctypes.def b/gcc/m2/gm2-gcc/gcctypes.def new file mode 100644 index 0000000..e606572 --- /dev/null +++ b/gcc/m2/gm2-gcc/gcctypes.def @@ -0,0 +1,36 @@ +(* gcctypes provides a placeholder module for gcc declared data types. + +Copyright (C) 2024 Free Software Foundation, Inc. +Contributed by Gaius Mulley <gaiusmod2@gmail.com>. + +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 gcctypes ; + +FROM SYSTEM IMPORT ADDRESS ; + +EXPORT UNQUALIFIED location_t, tree ; + + +TYPE + (* Not declared here by the bootstrap tool mc when + --gcc-config-system is used. *) + location_t = CARDINAL ; + tree = ADDRESS ; + + +END gcctypes. diff --git a/gcc/m2/gm2-gcc/init.def b/gcc/m2/gm2-gcc/init.def index 37972ee..680aafb 100644 --- a/gcc/m2/gm2-gcc/init.def +++ b/gcc/m2/gm2-gcc/init.def @@ -21,7 +21,7 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE FOR "C" init ; -FROM SYSTEM IMPORT ADDRESS ; +FROM CDataTypes IMPORT ConstCharStar ; (* @@ -37,7 +37,7 @@ PROCEDURE FrontEndInit ; This is to be called every time we compile a new file. *) -PROCEDURE PerCompilationInit (filename: ADDRESS) ; +PROCEDURE PerCompilationInit (filename: ConstCharStar) ; END init. diff --git a/gcc/m2/gm2-gcc/m2block.def b/gcc/m2/gm2-gcc/m2block.def index 1f195db..e16edad 100644 --- a/gcc/m2/gm2-gcc/m2block.def +++ b/gcc/m2/gm2-gcc/m2block.def @@ -21,10 +21,8 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE FOR "C" m2block ; - -FROM m2tree IMPORT Tree ; -FROM m2linemap IMPORT location_t ; -FROM SYSTEM IMPORT ADDRESS ; +FROM gcctypes IMPORT location_t, tree ; +FROM CDataTypes IMPORT CharStar ; (* @@ -46,7 +44,7 @@ PROCEDURE toplevel () : BOOLEAN ; in the global binding level. *) -PROCEDURE global_constant (t: Tree) : Tree ; +PROCEDURE global_constant (t: tree) : tree ; (* @@ -56,7 +54,7 @@ PROCEDURE global_constant (t: Tree) : Tree ; inside the current_binding_level I suspect. *) -PROCEDURE RememberInitModuleFunction (t: Tree) : Tree ; +PROCEDURE RememberInitModuleFunction (t: tree) : tree ; (* @@ -64,7 +62,7 @@ PROCEDURE RememberInitModuleFunction (t: Tree) : Tree ; poisoned. *) -PROCEDURE DumpGlobalConstants () : Tree ; +PROCEDURE DumpGlobalConstants () : tree ; (* @@ -74,21 +72,21 @@ PROCEDURE DumpGlobalConstants () : Tree ; can be used by many different functions if necessary. *) -PROCEDURE RememberConstant (t: Tree) : Tree ; +PROCEDURE RememberConstant (t: tree) : tree ; (* RememberType - remember the type, t, in the ggc marked list. *) -PROCEDURE RememberType (t: Tree) : Tree ; +PROCEDURE RememberType (t: tree) : tree ; (* pushDecl - pushes a declaration onto the current binding level. *) -PROCEDURE pushDecl (decl: Tree) : Tree ; +PROCEDURE pushDecl (decl: tree) : tree ; (* @@ -113,14 +111,14 @@ PROCEDURE pushGlobalScope ; binding level. *) -PROCEDURE popFunctionScope () : Tree ; +PROCEDURE popFunctionScope () : tree ; (* pushFunctionScope - push a binding level. *) -PROCEDURE pushFunctionScope (fndecl: Tree) ; +PROCEDURE pushFunctionScope (fndecl: tree) ; (* @@ -129,7 +127,7 @@ PROCEDURE pushFunctionScope (fndecl: Tree) ; The cur_stmt_list is appended to the STATEMENT_LIST. *) -PROCEDURE finishFunctionCode (fndecl: Tree) ; +PROCEDURE finishFunctionCode (fndecl: tree) ; (* @@ -142,7 +140,7 @@ PROCEDURE finishFunctionCode (fndecl: Tree) ; containing the DECL_EXPR is also created. *) -PROCEDURE finishFunctionDecl (location: location_t; fndecl: Tree) ; +PROCEDURE finishFunctionDecl (location: location_t; fndecl: tree) ; (* @@ -150,14 +148,14 @@ PROCEDURE finishFunctionDecl (location: location_t; fndecl: Tree) ; in the current scope. *) -PROCEDURE getLabel (location: location_t; name: ADDRESS) : Tree ; +PROCEDURE getLabel (location: location_t; name: CharStar) : tree ; (* GetErrorNode - returns the gcc error_mark_node. *) -PROCEDURE GetErrorNode () : Tree ; +PROCEDURE GetErrorNode () : tree ; (* @@ -165,21 +163,21 @@ PROCEDURE GetErrorNode () : Tree ; it is not already present. *) -PROCEDURE includeDecl (decl: Tree) ; +PROCEDURE includeDecl (decl: tree) ; (* GetGlobals - returns a list of global variables, functions, constants. *) -PROCEDURE GetGlobals () : Tree ; +PROCEDURE GetGlobals () : tree ; (* GetGlobalContext - returns the global context tree. *) -PROCEDURE GetGlobalContext () : Tree ; +PROCEDURE GetGlobalContext () : tree ; (* @@ -187,7 +185,7 @@ PROCEDURE GetGlobalContext () : Tree ; statement list and returns the list node. *) -PROCEDURE begin_statement_list () : Tree ; +PROCEDURE begin_statement_list () : tree ; (* @@ -195,7 +193,7 @@ PROCEDURE begin_statement_list () : Tree ; current binding level. *) -PROCEDURE push_statement_list (t: Tree) : Tree ; +PROCEDURE push_statement_list (t: tree) : tree ; (* @@ -203,7 +201,7 @@ PROCEDURE push_statement_list (t: Tree) : Tree ; current binding level. *) -PROCEDURE pop_statement_list () : Tree ; +PROCEDURE pop_statement_list () : tree ; (* diff --git a/gcc/m2/gm2-gcc/m2builtins.def b/gcc/m2/gm2-gcc/m2builtins.def index defe003..c3e002a 100644 --- a/gcc/m2/gm2-gcc/m2builtins.def +++ b/gcc/m2/gm2-gcc/m2builtins.def @@ -21,9 +21,8 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE FOR "C" m2builtins ; -FROM SYSTEM IMPORT ADDRESS ; -FROM m2tree IMPORT Tree ; -FROM m2linemap IMPORT location_t ; +FROM CDataTypes IMPORT CharStar, ConstCharStar ; +FROM gcctypes IMPORT location_t, tree ; EXPORT QUALIFIED GetBuiltinConst, GetBuiltinConstType, GetBuiltinTypeInfoType, GetBuiltinTypeInfo, @@ -37,7 +36,7 @@ EXPORT QUALIFIED GetBuiltinConst, GetBuiltinConstType, NIL is returned if the constant is unknown. *) -PROCEDURE GetBuiltinConst (name: ADDRESS) : Tree ; +PROCEDURE GetBuiltinConst (name: CharStar) : tree ; (* @@ -48,7 +47,7 @@ PROCEDURE GetBuiltinConst (name: ADDRESS) : Tree ; 2 = real *) -PROCEDURE GetBuiltinConstType (name: ADDRESS) : CARDINAL ; +PROCEDURE GetBuiltinConstType (name: CharStar) : CARDINAL ; @@ -62,21 +61,21 @@ PROCEDURE GetBuiltinConstType (name: ADDRESS) : CARDINAL ; 3 if ident is large, small. *) -PROCEDURE GetBuiltinTypeInfoType (ident: ADDRESS) : CARDINAL ; +PROCEDURE GetBuiltinTypeInfoType (ident: ConstCharStar) : CARDINAL ; (* - GetBuiltinTypeInfo - returns a Tree value: + GetBuiltinTypeInfo - returns a tree value: NULL_TREE if ident is unknown. - boolean Tree if ident is IEC559, LIA1, ISO, IEEE, rounds, underflow, + boolean tree if ident is IEC559, LIA1, ISO, IEEE, rounds, underflow, exception, extend. - ZType Tree if ident is radix, places, exponentmin, exponentmax, + ZType tree if ident is radix, places, exponentmin, exponentmax, noofmodes. - RType Tree if ident is large, small. + RType tree if ident is large, small. *) -PROCEDURE GetBuiltinTypeInfo (location: location_t; type: Tree; ident: ADDRESS) : Tree ; +PROCEDURE GetBuiltinTypeInfo (location: location_t; type: tree; ident: ConstCharStar) : tree ; (* @@ -84,28 +83,28 @@ PROCEDURE GetBuiltinTypeInfo (location: location_t; type: Tree; ident: ADDRESS) for this target architecture. *) -PROCEDURE BuiltinExists (name: ADDRESS) : BOOLEAN ; +PROCEDURE BuiltinExists (name: CharStar) : BOOLEAN ; (* - BuildBuiltinTree - returns a Tree containing the builtin function, name. + BuildBuiltinTree - returns a tree containing the builtin function, name. *) -PROCEDURE BuildBuiltinTree (location: location_t; name: ADDRESS) : Tree ; +PROCEDURE BuildBuiltinTree (location: location_t; name: CharStar) : tree ; (* BuiltinMemCopy and BuiltinAlloca - are called by M2GenGCC to implement open arrays. *) -PROCEDURE BuiltinMemCopy (location: location_t; dest, src, n: Tree) : Tree ; +PROCEDURE BuiltinMemCopy (location: location_t; dest, src, n: tree) : tree ; (* BuiltinMemSet is called by M2GenGCC to implement the set type. *) -PROCEDURE BuiltinMemSet (location: location_t; dest, bytevalue, nbytes: Tree) : Tree ; +PROCEDURE BuiltinMemSet (location: location_t; dest, bytevalue, nbytes: tree) : tree ; (* @@ -113,16 +112,16 @@ PROCEDURE BuiltinMemSet (location: location_t; dest, bytevalue, nbytes: Tree) : of the current function. *) -PROCEDURE BuiltInAlloca (location: location_t; n: Tree) : Tree ; +PROCEDURE BuiltInAlloca (location: location_t; n: tree) : tree ; (* - BuiltInIsfinite - given an expression, e, return an integer Tree of 1 if the - value is finite. Return an integer Tree 0 if the value is + BuiltInIsfinite - given an expression, e, return an integer tree of 1 if the + value is finite. Return an integer tree 0 if the value is not finite. *) -PROCEDURE BuiltInIsfinite (location: location_t; e: Tree) : Tree ; +PROCEDURE BuiltInIsfinite (location: location_t; e: tree) : tree ; END m2builtins. diff --git a/gcc/m2/gm2-gcc/m2convert.def b/gcc/m2/gm2-gcc/m2convert.def index 5e34e93..411fa40 100644 --- a/gcc/m2/gm2-gcc/m2convert.def +++ b/gcc/m2/gm2-gcc/m2convert.def @@ -21,8 +21,7 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE FOR "C" m2convert ; -FROM m2tree IMPORT Tree ; -FROM m2linemap IMPORT location_t ; +FROM gcctypes IMPORT location_t, tree ; (* @@ -30,35 +29,35 @@ FROM m2linemap IMPORT location_t ; a WORD. *) -PROCEDURE ToWord (location: location_t; expr: Tree) : Tree ; +PROCEDURE ToWord (location: location_t; expr: tree) : tree ; (* ToCardinal - convert an expression, expr, to a CARDINAL. *) -PROCEDURE ToCardinal (location: location_t; expr: Tree) : Tree ; +PROCEDURE ToCardinal (location: location_t; expr: tree) : tree ; (* ToInteger - convert an expression, expr, to an INTEGER. *) -PROCEDURE ToInteger (location: location_t; expr: Tree) : Tree ; +PROCEDURE ToInteger (location: location_t; expr: tree) : tree ; (* ToBitset - convert an expression, expr, to a BITSET. *) -PROCEDURE ToBitset (location: location_t; expr: Tree) : Tree ; +PROCEDURE ToBitset (location: location_t; expr: tree) : tree ; (* ConvertToPtr - convert an expression to a void *. *) -PROCEDURE ConvertToPtr (p: Tree) : Tree ; +PROCEDURE ConvertToPtr (p: tree) : tree ; (* @@ -67,7 +66,7 @@ PROCEDURE ConvertToPtr (p: Tree) : Tree ; should suppress overflow checking. *) -PROCEDURE BuildConvert (location: location_t; type: Tree; value: Tree; checkOverflow: BOOLEAN) : Tree ; +PROCEDURE BuildConvert (location: location_t; type: tree; value: tree; checkOverflow: BOOLEAN) : tree ; (* @@ -76,14 +75,14 @@ PROCEDURE BuildConvert (location: location_t; type: Tree; value: Tree; checkOver overflow checking is performed. *) -PROCEDURE ConvertConstantAndCheck (location: location_t; type: Tree; expr: Tree) : Tree ; +PROCEDURE ConvertConstantAndCheck (location: location_t; type: tree; expr: tree) : tree ; (* ConvertString - converts string, expr, into a string of type, type. *) -PROCEDURE ConvertString (type, expr: Tree) : Tree ; +PROCEDURE ConvertString (type, expr: tree) : tree ; (* @@ -92,7 +91,7 @@ PROCEDURE ConvertString (type, expr: Tree) : Tree ; expr is returned unaltered. *) -PROCEDURE GenericToType (location: location_t; type, expr: Tree) : Tree ; +PROCEDURE GenericToType (location: location_t; type, expr: tree) : tree ; END m2convert. diff --git a/gcc/m2/gm2-gcc/m2decl.cc b/gcc/m2/gm2-gcc/m2decl.cc index d8a2bc8..7888b13 100644 --- a/gcc/m2/gm2-gcc/m2decl.cc +++ b/gcc/m2/gm2-gcc/m2decl.cc @@ -165,7 +165,7 @@ m2decl_DeclareKnownConstant (location_t location, tree type, tree value) param_type_list. */ tree -m2decl_BuildParameterDeclaration (location_t location, char *name, tree type, +m2decl_BuildParameterDeclaration (location_t location, const char *name, tree type, bool isreference) { tree parm_decl; diff --git a/gcc/m2/gm2-gcc/m2decl.def b/gcc/m2/gm2-gcc/m2decl.def index 993a4197..0c7e2a6 100644 --- a/gcc/m2/gm2-gcc/m2decl.def +++ b/gcc/m2/gm2-gcc/m2decl.def @@ -22,8 +22,8 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE m2decl ; FROM SYSTEM IMPORT ADDRESS ; -FROM m2tree IMPORT Tree ; -FROM m2linemap IMPORT location_t ; +FROM gcctypes IMPORT location_t, tree ; +FROM CDataTypes IMPORT ConstCharStar ; (* @@ -31,14 +31,14 @@ FROM m2linemap IMPORT location_t ; the dynamic linking scaffold. *) -PROCEDURE BuildModuleCtor (moduleCtor: Tree) ; +PROCEDURE BuildModuleCtor (moduleCtor: tree) ; (* DeclareModuleCtor configures the function to be used as a ctor. *) -PROCEDURE DeclareModuleCtor (decl: Tree) : Tree ; +PROCEDURE DeclareModuleCtor (decl: tree) : tree ; @@ -47,13 +47,13 @@ PROCEDURE DeclareModuleCtor (decl: Tree) : Tree ; *) PROCEDURE DeclareM2linkForcedModuleInitOrder (location: location_t; - RuntimeOverride: ADDRESS) : Tree ; + RuntimeOverride: ADDRESS) : tree ; PROCEDURE DeclareM2linkStaticInitialization (location: location_t; - ScaffoldStatic: INTEGER) : Tree ; + ScaffoldStatic: INTEGER) : tree ; -PROCEDURE BuildPtrToTypeString (location: location_t; string: ADDRESS; type: Tree) : Tree ; +PROCEDURE BuildPtrToTypeString (location: location_t; string: ADDRESS; type: tree) : tree ; (* @@ -88,14 +88,14 @@ PROCEDURE GetBitsPerWord () : INTEGER ; BuildIntegerConstant - return a tree containing the integer value. *) -PROCEDURE BuildIntegerConstant (value: INTEGER) : Tree ; +PROCEDURE BuildIntegerConstant (value: INTEGER) : tree ; (* BuildStringConstantType - builds a string constant with a type. *) -PROCEDURE BuildStringConstantType (length: INTEGER; string: ADDRESS; type: Tree) : Tree ; +PROCEDURE BuildStringConstantType (length: INTEGER; string: ConstCharStar; type: tree) : tree ; (* @@ -105,9 +105,9 @@ PROCEDURE BuildStringConstantType (length: INTEGER; string: ADDRESS; type: Tree) isglobal is TRUE. *) -PROCEDURE DeclareKnownVariable (location: location_t; name: ADDRESS; type: Tree; +PROCEDURE DeclareKnownVariable (location: location_t; name: ConstCharStar; type: tree; exported, imported, istemporary, isglobal: BOOLEAN; - scope, initial: Tree) : Tree ; + scope, initial: tree) : tree ; (* @@ -120,7 +120,7 @@ PROCEDURE DeclareKnownVariable (location: location_t; name: ADDRESS; type: Tree; always be referenced. *) -PROCEDURE DeclareKnownConstant (location: location_t; type: Tree; value: Tree) : Tree ; +PROCEDURE DeclareKnownConstant (location: location_t; type: tree; value: tree) : tree ; (* @@ -130,8 +130,8 @@ PROCEDURE DeclareKnownConstant (location: location_t; type: Tree; value: Tree) : type declaration and we ignore names. *) -PROCEDURE BuildParameterDeclaration (location: location_t; name: ADDRESS; type: Tree; - isreference: BOOLEAN) : Tree ; +PROCEDURE BuildParameterDeclaration (location: location_t; name: ConstCharStar; type: tree; + isreference: BOOLEAN) : tree ; (* @@ -148,16 +148,16 @@ PROCEDURE BuildStartFunctionDeclaration (uses_varargs: BOOLEAN) ; *) PROCEDURE BuildEndFunctionDeclaration (location_begin, location_end: location_t; - name: ADDRESS; returntype: Tree; + name: ConstCharStar; returntype: tree; isexternal, isnested, ispublic, - isnoreturn: BOOLEAN) : Tree ; + isnoreturn: BOOLEAN) : tree ; (* RememberVariables - *) -PROCEDURE RememberVariables (l: Tree) ; +PROCEDURE RememberVariables (l: tree) ; (* @@ -168,8 +168,8 @@ PROCEDURE RememberVariables (l: Tree) ; *) PROCEDURE BuildConstLiteralNumber (location: location_t; - str: ADDRESS; base: CARDINAL; - issueError: BOOLEAN) : Tree ; + str: ConstCharStar; base: CARDINAL; + issueError: BOOLEAN) : tree ; (* @@ -177,7 +177,7 @@ PROCEDURE BuildConstLiteralNumber (location: location_t; and, length. *) -PROCEDURE BuildStringConstant (string: ADDRESS; length: INTEGER) : Tree ; +PROCEDURE BuildStringConstant (string: ConstCharStar; length: INTEGER) : tree ; (* @@ -185,11 +185,11 @@ PROCEDURE BuildStringConstant (string: ADDRESS; length: INTEGER) : Tree ; and, length. *) -PROCEDURE BuildCStringConstant (string: ADDRESS; length: INTEGER) : Tree ; +PROCEDURE BuildCStringConstant (string: ConstCharStar; length: INTEGER) : tree ; -PROCEDURE GetDeclContext (t: Tree) : Tree ; +PROCEDURE GetDeclContext (t: tree) : tree ; END m2decl. diff --git a/gcc/m2/gm2-gcc/m2decl.h b/gcc/m2/gm2-gcc/m2decl.h index 5798db9..7957b81 100644 --- a/gcc/m2/gm2-gcc/m2decl.h +++ b/gcc/m2/gm2-gcc/m2decl.h @@ -58,7 +58,7 @@ EXTERN tree m2decl_BuildEndFunctionDeclaration ( tree returntype, bool isexternal, bool isnested, bool ispublic, bool isnoreturn); EXTERN void m2decl_BuildStartFunctionDeclaration (bool uses_varargs); -EXTERN tree m2decl_BuildParameterDeclaration (location_t location, char *name, +EXTERN tree m2decl_BuildParameterDeclaration (location_t location, const char *name, tree type, bool isreference); EXTERN tree m2decl_DeclareKnownConstant (location_t location, tree type, tree value); diff --git a/gcc/m2/gm2-gcc/m2except.def b/gcc/m2/gm2-gcc/m2except.def index 4816197..a1b586d 100644 --- a/gcc/m2/gm2-gcc/m2except.def +++ b/gcc/m2/gm2-gcc/m2except.def @@ -21,8 +21,7 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE FOR "C" m2except ; -FROM m2tree IMPORT Tree ; -FROM m2linemap IMPORT location_t ; +FROM gcctypes IMPORT location_t, tree ; (* @@ -38,14 +37,14 @@ PROCEDURE InitExceptions (location: location_t) ; BuildThrow - builds a throw statement and return the tree. *) -PROCEDURE BuildThrow (location: location_t; t: Tree) : Tree ; +PROCEDURE BuildThrow (location: location_t; t: tree) : tree ; (* BuildTryBegin - returns a tree representing the 'try' block. *) -PROCEDURE BuildTryBegin (location: location_t) : Tree ; +PROCEDURE BuildTryBegin (location: location_t) : tree ; (* @@ -53,7 +52,7 @@ PROCEDURE BuildTryBegin (location: location_t) : Tree ; for the catch handlers. *) -PROCEDURE BuildTryEnd (tryBlock: Tree) ; +PROCEDURE BuildTryEnd (tryBlock: tree) ; (* @@ -62,7 +61,7 @@ PROCEDURE BuildTryEnd (tryBlock: Tree) ; It returns the handler tree. *) -PROCEDURE BuildCatchBegin (location: location_t) : Tree ; +PROCEDURE BuildCatchBegin (location: location_t) : tree ; (* @@ -73,7 +72,7 @@ PROCEDURE BuildCatchBegin (location: location_t) : Tree ; '}' which matches the catch above. *) -PROCEDURE BuildCatchEnd (location: location_t; handler, tryBlock: Tree) : Tree ; +PROCEDURE BuildCatchEnd (location: location_t; handler, tryBlock: tree) : tree ; END m2except. diff --git a/gcc/m2/gm2-gcc/m2expr.def b/gcc/m2/gm2-gcc/m2expr.def index c195f19..6fcb047 100644 --- a/gcc/m2/gm2-gcc/m2expr.def +++ b/gcc/m2/gm2-gcc/m2expr.def @@ -21,20 +21,19 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE FOR "C" m2expr ; -FROM SYSTEM IMPORT ADDRESS ; -FROM m2tree IMPORT Tree ; -FROM m2linemap IMPORT location_t ; +FROM gcctypes IMPORT location_t, tree ; +FROM CDataTypes IMPORT CharStar, ConstCharStar ; TYPE - BuildBinCheckProcedure = PROCEDURE (location_t, Tree, Tree, Tree, Tree, Tree) : Tree ; - BuildBinProcedure = PROCEDURE (location_t, Tree, Tree, BOOLEAN) : Tree ; - BuildUnaryProcedure = PROCEDURE (location_t, Tree, BOOLEAN) : Tree ; - BuildUnaryCheckProcedure = PROCEDURE (location_t, Tree, Tree, Tree, Tree) : Tree ; - BuildExprProcedure = PROCEDURE (location_t, Tree, Tree) : Tree ; - BuildSetProcedure = PROCEDURE (location_t, Tree, Tree, Tree, Tree, BOOLEAN) ; - BuildUnarySetProcedure = PROCEDURE (location_t, Tree, BOOLEAN) ; - BuildUnarySetFunction = PROCEDURE (location_t, Tree, BOOLEAN) : Tree ; + BuildBinCheckProcedure = PROCEDURE (location_t, tree, tree, tree, tree, tree) : tree ; + BuildBinProcedure = PROCEDURE (location_t, tree, tree, BOOLEAN) : tree ; + BuildUnaryProcedure = PROCEDURE (location_t, tree, BOOLEAN) : tree ; + BuildUnaryCheckProcedure = PROCEDURE (location_t, tree, tree, tree, tree) : tree ; + BuildExprProcedure = PROCEDURE (location_t, tree, tree) : tree ; + BuildSetProcedure = PROCEDURE (location_t, tree, tree, tree, tree, BOOLEAN) ; + BuildUnarySetProcedure = PROCEDURE (location_t, tree, BOOLEAN) ; + BuildUnarySetFunction = PROCEDURE (location_t, tree, BOOLEAN) : tree ; (* @@ -49,53 +48,54 @@ PROCEDURE init (location: location_t) ; The string returned will have been malloc'd. *) -PROCEDURE CSTIntToString (t: Tree) : ADDRESS ; +PROCEDURE CSTIntToString (t: tree) : CharStar ; + (* CSTIntToChar - return the CHAR representation of tree t. *) -PROCEDURE CSTIntToChar (t: Tree) : CHAR ; +PROCEDURE CSTIntToChar (t: tree) : CHAR ; PROCEDURE CheckConstStrZtypeRange (location: location_t; - str: ADDRESS; base: CARDINAL) : BOOLEAN ; + str: CharStar; base: CARDINAL) : BOOLEAN ; (* CompareTrees - returns -1 if e1 < e2, 0 if e1 == e2, and 1 if e1 > e2. *) -PROCEDURE CompareTrees (e1: Tree; e2: Tree) : INTEGER ; +PROCEDURE CompareTrees (e1: tree; e2: tree) : INTEGER ; -PROCEDURE GetPointerOne (location: location_t) : Tree ; +PROCEDURE GetPointerOne (location: location_t) : tree ; -PROCEDURE GetPointerZero (location: location_t) : Tree ; +PROCEDURE GetPointerZero (location: location_t) : tree ; -PROCEDURE GetWordOne (location: location_t) : Tree ; +PROCEDURE GetWordOne (location: location_t) : tree ; -PROCEDURE GetWordZero (location: location_t) : Tree ; +PROCEDURE GetWordZero (location: location_t) : tree ; -PROCEDURE GetIntegerOne (location: location_t) : Tree ; +PROCEDURE GetIntegerOne (location: location_t) : tree ; -PROCEDURE GetIntegerZero (location: location_t) : Tree ; +PROCEDURE GetIntegerZero (location: location_t) : tree ; -PROCEDURE GetCardinalOne (location: location_t) : Tree ; +PROCEDURE GetCardinalOne (location: location_t) : tree ; -PROCEDURE GetCardinalZero (location: location_t) : Tree ; +PROCEDURE GetCardinalZero (location: location_t) : tree ; -PROCEDURE GetSizeOfInBits (type: Tree) : Tree ; +PROCEDURE GetSizeOfInBits (type: tree) : tree ; -PROCEDURE GetSizeOf (location: location_t; type: Tree) : Tree ; +PROCEDURE GetSizeOf (location: location_t; type: tree) : tree ; (* @@ -103,7 +103,7 @@ PROCEDURE GetSizeOf (location: location_t; type: Tree) : Tree ; for a fundamental data type. *) -PROCEDURE BuildLogicalRotate (location: location_t; op1: Tree; op2: Tree; op3: Tree; nBits: Tree; needconvert: BOOLEAN) ; +PROCEDURE BuildLogicalRotate (location: location_t; op1: tree; op2: tree; op3: tree; nBits: tree; needconvert: BOOLEAN) ; (* @@ -111,7 +111,7 @@ PROCEDURE BuildLogicalRotate (location: location_t; op1: Tree; op2: Tree; op3: T it rotates a set of size, nBits. *) -PROCEDURE BuildLRRn (location: location_t; op1: Tree; op2: Tree; nBits: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildLRRn (location: location_t; op1: tree; op2: tree; nBits: tree; needconvert: BOOLEAN) : tree ; (* @@ -119,39 +119,39 @@ PROCEDURE BuildLRRn (location: location_t; op1: Tree; op2: Tree; nBits: Tree; ne it rotates a set of size, nBits. *) -PROCEDURE BuildLRLn (location: location_t; op1: Tree; op2: Tree; nBits: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildLRLn (location: location_t; op1: tree; op2: tree; nBits: tree; needconvert: BOOLEAN) : tree ; -PROCEDURE BuildMask (location: location_t; nBits: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildMask (location: location_t; nBits: tree; needconvert: BOOLEAN) : tree ; (* BuildMult - builds a multiplication tree. *) -PROCEDURE BuildMult (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildMult (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* BuildMultCheck - builds a multiplication tree after checking for overflow. *) -PROCEDURE BuildMultCheck (location: location_t; op1, op2, lowest, min, max: Tree) : Tree ; +PROCEDURE BuildMultCheck (location: location_t; op1, op2, lowest, min, max: tree) : tree ; (* BuildLRR - builds and returns tree (op1 rotate right by op2 bits) *) -PROCEDURE BuildLRR (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildLRR (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* BuildLRL - builds and returns tree (op1 rotate left by op2 bits) *) -PROCEDURE BuildLRL (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildLRL (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* @@ -159,21 +159,21 @@ PROCEDURE BuildLRL (location: location_t; op1: Tree; op2: Tree; needconvert: BOO for a fundamental data type. *) -PROCEDURE BuildLogicalShift (location: location_t; op1: Tree; op2: Tree; op3: Tree; nBits: Tree; needconvert: BOOLEAN) ; +PROCEDURE BuildLogicalShift (location: location_t; op1: tree; op2: tree; op3: tree; nBits: tree; needconvert: BOOLEAN) ; (* BuildLSR - builds and returns tree (op1 >> op2) *) -PROCEDURE BuildLSR (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildLSR (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* BuildLSL - builds and returns tree (op1 << op2) *) -PROCEDURE BuildLSL (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildLSL (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* @@ -182,7 +182,7 @@ PROCEDURE BuildLSL (location: location_t; op1: Tree; op2: Tree; needconvert: BOO return op1 div trunc op2 *) -PROCEDURE BuildDivM2 (location: location_t; op1, op2: Tree; needsconvert: BOOLEAN) : Tree ; +PROCEDURE BuildDivM2 (location: location_t; op1, op2: tree; needsconvert: BOOLEAN) : tree ; (* @@ -191,7 +191,7 @@ PROCEDURE BuildDivM2 (location: location_t; op1, op2: Tree; needsconvert: BOOLEA return op1 div trunc op2. Use the checking div equivalents. *) -PROCEDURE BuildDivM2Check (location: location_t; op1, op2, lowest, min, max: Tree) : Tree ; +PROCEDURE BuildDivM2Check (location: location_t; op1, op2, lowest, min, max: tree) : tree ; (* @@ -200,7 +200,7 @@ PROCEDURE BuildDivM2Check (location: location_t; op1, op2, lowest, min, max: Tre return op1 div trunc op2 *) -PROCEDURE BuildModM2 (location: location_t; op1, op2: Tree; needsconvert: BOOLEAN) : Tree ; +PROCEDURE BuildModM2 (location: location_t; op1, op2: tree; needsconvert: BOOLEAN) : tree ; (* @@ -212,56 +212,56 @@ PROCEDURE BuildModM2 (location: location_t; op1, op2: Tree; needsconvert: BOOLEA return op1 div trunc op2. Use the checking div equivalents. *) -PROCEDURE BuildModM2Check (location: location_t; op1, op2, lowest, min, max: Tree) : Tree ; +PROCEDURE BuildModM2Check (location: location_t; op1, op2, lowest, min, max: tree) : tree ; (* BuildModFloor - builds a modulus tree. *) -PROCEDURE BuildModFloor (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildModFloor (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* BuildDivCeil - builds a division tree. *) -PROCEDURE BuildDivCeil (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildDivCeil (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* BuildModCeil - builds a modulus tree. *) -PROCEDURE BuildModCeil (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildModCeil (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* BuildDivFloor - builds a division tree. *) -PROCEDURE BuildDivFloor (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildDivFloor (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* BuildModTrunc - builds a modulus tree. *) -PROCEDURE BuildModTrunc (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildModTrunc (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* BuildDivTrunc - builds a division tree. *) -PROCEDURE BuildDivTrunc (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildDivTrunc (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* BuildDivTruncCheck - builds a division tree after checking for overflow. *) -PROCEDURE BuildDivTruncCheck (location: location_t; op1, op2, lowest, min, max: Tree) : Tree ; +PROCEDURE BuildDivTruncCheck (location: location_t; op1, op2, lowest, min, max: tree) : tree ; (* @@ -269,42 +269,42 @@ PROCEDURE BuildDivTruncCheck (location: location_t; op1, op2, lowest, min, max: types and NEVER for integer based types). *) -PROCEDURE BuildRDiv (location: location_t; op1, op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildRDiv (location: location_t; op1, op2: tree; needconvert: BOOLEAN) : tree ; (* BuildSubCheck - builds a subtraction tree after checking for overflow. *) -PROCEDURE BuildSubCheck (location: location_t; op1, op2, lowest, min, max: Tree) : Tree ; +PROCEDURE BuildSubCheck (location: location_t; op1, op2, lowest, min, max: tree) : tree ; (* BuildAddCheck - builds an addition tree after checking for overflow. *) -PROCEDURE BuildAddCheck (location: location_t; op1, op2, lowest, min, max: Tree) : Tree ; +PROCEDURE BuildAddCheck (location: location_t; op1, op2, lowest, min, max: tree) : tree ; (* BuildSub - builds a subtraction tree. *) -PROCEDURE BuildSub (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildSub (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* BuildAdd - builds an addition tree. *) -PROCEDURE BuildAdd (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildAdd (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* FoldAndStrip - return expression, t, after it has been folded (if possible). *) -PROCEDURE FoldAndStrip (t: Tree) : Tree ; +PROCEDURE FoldAndStrip (t: tree) : tree ; (* @@ -312,7 +312,7 @@ PROCEDURE FoldAndStrip (t: Tree) : Tree ; of, string. *) -PROCEDURE StringLength (string: Tree) : CARDINAL ; +PROCEDURE StringLength (string: tree) : CARDINAL ; (* @@ -321,7 +321,7 @@ PROCEDURE StringLength (string: Tree) : CARDINAL ; is emitted and no modification is made to, t. *) -PROCEDURE TreeOverflow (t: Tree) : BOOLEAN ; +PROCEDURE TreeOverflow (t: tree) : BOOLEAN ; (* @@ -329,7 +329,7 @@ PROCEDURE TreeOverflow (t: Tree) : BOOLEAN ; any overflow flag and returns, t. *) -PROCEDURE RemoveOverflow (t: Tree) : Tree ; +PROCEDURE RemoveOverflow (t: tree) : tree ; (* @@ -337,49 +337,49 @@ PROCEDURE RemoveOverflow (t: Tree) : Tree ; it has been coersed to, type. *) -PROCEDURE BuildCoerce (location: location_t; des: Tree; type: Tree; expr: Tree) : Tree ; +PROCEDURE BuildCoerce (location: location_t; des: tree; type: tree; expr: tree) : tree ; (* BuildTrunc - returns an integer expression from a REAL or LONGREAL op1. *) -PROCEDURE BuildTrunc (op1: Tree) : Tree ; +PROCEDURE BuildTrunc (op1: tree) : tree ; (* BuildNegate - builds a negate expression and returns the tree. *) -PROCEDURE BuildNegate (location: location_t; op1: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildNegate (location: location_t; op1: tree; needconvert: BOOLEAN) : tree ; (* BuildNegateCheck - builds a negate expression and returns the tree. *) -PROCEDURE BuildNegateCheck (location: location_t; arg, lowest, min, max: Tree) : Tree ; +PROCEDURE BuildNegateCheck (location: location_t; arg, lowest, min, max: tree) : tree ; (* BuildSetNegate - builds a set negate expression and returns the tree. *) -PROCEDURE BuildSetNegate (location: location_t; op1: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildSetNegate (location: location_t; op1: tree; needconvert: BOOLEAN) : tree ; (* BuildTBitSize - returns the minimum number of bits to represent, type. *) -PROCEDURE BuildTBitSize (location: location_t; type: Tree) : Tree ; +PROCEDURE BuildTBitSize (location: location_t; type: tree) : tree ; (* BuildSize - builds a SIZE function expression and returns the tree. *) -PROCEDURE BuildSize (location: location_t; op1: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildSize (location: location_t; op1: tree; needconvert: BOOLEAN) : tree ; (* @@ -387,7 +387,7 @@ PROCEDURE BuildSize (location: location_t; op1: Tree; needconvert: BOOLEAN) : Tr op1 and returns the tree. *) -PROCEDURE BuildAddr (location: location_t; op1: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildAddr (location: location_t; op1: tree; needconvert: BOOLEAN) : tree ; (* @@ -398,7 +398,7 @@ PROCEDURE BuildAddr (location: location_t; op1: Tree; needconvert: BOOLEAN) : Tr The expression is returned. *) -PROCEDURE BuildOffset1 (location: location_t; field: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildOffset1 (location: location_t; field: tree; needconvert: BOOLEAN) : tree ; (* @@ -407,32 +407,32 @@ PROCEDURE BuildOffset1 (location: location_t; field: Tree; needconvert: BOOLEAN) The expression is returned. *) -PROCEDURE BuildOffset (location: location_t; record: Tree; field: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildOffset (location: location_t; record: tree; field: tree; needconvert: BOOLEAN) : tree ; (* BuildLogicalOrAddress - build a logical or expressions and return the tree. *) -PROCEDURE BuildLogicalOrAddress (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildLogicalOrAddress (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* BuildLogicalOr - build a logical or expressions and return the tree. *) -PROCEDURE BuildLogicalOr (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildLogicalOr (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* BuildLogicalAnd - build a logical and expression and return the tree. *) -PROCEDURE BuildLogicalAnd (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildLogicalAnd (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; -PROCEDURE BuildSymmetricDifference (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildSymmetricDifference (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* @@ -441,99 +441,99 @@ PROCEDURE BuildSymmetricDifference (location: location_t; op1: Tree; op2: Tree; (op1 and (not op2)) *) -PROCEDURE BuildLogicalDifference (location: location_t; op1: Tree; op2: Tree; needconvert: BOOLEAN) : Tree ; +PROCEDURE BuildLogicalDifference (location: location_t; op1: tree; op2: tree; needconvert: BOOLEAN) : tree ; (* BuildLessThan - return a tree which computes < *) -PROCEDURE BuildLessThan (location: location_t; op1: Tree; op2: Tree) : Tree ; +PROCEDURE BuildLessThan (location: location_t; op1: tree; op2: tree) : tree ; (* BuildGreaterThan - return a tree which computes > *) -PROCEDURE BuildGreaterThan (location: location_t; op1: Tree; op2: Tree) : Tree ; +PROCEDURE BuildGreaterThan (location: location_t; op1: tree; op2: tree) : tree ; (* BuildLessThanOrEqual - return a tree which computes < *) -PROCEDURE BuildLessThanOrEqual (location: location_t; op1: Tree; op2: Tree) : Tree ; +PROCEDURE BuildLessThanOrEqual (location: location_t; op1: tree; op2: tree) : tree ; (* BuildGreaterThanOrEqual - return a tree which computes >= *) -PROCEDURE BuildGreaterThanOrEqual (location: location_t; op1: Tree; op2: Tree) : Tree ; +PROCEDURE BuildGreaterThanOrEqual (location: location_t; op1: tree; op2: tree) : tree ; (* BuildEqualTo - return a tree which computes = *) -PROCEDURE BuildEqualTo (location: location_t; op1: Tree; op2: Tree) : Tree ; +PROCEDURE BuildEqualTo (location: location_t; op1: tree; op2: tree) : tree ; -PROCEDURE BuildNotEqualTo (location: location_t; op1: Tree; op2: Tree) : Tree ; +PROCEDURE BuildNotEqualTo (location: location_t; op1: tree; op2: tree) : tree ; (* BuildIsSuperset - return a tree which computes: op1 & op2 == op2 *) -PROCEDURE BuildIsSuperset (location: location_t; op1: Tree; op2: Tree) : Tree ; +PROCEDURE BuildIsSuperset (location: location_t; op1: tree; op2: tree) : tree ; (* BuildIsNotSuperset - return a tree which computes: op1 & op2 != op2 *) -PROCEDURE BuildIsNotSuperset (location: location_t; op1: Tree; op2: Tree) : Tree ; +PROCEDURE BuildIsNotSuperset (location: location_t; op1: tree; op2: tree) : tree ; (* BuildIsSubset - return a tree which computes: op1 & op2 == op1 *) -PROCEDURE BuildIsSubset (location: location_t; op1: Tree; op2: Tree) : Tree ; +PROCEDURE BuildIsSubset (location: location_t; op1: tree; op2: tree) : tree ; (* BuildIsNotSubset - return a tree which computes: op1 & op2 != op1 *) -PROCEDURE BuildIsNotSubset (location: location_t; op1: Tree; op2: Tree) : Tree ; +PROCEDURE BuildIsNotSubset (location: location_t; op1: tree; op2: tree) : tree ; (* BuildIfConstInVar - generates: if constel in varset then goto label. *) -PROCEDURE BuildIfConstInVar (location: location_t; type: Tree; varset: Tree; constel: Tree; is_lvalue: BOOLEAN; fieldno: INTEGER; label: ADDRESS) ; +PROCEDURE BuildIfConstInVar (location: location_t; type: tree; varset: tree; constel: tree; is_lvalue: BOOLEAN; fieldno: INTEGER; label: CharStar) ; -PROCEDURE BuildIfNotConstInVar (location: location_t; type: Tree; varset: Tree; constel: Tree; is_lvalue: BOOLEAN; fieldno: INTEGER; label: ADDRESS) ; +PROCEDURE BuildIfNotConstInVar (location: location_t; type: tree; varset: tree; constel: tree; is_lvalue: BOOLEAN; fieldno: INTEGER; label: CharStar) ; (* BuildIfVarInVar - generates: if varel in varset then goto label *) -PROCEDURE BuildIfVarInVar (location: location_t; type: Tree; varset: Tree; varel: Tree; is_lvalue: BOOLEAN; low: Tree; high: Tree; label: ADDRESS) ; +PROCEDURE BuildIfVarInVar (location: location_t; type: tree; varset: tree; varel: tree; is_lvalue: BOOLEAN; low: tree; high: tree; label: CharStar) ; (* BuildIfNotVarInVar - generates: if not (varel in varset) then goto label *) -PROCEDURE BuildIfNotVarInVar (location: location_t; type: Tree; varset: Tree; varel: Tree; is_lvalue: BOOLEAN; low: Tree; high: Tree; label: ADDRESS) ; +PROCEDURE BuildIfNotVarInVar (location: location_t; type: tree; varset: tree; varel: tree; is_lvalue: BOOLEAN; low: tree; high: tree; label: CharStar) ; (* @@ -542,24 +542,24 @@ PROCEDURE BuildIfNotVarInVar (location: location_t; type: Tree; varset: Tree; va *) PROCEDURE BuildForeachWordInSetDoIfExpr (location: location_t; - type, op1, op2: Tree; + type, op1, op2: tree; is_op1lvalue, is_op2lvalue, is_op1const, isop2const: BOOLEAN; - expr: BuildExprProcedure; label: ADDRESS) ; + expr: BuildExprProcedure; label: CharStar) ; (* BuildIfInRangeGoto - if var is in the range low..high then goto label *) -PROCEDURE BuildIfInRangeGoto (location: location_t; var: Tree; low: Tree; high: Tree; label: ADDRESS) ; +PROCEDURE BuildIfInRangeGoto (location: location_t; var: tree; low: tree; high: tree; label: CharStar) ; (* BuildIfNotInRangeGoto - if var is not in the range low..high then goto label *) -PROCEDURE BuildIfNotInRangeGoto (location: location_t; var: Tree; low: Tree; high: Tree; label: ADDRESS) ; +PROCEDURE BuildIfNotInRangeGoto (location: location_t; var: tree; low: tree; high: tree; label: CharStar) ; (* @@ -567,7 +567,7 @@ PROCEDURE BuildIfNotInRangeGoto (location: location_t; var: Tree; low: Tree; hig given, lowIndice. *) -PROCEDURE BuildArray (location: location_t; type: Tree; array: Tree; index: Tree; lowIndice: Tree) : Tree ; +PROCEDURE BuildArray (location: location_t; type: tree; array: tree; index: tree; lowIndice: tree) : tree ; (* @@ -576,35 +576,35 @@ PROCEDURE BuildArray (location: location_t; type: Tree; array: Tree; index: Tree BuildComponentRef on the penultimate field. *) -PROCEDURE BuildComponentRef (location: location_t; record: Tree; field: Tree) : Tree ; +PROCEDURE BuildComponentRef (location: location_t; record: tree; field: tree) : tree ; (* BuildIndirect - build: ( *target) given that the object to be copied is of, type. *) -PROCEDURE BuildIndirect (location: location_t; target: Tree; type: Tree) : Tree ; +PROCEDURE BuildIndirect (location: location_t; target: tree; type: tree) : tree ; (* IsTrue - returns TRUE if, t, is known to be TRUE. *) -PROCEDURE IsTrue (t: Tree) : BOOLEAN ; +PROCEDURE IsTrue (t: tree) : BOOLEAN ; (* IsFalse - returns FALSE if, t, is known to be FALSE. *) -PROCEDURE IsFalse (t: Tree) : BOOLEAN ; +PROCEDURE IsFalse (t: tree) : BOOLEAN ; (* GetCstInteger - return the integer value of the cst tree. *) -PROCEDURE GetCstInteger (cst: Tree) : INTEGER ; +PROCEDURE GetCstInteger (cst: tree) : INTEGER ; (* @@ -612,7 +612,7 @@ PROCEDURE GetCstInteger (cst: Tree) : INTEGER ; TRUE if the value of e1 is the same as e2. *) -PROCEDURE AreConstantsEqual (e1: Tree; e2: Tree) : BOOLEAN ; +PROCEDURE AreConstantsEqual (e1: tree; e2: tree) : BOOLEAN ; (* @@ -624,7 +624,7 @@ PROCEDURE AreConstantsEqual (e1: Tree; e2: Tree) : BOOLEAN ; -0 == 0 and NaN != NaN. *) -PROCEDURE AreRealOrComplexConstantsEqual (e1: Tree; e2: Tree) : BOOLEAN ; +PROCEDURE AreRealOrComplexConstantsEqual (e1: tree; e2: tree) : BOOLEAN ; (* @@ -635,44 +635,44 @@ PROCEDURE AreRealOrComplexConstantsEqual (e1: Tree; e2: Tree) : BOOLEAN ; an unsigned constant will never return -1 *) -PROCEDURE DetermineSign (e: Tree) : INTEGER ; +PROCEDURE DetermineSign (e: tree) : INTEGER ; (* BuildCap - builds the Modula-2 function CAP(t) and returns - the result in a gcc Tree. + the result in a gcc tree. *) -PROCEDURE BuildCap (location: location_t; t: Tree) : Tree ; +PROCEDURE BuildCap (location: location_t; t: tree) : tree ; (* BuildAbs - builds the Modula-2 function ABS(t) and returns - the result in a gcc Tree. + the result in a gcc tree. *) -PROCEDURE BuildAbs (location: location_t; t: Tree) : Tree ; +PROCEDURE BuildAbs (location: location_t; t: tree) : tree ; (* BuildRe - builds an expression for the function RE. *) -PROCEDURE BuildRe (op1: Tree) : Tree ; +PROCEDURE BuildRe (op1: tree) : tree ; (* BuildIm - builds an expression for the function IM. *) -PROCEDURE BuildIm (op1: Tree) : Tree ; +PROCEDURE BuildIm (op1: tree) : tree ; (* BuildCmplx - builds an expression for the function CMPLX. *) -PROCEDURE BuildCmplx (location: location_t; type: Tree; real: Tree; imag: Tree) : Tree ; +PROCEDURE BuildCmplx (location: location_t; type: tree; real: tree; imag: tree) : tree ; (* @@ -683,7 +683,7 @@ PROCEDURE BuildCmplx (location: location_t; type: Tree; real: Tree; imag: Tree) *) PROCEDURE BuildBinaryForeachWordDo (location: location_t; - type, op1, op2, op3: Tree; + type, op1, op2, op3: tree; binop: BuildBinProcedure; is_op1lvalue, is_op2lvalue, @@ -700,17 +700,17 @@ PROCEDURE BuildBinaryForeachWordDo (location: location_t; *) PROCEDURE BuildBinarySetDo (location: location_t; - settype, op1, op2, op3: Tree; + settype, op1, op2, op3: tree; binop: BuildSetProcedure; is_op1lvalue, is_op2lvalue, is_op3lvalue: BOOLEAN; - nBits, unbounded: Tree; - varproc, leftproc, rightproc: Tree) ; + nBits, unbounded: tree; + varproc, leftproc, rightproc: tree) ; (* ConstantExpressionWarning - issue a warning if the constant has overflowed. *) -PROCEDURE ConstantExpressionWarning (value: Tree) ; +PROCEDURE ConstantExpressionWarning (value: tree) ; (* @@ -718,7 +718,7 @@ PROCEDURE ConstantExpressionWarning (value: Tree) ; and op2 is not a pointer type. *) -PROCEDURE BuildAddAddress (location: location_t; op1, op2: Tree) : Tree ; +PROCEDURE BuildAddAddress (location: location_t; op1, op2: tree) : tree ; (* @@ -726,7 +726,7 @@ PROCEDURE BuildAddAddress (location: location_t; op1, op2: Tree) : Tree ; represent: min..max. *) -PROCEDURE calcNbits (location: location_t; min, max: Tree) : Tree ; +PROCEDURE calcNbits (location: location_t; min, max: tree) : tree ; (* @@ -734,7 +734,7 @@ PROCEDURE calcNbits (location: location_t; min, max: Tree) : Tree ; *) PROCEDURE OverflowZType (location: location_t; - str: ADDRESS; base: CARDINAL; + str: ConstCharStar; base: CARDINAL; issueError: BOOLEAN) : BOOLEAN ; (* @@ -742,7 +742,7 @@ PROCEDURE OverflowZType (location: location_t; (condition) ? (left) : right. *) -PROCEDURE BuildCondIfExpression (condition, type, left, right: Tree) : Tree ; +PROCEDURE BuildCondIfExpression (condition, type, left, right: tree) : tree ; END m2expr. diff --git a/gcc/m2/gm2-gcc/m2linemap.def b/gcc/m2/gm2-gcc/m2linemap.def index a56e0bf..aabdb9b 100644 --- a/gcc/m2/gm2-gcc/m2linemap.def +++ b/gcc/m2/gm2-gcc/m2linemap.def @@ -1,4 +1,4 @@ -(* m2linemap.def provides access to GCC location_t. +(* m2linemap.def provides access to GCC location_t functions. Copyright (C) 2011-2024 Free Software Foundation, Inc. Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>. @@ -22,15 +22,13 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE FOR "C" m2linemap ; FROM SYSTEM IMPORT ADDRESS ; +FROM gcctypes IMPORT location_t ; EXPORT QUALIFIED StartFile, EndFile, StartLine, GetLocationColumn, GetLocationRange, GetLocationBinary, UnknownLocation, BuiltinsLocation, GetLineNoFromLocation, GetColumnNoFromLocation, GetFilenameFromLocation, ErrorAt, ErrorAtf, - WarningAtf, NoteAtf, internal_error, location_t ; - -TYPE - location_t = CARDINAL ; + WarningAtf, NoteAtf, internal_error ; PROCEDURE StartFile (filename: ADDRESS; linebegin: CARDINAL) ; diff --git a/gcc/m2/gm2-gcc/m2misc.def b/gcc/m2/gm2-gcc/m2misc.def index 77fd283..1ca675c 100644 --- a/gcc/m2/gm2-gcc/m2misc.def +++ b/gcc/m2/gm2-gcc/m2misc.def @@ -21,10 +21,10 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE FOR "C" m2misc ; -FROM m2tree IMPORT Tree ; +FROM gcctypes IMPORT tree ; FROM SYSTEM IMPORT ADDRESS ; -PROCEDURE DebugTree (t: Tree) ; +PROCEDURE DebugTree (t: tree) ; PROCEDURE error (message: ARRAY OF CHAR) ; PROCEDURE cerror (message: ADDRESS) ; PROCEDURE warning_m2_dump_filter (message, rule: ADDRESS) ; diff --git a/gcc/m2/gm2-gcc/m2pp.def b/gcc/m2/gm2-gcc/m2pp.def index 2007717..63e78c5 100644 --- a/gcc/m2/gm2-gcc/m2pp.def +++ b/gcc/m2/gm2-gcc/m2pp.def @@ -22,7 +22,7 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE FOR "C" m2pp ; FROM SYSTEM IMPORT ADDRESS ; -FROM m2tree IMPORT Tree ; +FROM gcctypes IMPORT tree ; (* @@ -39,7 +39,7 @@ PROCEDURE CreateDumpGimple (templatename: ADDRESS; templatelen: CARDINAL) ; PROCEDURE CloseDumpGimple ; -PROCEDURE DumpGimpleFd (fd: INTEGER; fndecl: Tree) ; +PROCEDURE DumpGimpleFd (fd: INTEGER; fndecl: tree) ; END m2pp. diff --git a/gcc/m2/gm2-gcc/m2statement.cc b/gcc/m2/gm2-gcc/m2statement.cc index 8b51feb..5e51179 100644 --- a/gcc/m2/gm2-gcc/m2statement.cc +++ b/gcc/m2/gm2-gcc/m2statement.cc @@ -361,7 +361,7 @@ m2statement_BuildIndirectProcedureCallTree (location_t location, /* BuildBuiltinCallTree calls the builtin procedure. */ tree -m2statement_BuildBuiltinCallTree (location_t location, tree func) +m2statement_BuildBuiltinCallTree (tree func) { TREE_USED (func) = true; TREE_SIDE_EFFECTS (func) = true; diff --git a/gcc/m2/gm2-gcc/m2statement.def b/gcc/m2/gm2-gcc/m2statement.def index 7fb4f6b..d9b2490 100644 --- a/gcc/m2/gm2-gcc/m2statement.def +++ b/gcc/m2/gm2-gcc/m2statement.def @@ -21,10 +21,8 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE FOR "C" m2statement ; - -FROM SYSTEM IMPORT ADDRESS ; -FROM m2tree IMPORT Tree ; -FROM m2linemap IMPORT location_t ; +FROM gcctypes IMPORT location_t, tree ; +FROM CDataTypes IMPORT CharStar ; FROM m2expr IMPORT BuildUnarySetFunction ; @@ -33,28 +31,28 @@ FROM m2expr IMPORT BuildUnarySetFunction ; result of the expression is TRUE or FALSE. *) -PROCEDURE DoJump (location: location_t; exp: Tree; falselabel: ADDRESS; truelabel: ADDRESS) ; +PROCEDURE DoJump (location: location_t; exp: tree; falselabel, truelabel: CharStar) ; (* BuildStartFunctionCode - generate function entry code. *) -PROCEDURE BuildStartFunctionCode (location: location_t; fndecl: Tree; isexported: BOOLEAN; isinline: BOOLEAN) ; +PROCEDURE BuildStartFunctionCode (location: location_t; fndecl: tree; isexported: BOOLEAN; isinline: BOOLEAN) ; (* BuildEndFunctionCode - generates the function epilogue. *) -PROCEDURE BuildEndFunctionCode (location: location_t; fndecl: Tree; nested: BOOLEAN) ; +PROCEDURE BuildEndFunctionCode (location: location_t; fndecl: tree; nested: BOOLEAN) ; (* BuildReturnValueCode - generates the code associated with: RETURN( value ) *) -PROCEDURE BuildReturnValueCode (location: location_t; fndecl: Tree; value: Tree) ; +PROCEDURE BuildReturnValueCode (location: location_t; fndecl: tree; value: tree) ; (* @@ -78,28 +76,28 @@ PROCEDURE BuildPopFunctionContext ; It returns, des. *) -PROCEDURE BuildAssignmentTree (location: location_t; des, expr: Tree) : Tree ; +PROCEDURE BuildAssignmentTree (location: location_t; des, expr: tree) : tree ; (* BuildAssignmentStatement builds the assignment of, des, and, expr. *) -PROCEDURE BuildAssignmentStatement (location: location_t; des, expr: Tree) ; +PROCEDURE BuildAssignmentStatement (location: location_t; des, expr: tree) ; (* BuildGoto - builds a goto operation. *) -PROCEDURE BuildGoto (location: location_t; name: ADDRESS) ; +PROCEDURE BuildGoto (location: location_t; name: CharStar) ; (* DeclareLabel - create a label, name. *) -PROCEDURE DeclareLabel (location: location_t; name: ADDRESS) ; +PROCEDURE DeclareLabel (location: location_t; name: CharStar) ; (* @@ -107,7 +105,7 @@ PROCEDURE DeclareLabel (location: location_t; name: ADDRESS) ; statement, s, if, condition, is true. *) -PROCEDURE BuildIfThenDoEnd (condition: Tree; then_block: Tree) : Tree ; +PROCEDURE BuildIfThenDoEnd (condition: tree; then_block: tree) : tree ; (* @@ -116,14 +114,14 @@ PROCEDURE BuildIfThenDoEnd (condition: Tree; then_block: Tree) : Tree ; condition. *) -PROCEDURE BuildIfThenElseEnd (condition: Tree; then_block: Tree; else_block: Tree) : Tree ; +PROCEDURE BuildIfThenElseEnd (condition: tree; then_block: tree; else_block: tree) : tree ; (* BuildParam - build a list of parameters, ready for a subsequent procedure call. *) -PROCEDURE BuildParam (location: location_t; param: Tree) ; +PROCEDURE BuildParam (location: location_t; param: tree) ; (* @@ -136,7 +134,7 @@ PROCEDURE BuildParam (location: location_t; param: Tree) ; a call to BuildFunctionCallTree. *) -PROCEDURE BuildFunctionCallTree (location: location_t; procedure: Tree; rettype: Tree) ; +PROCEDURE BuildFunctionCallTree (location: location_t; procedure: tree; rettype: tree) ; (* @@ -144,7 +142,7 @@ PROCEDURE BuildFunctionCallTree (location: location_t; procedure: Tree; rettype: parameter list and the return type, rettype. *) -PROCEDURE BuildProcedureCallTree (location: location_t; procedure: Tree; rettype: Tree) : Tree ; +PROCEDURE BuildProcedureCallTree (location: location_t; procedure: tree; rettype: tree) : tree ; (* @@ -152,14 +150,14 @@ PROCEDURE BuildProcedureCallTree (location: location_t; procedure: Tree; rettype parameter list and the return type, rettype. *) -PROCEDURE BuildIndirectProcedureCallTree (location: location_t; procedure: Tree; rettype: Tree) : Tree ; +PROCEDURE BuildIndirectProcedureCallTree (location: location_t; procedure: tree; rettype: tree) : tree ; (* BuildFunctValue - generates code for value := last_function(foobar); *) -PROCEDURE BuildFunctValue (location: location_t; value: Tree) : Tree ; +PROCEDURE BuildFunctValue (location: location_t; value: tree) : tree ; (* @@ -167,7 +165,7 @@ PROCEDURE BuildFunctValue (location: location_t; value: Tree) : Tree ; *) PROCEDURE BuildCall2 (location: location_t; - function, rettype, arg1, arg2: Tree) : Tree ; + function, rettype, arg1, arg2: tree) : tree ; (* @@ -175,28 +173,28 @@ PROCEDURE BuildCall2 (location: location_t; *) PROCEDURE BuildCall3 (location: location_t; - function, rettype, arg1, arg2, arg3: Tree) : Tree ; + function, rettype, arg1, arg2, arg3: tree) : tree ; (* SetLastFunction - set the last_function to, t. *) -PROCEDURE SetLastFunction (t: Tree) ; +PROCEDURE SetLastFunction (t: tree) ; (* GetLastFunction - returns, last_function. *) -PROCEDURE GetLastFunction () : Tree ; +PROCEDURE GetLastFunction () : tree ; (* GetParamTree - return parameter, i. *) -PROCEDURE GetParamTree (call: Tree; i: CARDINAL) : Tree ; +PROCEDURE GetParamTree (call: tree; i: CARDINAL) : tree ; (* @@ -204,23 +202,23 @@ PROCEDURE GetParamTree (call: Tree; i: CARDINAL) : Tree ; attached. *) -PROCEDURE BuildTryFinally (location: location_t; call: Tree; cleanups: Tree) : Tree ; +PROCEDURE BuildTryFinally (location: location_t; call: tree; cleanups: tree) : tree ; (* BuildCleanUp - return a CLEANUP_POINT_EXPR which will clobber, param. *) -PROCEDURE BuildCleanUp (param: Tree) : Tree ; +PROCEDURE BuildCleanUp (param: tree) : tree ; (* BuildAsm - generates an inline assembler instruction. *) -PROCEDURE BuildAsm (location: location_t; instr: Tree; +PROCEDURE BuildAsm (location: location_t; instr: tree; isVolatile: BOOLEAN; isSimple: BOOLEAN; - inputs: Tree; outputs: Tree; trash: Tree; labels: Tree) ; + inputs: tree; outputs: tree; trash: tree; labels: tree) ; (* @@ -231,7 +229,7 @@ PROCEDURE BuildAsm (location: location_t; instr: Tree; of the large set invoking the unop. *) -PROCEDURE BuildUnaryForeachWordDo (location: location_t; type: Tree; op1: Tree; op2: Tree; +PROCEDURE BuildUnaryForeachWordDo (location: location_t; type: tree; op1: tree; op2: tree; unop: BuildUnarySetFunction; is_op1lvalue, is_op2lvalue, is_op1const, is_op2const: BOOLEAN) ; @@ -242,7 +240,7 @@ PROCEDURE BuildUnaryForeachWordDo (location: location_t; type: Tree; op1: Tree; op2 is a constant. *) -PROCEDURE BuildExcludeVarConst (location: location_t; type: Tree; op1: Tree; op2: Tree; is_lvalue: BOOLEAN; fieldno: INTEGER) ; +PROCEDURE BuildExcludeVarConst (location: location_t; type: tree; op1: tree; op2: tree; is_lvalue: BOOLEAN; fieldno: INTEGER) ; (* @@ -250,7 +248,7 @@ PROCEDURE BuildExcludeVarConst (location: location_t; type: Tree; op1: Tree; op2 varel is a variable. *) -PROCEDURE BuildExcludeVarVar (location: location_t; type: Tree; varset: Tree; varel: Tree; is_lvalue: BOOLEAN; low: Tree) ; +PROCEDURE BuildExcludeVarVar (location: location_t; type: tree; varset: tree; varel: tree; is_lvalue: BOOLEAN; low: tree) ; (* @@ -259,7 +257,7 @@ PROCEDURE BuildExcludeVarVar (location: location_t; type: Tree; varset: Tree; va op2 is a constant. *) -PROCEDURE BuildIncludeVarConst (location: location_t; type: Tree; op1: Tree; op2: Tree; is_lvalue: BOOLEAN; fieldno: INTEGER) ; +PROCEDURE BuildIncludeVarConst (location: location_t; type: tree; op1: tree; op2: tree; is_lvalue: BOOLEAN; fieldno: INTEGER) ; (* @@ -267,7 +265,7 @@ PROCEDURE BuildIncludeVarConst (location: location_t; type: Tree; op1: Tree; op2 op2 is a variable. *) -PROCEDURE BuildIncludeVarVar (location: location_t; type: Tree; varset: Tree; varel: Tree; is_lvalue: BOOLEAN; low: Tree) ; +PROCEDURE BuildIncludeVarVar (location: location_t; type: tree; varset: tree; varel: tree; is_lvalue: BOOLEAN; low: tree) ; (* @@ -278,21 +276,21 @@ PROCEDURE BuildIncludeVarVar (location: location_t; type: Tree; varset: Tree; va sequence for all modules. *) -PROCEDURE BuildStart (location: location_t; name: ADDRESS; inner_module: BOOLEAN) : Tree ; +PROCEDURE BuildStart (location: location_t; name: CharStar; inner_module: BOOLEAN) : tree ; (* BuildEnd - complete the initialisation function for this module. *) -PROCEDURE BuildEnd (location: location_t; fndecl: Tree; nested: BOOLEAN) ; +PROCEDURE BuildEnd (location: location_t; fndecl: tree; nested: BOOLEAN) ; (* BuildCallInner - call the inner module function. It has no parameters and no return value. *) -PROCEDURE BuildCallInner (location: location_t; fndecl: Tree) ; +PROCEDURE BuildCallInner (location: location_t; fndecl: tree) ; (* @@ -313,7 +311,7 @@ PROCEDURE SetEndLocation (location: location_t) ; BuildBuiltinCallTree - calls the builtin procedure. *) -PROCEDURE BuildBuiltinCallTree (location: location_t; func: Tree) : Tree ; +PROCEDURE BuildBuiltinCallTree (func: tree) : tree ; END m2statement. diff --git a/gcc/m2/gm2-gcc/m2statement.h b/gcc/m2/gm2-gcc/m2statement.h index 9bdd548..a1eed48 100644 --- a/gcc/m2/gm2-gcc/m2statement.h +++ b/gcc/m2/gm2-gcc/m2statement.h @@ -103,7 +103,7 @@ EXTERN tree m2statement_GetCurrentFunction (void); EXTERN void m2statement_SetBeginLocation (location_t location); EXTERN void m2statement_SetEndLocation (location_t location); EXTERN tree m2statement_GetParamTree (tree call, unsigned int i); -EXTERN tree m2statement_BuildBuiltinCallTree (location_t location, tree func); +EXTERN tree m2statement_BuildBuiltinCallTree (tree func); EXTERN tree m2statement_BuildTryFinally (location_t location, tree call, tree cleanups); diff --git a/gcc/m2/gm2-gcc/m2tree.def b/gcc/m2/gm2-gcc/m2tree.def index 158c57c..27e70d0 100644 --- a/gcc/m2/gm2-gcc/m2tree.def +++ b/gcc/m2/gm2-gcc/m2tree.def @@ -22,20 +22,18 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE FOR "C" m2tree ; FROM SYSTEM IMPORT ADDRESS ; - -TYPE - Tree = ADDRESS ; - - -PROCEDURE IsAConstant (t: Tree) : BOOLEAN ; -PROCEDURE IsOrdinal (type: Tree) : BOOLEAN ; -PROCEDURE IsTreeOverflow (value: Tree) : BOOLEAN ; -PROCEDURE skip_const_decl (exp: Tree) : Tree ; -PROCEDURE skip_type_decl (type: Tree) : Tree ; -PROCEDURE is_type (type: Tree) : BOOLEAN ; -PROCEDURE is_array (array: Tree) : BOOLEAN ; -PROCEDURE is_var (var: Tree) : BOOLEAN ; -PROCEDURE debug_tree (t: Tree) ; +FROM gcctypes IMPORT tree ; + + +PROCEDURE IsAConstant (t: tree) : BOOLEAN ; +PROCEDURE IsOrdinal (type: tree) : BOOLEAN ; +PROCEDURE IstreeOverflow (value: tree) : BOOLEAN ; +PROCEDURE skip_const_decl (exp: tree) : tree ; +PROCEDURE skip_type_decl (type: tree) : tree ; +PROCEDURE is_type (type: tree) : BOOLEAN ; +PROCEDURE is_array (array: tree) : BOOLEAN ; +PROCEDURE is_var (var: tree) : BOOLEAN ; +PROCEDURE debug_tree (t: tree) ; END m2tree. diff --git a/gcc/m2/gm2-gcc/m2treelib.def b/gcc/m2/gm2-gcc/m2treelib.def index 1803db7..61f5737 100644 --- a/gcc/m2/gm2-gcc/m2treelib.def +++ b/gcc/m2/gm2-gcc/m2treelib.def @@ -21,8 +21,7 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE FOR "C" m2treelib ; -FROM m2tree IMPORT Tree ; -FROM m2linemap IMPORT location_t ; +FROM gcctypes IMPORT location_t, tree ; FROM SYSTEM IMPORT ADDRESS ; TYPE @@ -35,28 +34,28 @@ TYPE NULL is returned if, op, is a constant. *) -PROCEDURE get_set_address_if_var (location: location_t; op: Tree; is_lvalue, is_const: BOOLEAN) : Tree ; +PROCEDURE get_set_address_if_var (location: location_t; op: tree; is_lvalue, is_const: BOOLEAN) : tree ; (* get_set_field_rhs - returns the value of p->field. *) -PROCEDURE get_set_field_rhs (location: location_t; p: Tree; field: Tree) : Tree ; +PROCEDURE get_set_field_rhs (location: location_t; p: tree; field: tree) : tree ; (* get_set_field_lhs - returns the address of p->field. *) -PROCEDURE get_set_field_lhs (location: location_t; p: Tree; field: Tree) : Tree ; +PROCEDURE get_set_field_lhs (location: location_t; p: tree; field: tree) : tree ; (* get_set_address - returns the address of op1. *) -PROCEDURE get_set_address (location: location_t; op1: Tree; is_lvalue: BOOLEAN) : Tree ; +PROCEDURE get_set_address (location: location_t; op1: tree; is_lvalue: BOOLEAN) : tree ; (* @@ -64,7 +63,7 @@ PROCEDURE get_set_address (location: location_t; op1: Tree; is_lvalue: BOOLEAN) Either p->field or the constant(op.fieldNo) is returned. *) -PROCEDURE get_set_value (location: location_t; p: Tree; field: Tree; is_const: BOOLEAN; op: Tree; fieldNo: CARDINAL) : Tree ; +PROCEDURE get_set_value (location: location_t; p: tree; field: tree; is_const: BOOLEAN; op: tree; fieldNo: CARDINAL) : tree ; (* @@ -76,7 +75,7 @@ PROCEDURE get_set_value (location: location_t; p: Tree; field: Tree; is_const: B appropriate field number. *) -PROCEDURE get_field_no (type: Tree; op: Tree; is_const: BOOLEAN; fieldNo: CARDINAL) : Tree ; +PROCEDURE get_field_no (type: tree; op: tree; is_const: BOOLEAN; fieldNo: CARDINAL) : tree ; (* @@ -84,18 +83,18 @@ PROCEDURE get_field_no (type: Tree; op: Tree; is_const: BOOLEAN; fieldNo: CARDIN copied upon indirection. *) -PROCEDURE get_rvalue (location: location_t; t: Tree; type: Tree; is_lvalue: BOOLEAN) : Tree ; +PROCEDURE get_rvalue (location: location_t; t: tree; type: tree; is_lvalue: BOOLEAN) : tree ; (* DoCall - build a call tree arranging the parameter list as a vector. *) -PROCEDURE DoCall (location: location_t; rettype: Tree; funcptr: Tree; param_list: Tree) : Tree ; +PROCEDURE DoCall (location: location_t; rettype: tree; funcptr: tree; param_list: tree) : tree ; -PROCEDURE build_modify_expr (location: location_t; des: Tree; modifycode: tree_code; copy: Tree) : Tree ; +PROCEDURE build_modify_expr (location: location_t; des: tree; modifycode: tree_code; copy: tree) : tree ; (* @@ -103,7 +102,7 @@ PROCEDURE build_modify_expr (location: location_t; des: Tree; modifycode: tree_c If the result is true then jump to label. *) -PROCEDURE do_jump_if_bit (location: location_t; code: tree_code; word: Tree; bit: Tree; label: ADDRESS) ; +PROCEDURE do_jump_if_bit (location: location_t; code: tree_code; word: tree; bit: tree; label: ADDRESS) ; END m2treelib. diff --git a/gcc/m2/gm2-gcc/m2type.def b/gcc/m2/gm2-gcc/m2type.def index fc248e2..c39c9d0 100644 --- a/gcc/m2/gm2-gcc/m2type.def +++ b/gcc/m2/gm2-gcc/m2type.def @@ -22,9 +22,8 @@ along with GNU Modula-2; see the file COPYING3. If not see DEFINITION MODULE FOR "C" m2type ; FROM SYSTEM IMPORT ADDRESS ; -FROM m2tree IMPORT Tree ; -FROM m2linemap IMPORT location_t ; - +FROM gcctypes IMPORT location_t, tree ; +FROM CDataTypes IMPORT CharStar, ConstCharStar ; TYPE Constructor = ADDRESS ; @@ -35,7 +34,7 @@ TYPE of, type. *) -PROCEDURE ValueInTypeRange (type: Tree; value: Tree) : BOOLEAN ; +PROCEDURE ValueInTypeRange (type: tree; value: tree) : BOOLEAN ; (* @@ -43,49 +42,49 @@ PROCEDURE ValueInTypeRange (type: Tree; value: Tree) : BOOLEAN ; of, type. *) -PROCEDURE ValueOutOfTypeRange (type: Tree; value: Tree) : BOOLEAN ; +PROCEDURE ValueOutOfTypeRange (type: tree; value: tree) : BOOLEAN ; (* ExceedsTypeRange - return TRUE if low or high exceed the range of, type. *) -PROCEDURE ExceedsTypeRange (type: Tree; low, high: Tree) : BOOLEAN ; +PROCEDURE ExceedsTypeRange (type: tree; low, high: tree) : BOOLEAN ; (* WithinTypeRange - return TRUE if low and high are within the range of, type. *) -PROCEDURE WithinTypeRange (type: Tree; low, high: Tree) : BOOLEAN ; +PROCEDURE WithinTypeRange (type: tree; low, high: tree) : BOOLEAN ; (* BuildSubrangeType - creates a subrange of, type, with, lowval, highval. *) -PROCEDURE BuildSubrangeType (location: location_t; name: ADDRESS; type: Tree; lowval: Tree; highval: Tree) : Tree ; +PROCEDURE BuildSubrangeType (location: location_t; name: CharStar; type: tree; lowval: tree; highval: tree) : tree ; (* BuildCharConstant - creates a character constant given a, string. *) -PROCEDURE BuildCharConstant (location: location_t; string: ADDRESS) : Tree ; +PROCEDURE BuildCharConstant (location: location_t; string: ConstCharStar) : tree ; (* BuildCharConstantChar - creates a character constant given a character, ch. *) -PROCEDURE BuildCharConstantChar (location: location_t; ch: CHAR) : Tree ; +PROCEDURE BuildCharConstantChar (location: location_t; ch: CHAR) : tree ; (* BuildArrayConstructorElement - adds, value, to the constructor_element_list. *) -PROCEDURE BuildArrayConstructorElement (p: ADDRESS; value: Tree; indice: Tree) ; +PROCEDURE BuildArrayConstructorElement (p: ADDRESS; value: tree; indice: tree) ; (* @@ -93,7 +92,7 @@ PROCEDURE BuildArrayConstructorElement (p: ADDRESS; value: Tree; indice: Tree) ; compound literal. *) -PROCEDURE BuildEndArrayConstructor (p: Constructor) : Tree ; +PROCEDURE BuildEndArrayConstructor (p: Constructor) : tree ; (* @@ -101,21 +100,21 @@ PROCEDURE BuildEndArrayConstructor (p: Constructor) : Tree ; compound literal. *) -PROCEDURE BuildStartArrayConstructor (type: Tree) : Constructor ; +PROCEDURE BuildStartArrayConstructor (type: tree) : Constructor ; (* BuildRecordConstructorElement - adds, value, to the constructor_element_list. *) -PROCEDURE BuildRecordConstructorElement (p: Constructor; value: Tree) ; +PROCEDURE BuildRecordConstructorElement (p: Constructor; value: tree) ; (* BuildEndRecordConstructor - returns a tree containing the record compound literal. *) -PROCEDURE BuildEndRecordConstructor (p: Constructor) : Tree ; +PROCEDURE BuildEndRecordConstructor (p: Constructor) : tree ; (* @@ -123,21 +122,21 @@ PROCEDURE BuildEndRecordConstructor (p: Constructor) : Tree ; constructor frame. *) -PROCEDURE BuildStartRecordConstructor (type: Tree) : Constructor ; +PROCEDURE BuildStartRecordConstructor (type: tree) : Constructor ; (* BuildEndSetConstructor - finishes building a set constant. *) -PROCEDURE BuildEndSetConstructor (p: Constructor) : Tree ; +PROCEDURE BuildEndSetConstructor (p: Constructor) : tree ; (* BuildSetConstructorElement - adds, value, to the constructor_element_list. *) -PROCEDURE BuildSetConstructorElement (p: Constructor; value: Tree) ; +PROCEDURE BuildSetConstructorElement (p: Constructor; value: tree) ; (* @@ -145,28 +144,28 @@ PROCEDURE BuildSetConstructorElement (p: Constructor; value: Tree) ; Remember that type is really a record type. *) -PROCEDURE BuildStartSetConstructor (type: Tree) : Constructor ; +PROCEDURE BuildStartSetConstructor (type: tree) : Constructor ; (* BuildSetType - creates a SET OF [lowval..highval] *) -PROCEDURE BuildSetType (location: location_t; name: ADDRESS; type: Tree; lowval: Tree; highval: Tree; ispacked: BOOLEAN) : Tree ; +PROCEDURE BuildSetType (location: location_t; name: CharStar; type: tree; lowval: tree; highval: tree; ispacked: BOOLEAN) : tree ; (* BuildConstPointerType - returns a type which is a const pointer to, totype. *) -PROCEDURE BuildConstPointerType (totype: Tree) : Tree ; +PROCEDURE BuildConstPointerType (totype: tree) : tree ; (* BuildPointerType - returns a type which is a pointer to, totype. *) -PROCEDURE BuildPointerType (totype: Tree) : Tree ; +PROCEDURE BuildPointerType (totype: tree) : tree ; (* @@ -174,8 +173,8 @@ PROCEDURE BuildPointerType (totype: Tree) : Tree ; It returns a copy of the value. --fixme-- why do this? *) -PROCEDURE BuildEnumerator (location: location_t; name: ADDRESS; value: Tree; - VAR enumvalues: Tree) : Tree ; +PROCEDURE BuildEnumerator (location: location_t; name: CharStar; value: tree; + VAR enumvalues: tree) : tree ; (* @@ -183,21 +182,21 @@ PROCEDURE BuildEnumerator (location: location_t; name: ADDRESS; value: Tree; list, enumvalues, and returns a enumeration type tree. *) -PROCEDURE BuildEndEnumeration (location: location_t; type: Tree; enumvalues: Tree) : Tree ; +PROCEDURE BuildEndEnumeration (location: location_t; type: tree; enumvalues: tree) : tree ; (* BuildStartEnumeration - create an enumerated type in gcc. *) -PROCEDURE BuildStartEnumeration (location: location_t; name: ADDRESS; ispacked: BOOLEAN) : Tree ; +PROCEDURE BuildStartEnumeration (location: location_t; name: CharStar; ispacked: BOOLEAN) : tree ; (* BuildTypeDeclaration - adds the, type, to the current statement list. *) -PROCEDURE BuildTypeDeclaration (location: location_t; type: Tree) ; +PROCEDURE BuildTypeDeclaration (location: location_t; type: tree) ; (* @@ -205,7 +204,7 @@ PROCEDURE BuildTypeDeclaration (location: location_t; type: Tree) ; legal value. *) -PROCEDURE GetMaxFrom (location: location_t; type: Tree) : Tree ; +PROCEDURE GetMaxFrom (location: location_t; type: tree) : tree ; (* @@ -213,7 +212,7 @@ PROCEDURE GetMaxFrom (location: location_t; type: Tree) : Tree ; legal value. *) -PROCEDURE GetMinFrom (location: location_t; type: Tree) : Tree ; +PROCEDURE GetMinFrom (location: location_t; type: tree) : tree ; (* @@ -229,14 +228,14 @@ PROCEDURE GetMinFrom (location: location_t; type: Tree) : Tree ; declare C default types and _some_ M2 default types. *) -PROCEDURE GetDefaultType (location: location_t; name: ADDRESS; type: Tree) : Tree ; +PROCEDURE GetDefaultType (location: location_t; name: CharStar; type: tree) : tree ; (* BuildEndType - finish declaring, type, and return, type. *) -PROCEDURE BuildEndType (location: location_t; type: Tree) : Tree ; +PROCEDURE BuildEndType (location: location_t; type: tree) : tree ; (* @@ -248,7 +247,7 @@ PROCEDURE BuildEndType (location: location_t; type: Tree) : Tree ; yet to be 'gm2_finish_decl'ed. *) -PROCEDURE BuildStartType (location: location_t; name: ADDRESS; type: Tree) : Tree ; +PROCEDURE BuildStartType (location: location_t; name: CharStar; type: tree) : tree ; (* @@ -271,7 +270,7 @@ PROCEDURE InitBaseTypes (location: location_t) ; This creates and array index, array type and local variable. *) -PROCEDURE BuildVariableArrayAndDeclare (location: location_t; elementtype: Tree; high: Tree; name: ADDRESS; scope: Tree) : Tree ; +PROCEDURE BuildVariableArrayAndDeclare (location: location_t; elementtype: tree; high: tree; name: CharStar; scope: tree) : tree ; (* @@ -286,7 +285,7 @@ PROCEDURE InitFunctionTypeParameters ; It appends this parameter to the internal param_type_list. *) -PROCEDURE BuildProcTypeParameterDeclaration (location: location_t; type: Tree; isreference: BOOLEAN) : Tree ; +PROCEDURE BuildProcTypeParameterDeclaration (location: location_t; type: tree; isreference: BOOLEAN) : tree ; (* @@ -294,7 +293,7 @@ PROCEDURE BuildProcTypeParameterDeclaration (location: location_t; type: Tree; i create a function type. *) -PROCEDURE BuildStartFunctionType (location: location_t; name: ADDRESS) : Tree ; +PROCEDURE BuildStartFunctionType (location: location_t; name: CharStar) : tree ; (* @@ -302,14 +301,14 @@ PROCEDURE BuildStartFunctionType (location: location_t; name: ADDRESS) : Tree ; The arguments have been created by BuildParameterDeclaration. *) -PROCEDURE BuildEndFunctionType (func: Tree; type: Tree; usesvarags: BOOLEAN) : Tree ; +PROCEDURE BuildEndFunctionType (func: tree; type: tree; usesvarags: BOOLEAN) : tree ; (* GetTreeType - returns TREE_TYPE (t). *) -PROCEDURE GetTreeType (type: Tree) : Tree ; +PROCEDURE GetTreeType (type: tree) : tree ; (* @@ -318,31 +317,31 @@ PROCEDURE GetTreeType (type: Tree) : Tree ; name = foo ; *) -PROCEDURE DeclareKnownType (location: location_t; name: ADDRESS; type: Tree) : Tree ; +PROCEDURE DeclareKnownType (location: location_t; name: CharStar; type: tree) : tree ; (* GetM2ZType - return the ISO Z data type, the longest int datatype. *) -PROCEDURE GetM2ZType () : Tree ; +PROCEDURE GetM2ZType () : tree ; (* GetM2RType - return the ISO R data type, the longest real datatype. *) -PROCEDURE GetM2RType () : Tree ; +PROCEDURE GetM2RType () : tree ; (* BuildSetTypeFromSubrange - constructs a set type from a subrangeType. *) -PROCEDURE BuildSetTypeFromSubrange (location: location_t; name: ADDRESS; - subrangeType: Tree; - lowval: Tree; highval: Tree; - ispacked: BOOLEAN) : Tree ; +PROCEDURE BuildSetTypeFromSubrange (location: location_t; name: CharStar; + subrangeType: tree; + lowval: tree; highval: tree; + ispacked: BOOLEAN) : tree ; (* @@ -350,434 +349,434 @@ PROCEDURE BuildSetTypeFromSubrange (location: location_t; name: ADDRESS; sufficient to contain values: low..high. *) -PROCEDURE BuildSmallestTypeRange (location: location_t; low: Tree; high: Tree) : Tree ; +PROCEDURE BuildSmallestTypeRange (location: location_t; low: tree; high: tree) : tree ; (* GetBooleanType - *) -PROCEDURE GetBooleanType () : Tree ; +PROCEDURE GetBooleanType () : tree ; (* GetBooleanFalse - *) -PROCEDURE GetBooleanFalse () : Tree ; +PROCEDURE GetBooleanFalse () : tree ; (* GetBooleanTrue - *) -PROCEDURE GetBooleanTrue () : Tree ; +PROCEDURE GetBooleanTrue () : tree ; (* GetPackedBooleanType - return the packed boolean data type node. *) -PROCEDURE GetPackedBooleanType () : Tree ; +PROCEDURE GetPackedBooleanType () : tree ; (* GetCharType - return the char type node. *) -PROCEDURE GetCharType () : Tree ; +PROCEDURE GetCharType () : tree ; (* GetByteType - return the byte type node. *) -PROCEDURE GetByteType () : Tree ; +PROCEDURE GetByteType () : tree ; (* GetVoidType - return the C void type. *) -PROCEDURE GetVoidType () : Tree ; +PROCEDURE GetVoidType () : tree ; (* GetBitnumType - return the ISO bitnum type. *) -PROCEDURE GetBitnumType () : Tree ; +PROCEDURE GetBitnumType () : tree ; (* GetRealType - *) -PROCEDURE GetRealType () : Tree ; +PROCEDURE GetRealType () : tree ; (* GetLongRealType - return the C long double data type. *) -PROCEDURE GetLongRealType () : Tree ; +PROCEDURE GetLongRealType () : tree ; (* GetShortRealType - return the C float data type. *) -PROCEDURE GetShortRealType () : Tree ; +PROCEDURE GetShortRealType () : tree ; (* GetLongIntType - return the C long int data type. *) -PROCEDURE GetLongIntType () : Tree ; +PROCEDURE GetLongIntType () : tree ; (* GetPointerType - return the GCC ptr type node. Equivalent to (void * ). *) -PROCEDURE GetPointerType () : Tree ; +PROCEDURE GetPointerType () : tree ; (* GetCardinalType - return the cardinal type. *) -PROCEDURE GetCardinalType () : Tree ; +PROCEDURE GetCardinalType () : tree ; (* GetIntegerType - return the integer type node. *) -PROCEDURE GetIntegerType () : Tree ; +PROCEDURE GetIntegerType () : tree ; (* GetWordType - return the C unsigned data type. *) -PROCEDURE GetWordType () : Tree ; +PROCEDURE GetWordType () : tree ; (* GetM2CardinalType - return the m2 cardinal data type. *) -PROCEDURE GetM2CardinalType () : Tree ; +PROCEDURE GetM2CardinalType () : tree ; (* GetBitsetType - return the bitset type. *) -PROCEDURE GetBitsetType () : Tree ; +PROCEDURE GetBitsetType () : tree ; (* GetM2CType - a test function. *) -PROCEDURE GetM2CType () : Tree ; +PROCEDURE GetM2CType () : tree ; (* GetProcType - return the m2 proc data type. *) -PROCEDURE GetProcType () : Tree ; +PROCEDURE GetProcType () : tree ; (* GetM2ComplexType - return the complex type. *) -PROCEDURE GetM2ComplexType () : Tree ; +PROCEDURE GetM2ComplexType () : tree ; (* GetM2LongComplexType - return the long complex type. *) -PROCEDURE GetM2LongComplexType () : Tree ; +PROCEDURE GetM2LongComplexType () : tree ; (* GetM2ShortComplexType - return the short complex type. *) -PROCEDURE GetM2ShortComplexType () : Tree ; +PROCEDURE GetM2ShortComplexType () : tree ; (* GetM2Complex128Type - return the fixed size complex type. *) -PROCEDURE GetM2Complex128 () : Tree ; +PROCEDURE GetM2Complex128 () : tree ; (* GetM2Complex96 - return the fixed size complex type. *) -PROCEDURE GetM2Complex96 () : Tree ; +PROCEDURE GetM2Complex96 () : tree ; (* GetM2Complex64 - return the fixed size complex type. *) -PROCEDURE GetM2Complex64 () : Tree ; +PROCEDURE GetM2Complex64 () : tree ; (* GetM2Complex32 - return the fixed size complex type. *) -PROCEDURE GetM2Complex32 () : Tree ; +PROCEDURE GetM2Complex32 () : tree ; (* GetM2Real128 - return the real 128 bit type. *) -PROCEDURE GetM2Real128 () : Tree ; +PROCEDURE GetM2Real128 () : tree ; (* GetM2Real96 - return the real 96 bit type. *) -PROCEDURE GetM2Real96 () : Tree ; +PROCEDURE GetM2Real96 () : tree ; (* GetM2Real64 - return the real 64 bit type. *) -PROCEDURE GetM2Real64 () : Tree ; +PROCEDURE GetM2Real64 () : tree ; (* GetM2Real32 - return the real 32 bit type. *) -PROCEDURE GetM2Real32 () : Tree ; +PROCEDURE GetM2Real32 () : tree ; (* GetM2Bitset32 - return the bitset 32 bit type. *) -PROCEDURE GetM2Bitset32 () : Tree ; +PROCEDURE GetM2Bitset32 () : tree ; (* GetM2Bitset16 - return the bitset 16 bit type. *) -PROCEDURE GetM2Bitset16 () : Tree ; +PROCEDURE GetM2Bitset16 () : tree ; (* GetM2Bitset8 - return the bitset 8 bit type. *) -PROCEDURE GetM2Bitset8 () : Tree ; +PROCEDURE GetM2Bitset8 () : tree ; (* GetM2Word64 - return the word 64 bit type. *) -PROCEDURE GetM2Word64 () : Tree ; +PROCEDURE GetM2Word64 () : tree ; (* GetM2Word32 - return the word 32 bit type. *) -PROCEDURE GetM2Word32 () : Tree ; +PROCEDURE GetM2Word32 () : tree ; (* GetM2Word16 - return the word 16 bit type. *) -PROCEDURE GetM2Word16 () : Tree ; +PROCEDURE GetM2Word16 () : tree ; (* GetM2Cardinal64 - return the cardinal 64 bit type. *) -PROCEDURE GetM2Cardinal64 () : Tree ; +PROCEDURE GetM2Cardinal64 () : tree ; (* GetM2Cardinal32 - return the cardinal 32 bit type. *) -PROCEDURE GetM2Cardinal32 () : Tree ; +PROCEDURE GetM2Cardinal32 () : tree ; (* GetM2Cardinal16 - return the cardinal 16 bit type. *) -PROCEDURE GetM2Cardinal16 () : Tree ; +PROCEDURE GetM2Cardinal16 () : tree ; (* GetM2Cardinal8 - return the cardinal 8 bit type. *) -PROCEDURE GetM2Cardinal8 () : Tree ; +PROCEDURE GetM2Cardinal8 () : tree ; (* GetM2Integer64 - return the integer 64 bit type. *) -PROCEDURE GetM2Integer64 () : Tree ; +PROCEDURE GetM2Integer64 () : tree ; (* GetM2Integer32 - return the integer 32 bit type. *) -PROCEDURE GetM2Integer32 () : Tree ; +PROCEDURE GetM2Integer32 () : tree ; (* GetM2Integer16 - return the integer 16 bit type. *) -PROCEDURE GetM2Integer16 () : Tree ; +PROCEDURE GetM2Integer16 () : tree ; (* GetM2Integer8 - return the integer 8 bit type. *) -PROCEDURE GetM2Integer8 () : Tree ; +PROCEDURE GetM2Integer8 () : tree ; (* GetISOLocType - return the m2 loc word data type. *) -PROCEDURE GetISOLocType () : Tree ; +PROCEDURE GetISOLocType () : tree ; (* GetISOByteType - return the m2 iso byte data type. *) -PROCEDURE GetISOByteType () : Tree ; +PROCEDURE GetISOByteType () : tree ; (* GetISOWordType - return the m2 iso word data type. *) -PROCEDURE GetISOWordType () : Tree ; +PROCEDURE GetISOWordType () : tree ; (* GetShortCardType - return the C short unsigned data type. *) -PROCEDURE GetShortCardType () : Tree ; +PROCEDURE GetShortCardType () : tree ; (* GetM2ShortCardType - return the m2 short cardinal data type. *) -PROCEDURE GetM2ShortCardType () : Tree ; +PROCEDURE GetM2ShortCardType () : tree ; (* GetShortIntType - return the C short int data type. *) -PROCEDURE GetShortIntType () : Tree ; +PROCEDURE GetShortIntType () : tree ; (* GetM2ShortIntType - return the m2 short integer data type. *) -PROCEDURE GetM2ShortIntType () : Tree ; +PROCEDURE GetM2ShortIntType () : tree ; (* GetM2LongCardType - return the m2 long cardinal data type. *) -PROCEDURE GetM2LongCardType () : Tree ; +PROCEDURE GetM2LongCardType () : tree ; (* GetM2LongIntType - return the m2 long integer data type. *) -PROCEDURE GetM2LongIntType () : Tree ; +PROCEDURE GetM2LongIntType () : tree ; (* GetM2LongRealType - return the m2 long real data type. *) -PROCEDURE GetM2LongRealType () : Tree ; +PROCEDURE GetM2LongRealType () : tree ; (* GetM2RealType - return the m2 real data type. *) -PROCEDURE GetM2RealType () : Tree ; +PROCEDURE GetM2RealType () : tree ; (* GetM2ShortRealType - return the m2 short real data type. *) -PROCEDURE GetM2ShortRealType () : Tree ; +PROCEDURE GetM2ShortRealType () : tree ; (* GetM2IntegerType - return the m2 integer data type. *) -PROCEDURE GetM2IntegerType () : Tree ; +PROCEDURE GetM2IntegerType () : tree ; (* GetM2CharType - return the m2 char data type. *) -PROCEDURE GetM2CharType () : Tree ; +PROCEDURE GetM2CharType () : tree ; (* GetCSizeTType - return a type representing, size_t on this system. *) -PROCEDURE GetCSizeTType () : Tree ; +PROCEDURE GetCSizeTType () : tree ; (* GetCSSizeTType - return a type representing, ssize_t on this system. *) -PROCEDURE GetCSSizeTType () : Tree ; +PROCEDURE GetCSSizeTType () : tree ; (* @@ -786,52 +785,52 @@ PROCEDURE GetCSSizeTType () : Tree ; defined by, str, of, length, characters. *) -PROCEDURE BuildArrayStringConstructor (location: location_t; arrayType: Tree; str: Tree; length: Tree) : Tree ; +PROCEDURE BuildArrayStringConstructor (location: location_t; arrayType: tree; str: tree; length: tree) : tree ; (* RealToTree - convert a real number into a Tree. *) -PROCEDURE RealToTree (name: ADDRESS) : Tree ; +PROCEDURE RealToTree (name: CharStar) : tree ; (* BuildStartRecord - return a RECORD tree. *) -PROCEDURE BuildStartRecord (location: location_t; name: ADDRESS) : Tree ; +PROCEDURE BuildStartRecord (location: location_t; name: CharStar) : tree ; (* BuildStartUnion - return a union tree. *) -PROCEDURE BuildStartUnion (location: location_t; name: ADDRESS) : Tree ; +PROCEDURE BuildStartUnion (location: location_t; name: CharStar) : tree ; -PROCEDURE BuildStartVarient (location: location_t; name: ADDRESS) : Tree ; +PROCEDURE BuildStartVarient (location: location_t; name: CharStar) : tree ; -PROCEDURE BuildEndVarient (location: location_t; varientField: Tree; varientList: Tree; isPacked: BOOLEAN) : Tree ; +PROCEDURE BuildEndVarient (location: location_t; varientField: tree; varientList: tree; isPacked: BOOLEAN) : tree ; -PROCEDURE BuildStartFieldVarient (location: location_t; name: ADDRESS) : Tree ; +PROCEDURE BuildStartFieldVarient (location: location_t; name: CharStar) : tree ; -PROCEDURE BuildEndFieldVarient (location: location_t; varientField: Tree; varientList: Tree; isPacked: BOOLEAN) : Tree ; +PROCEDURE BuildEndFieldVarient (location: location_t; varientField: tree; varientList: tree; isPacked: BOOLEAN) : tree ; -PROCEDURE BuildStartFieldRecord (location: location_t; name: ADDRESS; type: Tree) : Tree ; +PROCEDURE BuildStartFieldRecord (location: location_t; name: CharStar; type: tree) : tree ; -PROCEDURE BuildFieldRecord (location: location_t; name: ADDRESS; type: Tree) : Tree ; +PROCEDURE BuildFieldRecord (location: location_t; name: CharStar; type: tree) : tree ; (* @@ -839,21 +838,21 @@ PROCEDURE BuildFieldRecord (location: location_t; name: ADDRESS; type: Tree) : T declarations. *) -PROCEDURE ChainOn (t1: Tree; t2: Tree) : Tree ; +PROCEDURE ChainOn (t1: tree; t2: tree) : tree ; (* ChainOnParamValue - adds a list node {{name, str}, value} into the tree list. *) -PROCEDURE ChainOnParamValue (list: Tree; name: Tree; str: Tree; value: Tree) : Tree ; +PROCEDURE ChainOnParamValue (list: tree; name: tree; str: tree; value: tree) : tree ; (* AddStringToTreeList - adds, string, to list. *) -PROCEDURE AddStringToTreeList (list: Tree; string: Tree) : Tree ; +PROCEDURE AddStringToTreeList (list: tree; string: tree) : tree ; (* @@ -863,7 +862,7 @@ PROCEDURE AddStringToTreeList (list: Tree; string: Tree) : Tree ; the structure. *) -PROCEDURE BuildEndRecord (location: location_t; record: Tree; fieldlist: Tree; isPacked: BOOLEAN) : Tree ; +PROCEDURE BuildEndRecord (location: location_t; record: tree; fieldlist: tree; isPacked: BOOLEAN) : tree ; (* @@ -872,7 +871,7 @@ PROCEDURE BuildEndRecord (location: location_t; record: Tree; fieldlist: Tree; i to prevent alignment effecting behaviour elsewhere. *) -PROCEDURE SetAlignment (node: Tree; align: Tree) : Tree ; +PROCEDURE SetAlignment (node: tree; align: tree) : tree ; (* @@ -880,7 +879,7 @@ PROCEDURE SetAlignment (node: Tree; align: Tree) : Tree ; It returns the node. *) -PROCEDURE SetDeclPacked (node: Tree) : Tree ; +PROCEDURE SetDeclPacked (node: tree) : tree ; (* @@ -888,7 +887,7 @@ PROCEDURE SetDeclPacked (node: Tree) : Tree ; It returns the node. *) -PROCEDURE SetTypePacked (node: Tree) : Tree ; +PROCEDURE SetTypePacked (node: tree) : tree ; (* @@ -896,7 +895,7 @@ PROCEDURE SetTypePacked (node: Tree) : Tree ; has been applied to it. *) -PROCEDURE SetRecordFieldOffset (field: Tree; byteOffset: Tree; bitOffset: Tree; fieldtype: Tree; nbits: Tree) : Tree ; +PROCEDURE SetRecordFieldOffset (field: tree; byteOffset: tree; bitOffset: tree; fieldtype: tree; nbits: tree) : tree ; (* @@ -904,7 +903,7 @@ PROCEDURE SetRecordFieldOffset (field: Tree; byteOffset: Tree; bitOffset: Tree; name, and, fieldtype. *) -PROCEDURE BuildPackedFieldRecord (location: location_t; name: ADDRESS; fieldtype: Tree) : Tree ; +PROCEDURE BuildPackedFieldRecord (location: location_t; name: CharStar; fieldtype: tree) : tree ; (* @@ -912,21 +911,21 @@ PROCEDURE BuildPackedFieldRecord (location: location_t; name: ADDRESS; fieldtype arrayType. *) -PROCEDURE BuildNumberOfArrayElements (location: location_t; arrayType: Tree) : Tree ; +PROCEDURE BuildNumberOfArrayElements (location: location_t; arrayType: tree) : tree ; (* AddStatement - maps onto add_stmt. *) -PROCEDURE AddStatement (location: location_t; t: Tree) ; +PROCEDURE AddStatement (location: location_t; t: tree) ; (* MarkFunctionReferenced - marks a function as referenced. *) -PROCEDURE MarkFunctionReferenced (f: Tree) ; +PROCEDURE MarkFunctionReferenced (f: tree) ; (* @@ -941,14 +940,14 @@ PROCEDURE GarbageCollect ; low and high are the min, max elements of the array. *) -PROCEDURE BuildArrayIndexType (low: Tree; high: Tree) : Tree ; +PROCEDURE BuildArrayIndexType (low: tree; high: tree) : tree ; (* GetArrayNoOfElements - returns the number of elements in, arraytype. *) -PROCEDURE GetArrayNoOfElements (location: location_t; arraytype: Tree) : Tree ; +PROCEDURE GetArrayNoOfElements (location: location_t; arraytype: tree) : tree ; (* @@ -956,14 +955,14 @@ PROCEDURE GetArrayNoOfElements (location: location_t; arraytype: Tree) : Tree ; and which has ElementType elements. *) -PROCEDURE BuildEndArrayType (arraytype: Tree; elementtype: Tree; indextype: Tree; type: INTEGER) : Tree ; +PROCEDURE BuildEndArrayType (arraytype: tree; elementtype: tree; indextype: tree; type: INTEGER) : tree ; (* PutArrayType - *) -PROCEDURE PutArrayType (array: Tree; type: Tree) ; +PROCEDURE PutArrayType (array: tree; type: tree) ; (* @@ -973,21 +972,21 @@ PROCEDURE PutArrayType (array: Tree; type: Tree) ; NULL_TREE. *) -PROCEDURE BuildStartArrayType (index_type: Tree; elt_type: Tree; type: INTEGER) : Tree ; +PROCEDURE BuildStartArrayType (index_type: tree; elt_type: tree; type: INTEGER) : tree ; (* IsAddress - return TRUE if the type is an ADDRESS. *) -PROCEDURE IsAddress (type: Tree) : BOOLEAN ; +PROCEDURE IsAddress (type: tree) : BOOLEAN ; (* SameRealType - return true if real types a and b are the same. *) -PROCEDURE SameRealType (a, b: Tree) : BOOLEAN ; +PROCEDURE SameRealType (a, b: tree) : BOOLEAN ; END m2type. |