2 Copyright (C) 1987-2023 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
22 #include "coretypes.h"
30 /* Iteratively hash rtx X into HSTATE. */
33 add_rtx (const_rtx x
, hash
&hstate
)
43 hstate
.add_object (code
);
45 hstate
.add_object (mode
);
49 hstate
.add_int (REGNO (x
));
52 hstate
.add_object (INTVAL (x
));
55 for (i
= 0; i
< CONST_WIDE_INT_NUNITS (x
); i
++)
56 hstate
.add_object (CONST_WIDE_INT_ELT (x
, i
));
59 for (i
= 0; i
< NUM_POLY_INT_COEFFS
; ++i
)
60 hstate
.add_wide_int (CONST_POLY_INT_COEFFS (x
)[i
]);
64 hstate
.add (XSTR (x
, 0), strlen (XSTR (x
, 0)) + 1);
72 case DEBUG_IMPLICIT_PTR
:
73 case DEBUG_PARAMETER_REF
:
79 fmt
= GET_RTX_FORMAT (code
);
80 for (i
= GET_RTX_LENGTH (code
) - 1; i
>= 0; i
--)
84 hstate
.add_hwi (XWINT (x
, i
));
88 hstate
.add_int (XINT (x
, i
));
91 hstate
.add_poly_int (SUBREG_BYTE (x
));
97 for (j
= 0; j
< XVECLEN (x
, i
); j
++)
98 inchash::add_rtx (XVECEXP (x
, i
, j
), hstate
);
101 inchash::add_rtx (XEXP (x
, i
), hstate
);
106 hstate
.add (XSTR (x
, 0), strlen (XSTR (x
, 0)) + 1);