diff options
author | Gaius Mulley <gaiusmod2@gmail.com> | 2024-01-11 00:53:56 +0000 |
---|---|---|
committer | Gaius Mulley <gaiusmod2@gmail.com> | 2024-01-11 00:53:56 +0000 |
commit | 96a9355a3d5b24f010fa6ad0b51bba5cc3f334f1 (patch) | |
tree | 2f4f5ade3a9423aa1410d376a2e3e3b72d51f741 /gcc/c | |
parent | be9b6820a09f9b660eeae187ef3eb967e718232f (diff) | |
download | gcc-96a9355a3d5b24f010fa6ad0b51bba5cc3f334f1.zip gcc-96a9355a3d5b24f010fa6ad0b51bba5cc3f334f1.tar.gz gcc-96a9355a3d5b24f010fa6ad0b51bba5cc3f334f1.tar.bz2 |
PR modula2/112946 set expression type checking
This patch adds type checking for binary set operators.
It also checks the IN operator and improves the := type checking.
gcc/m2/ChangeLog:
PR modula2/112946
* gm2-compiler/M2GenGCC.mod (IsExpressionCompatible): Import.
(ExpressionTypeCompatible): Import.
(CodeStatement): Remove op1, op2, op3 parameters from CodeSetOr,
CodeSetAnd, CodeSetSymmetricDifference, CodeSetLogicalDifference.
(checkArrayElements): Rename op1 to des and op3 to expr.
Use despos and exprpos instead of CurrentQuadToken.
(checkRecordTypes): Rename op1 to des and op2 to expr.
Use virtpos instead of CurrentQuadToken.
(checkIncorrectMeta): Ditto.
(checkBecomes): Rename op1 to des and op3 to expr.
Use virtpos instead of CurrentQuadToken.
(NoWalkProcedure): New procedure stub.
(CheckBinaryExpressionTypes): New procedure function.
(CheckElementSetTypes): New procedure function.
(CodeBinarySet): Re-write.
(FoldBinarySet): Re-write.
(CodeSetOr): Remove parameters op1, op2 and op3.
(CodeSetAnd): Ditto.
(CodeSetLogicalDifference): Ditto.
(CodeSetSymmetricDifference): Ditto.
(CodeIfIn): Call CheckBinaryExpressionTypes and
CheckElementSetTypes.
* gm2-compiler/M2Quads.mod (BuildRotateFunction): Correct
parameters to MakeVirtualTok to reflect parameter block
passed to Rotate.
gcc/testsuite/ChangeLog:
PR modula2/112946
* gm2/pim/fail/badbecomes.mod: New test.
* gm2/pim/fail/badexpression.mod: New test.
* gm2/pim/fail/badexpression2.mod: New test.
* gm2/pim/fail/badifin.mod: New test.
* gm2/pim/pass/goodifin.mod: New test.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions