]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[modula2] Tidyup remove unused local variables
authorGaius Mulley <gaiusmod2@gmail.com>
Tue, 29 Jul 2025 14:52:58 +0000 (15:52 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Tue, 29 Jul 2025 14:52:58 +0000 (15:52 +0100)
This patch removes unused local variables from three procedures.

gcc/m2/ChangeLog:

* gm2-compiler/M2GenGCC.mod (FoldBecomes): Remove all
local variables.
(CodeIndrX): Remove length.
Remove newstr.
* gm2-compiler/M2Range.mod (FoldTypeIndrX): Remove desType.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/M2GenGCC.mod
gcc/m2/gm2-compiler/M2Range.mod

index 4a9ced32dcfa3b32755a58fac37410d88d4cc2a3..2507c536181cb195e58157430a6092a5183af2ec 100644 (file)
@@ -2903,9 +2903,6 @@ END CheckStop ;
 *)
 
 PROCEDURE FoldBecomes (p: WalkAction; bb: BasicBlock; quad: CARDINAL) ;
-VAR
-   op            : QuadOperator ;
-   des, op2, expr: CARDINAL ;
 BEGIN
    IF DeclaredOperandsBecomes (p, quad)
    THEN
@@ -8154,8 +8151,6 @@ VAR
    rightpos,
    typepos,
    indrxpos        : CARDINAL ;
-   length,
-   newstr          : tree ;
    location        : location_t ;
 BEGIN
    GetQuadOtok (quad, indrxpos, op, left, type, right,
index dcac2ba33c5332f55203a48a23486504b8963bba..f1516d3a5e50994a651f8696401dda232f7b78a3 100644 (file)
@@ -1869,14 +1869,12 @@ END FoldTypeAssign ;
 
 PROCEDURE FoldTypeIndrX (q: CARDINAL; tokenNo: CARDINAL; des, expr: CARDINAL; r: CARDINAL) ;
 VAR
-   desType,
    exprType: CARDINAL ;
 BEGIN
    (* Need to skip over a variable or temporary in des and expr so
       long as expr is not a procedure.  In the case of des = *expr,
       both expr and des will be variables due to the property of
       indirection.  *)
-   desType := GetType (des) ;
    IF IsProcedure (expr)
    THEN
       (* Must not GetType for a procedure as it gives the return type.  *)