]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Support for 64-bit location_t: Backend parts
authorLewis Hyatt <lhyatt@gmail.com>
Sat, 26 Oct 2024 15:13:30 +0000 (11:13 -0400)
committerLewis Hyatt <lhyatt@gcc.gnu.org>
Sat, 30 Nov 2024 18:01:46 +0000 (13:01 -0500)
A few targets have been using "unsigned int" function arguments that need to
receive a "location_t". Change to "location_t" to prepare for the
possibility that location_t can be configured to be a different type.

gcc/ChangeLog:

* config/aarch64/aarch64-c.cc (aarch64_resolve_overloaded_builtin):
Change "unsigned int" argument to "location_t".
* config/avr/avr-c.cc (avr_resolve_overloaded_builtin): Likewise.
* config/riscv/riscv-c.cc (riscv_resolve_overloaded_builtin): Likewise.
* target.def: Likewise.
* doc/tm.texi: Regenerate.

gcc/config/aarch64/aarch64-c.cc
gcc/config/avr/avr-c.cc
gcc/config/riscv/riscv-c.cc
gcc/doc/tm.texi
gcc/target.def

index 3cc2c97c6d8e80724e75cec5fcc75de53090531a..dba103a7fb150450f9497556a9c2c7ecf4ca3171 100644 (file)
@@ -382,11 +382,10 @@ aarch64_pragma_aarch64 (cpp_reader *)
 
 /* Implement TARGET_RESOLVE_OVERLOADED_BUILTIN.  */
 static tree
-aarch64_resolve_overloaded_builtin (unsigned int uncast_location,
+aarch64_resolve_overloaded_builtin (location_t location,
                                    tree fndecl, void *uncast_arglist)
 {
   vec<tree, va_gc> empty = {};
-  location_t location = (location_t) uncast_location;
   vec<tree, va_gc> *arglist = (uncast_arglist
                               ? (vec<tree, va_gc> *) uncast_arglist
                               : &empty);
index 7db88a8c77a15141defd3526aeec3088bb8cb061..5d7dad5a5ed8b57d1581a998c01b6c26d616e634 100644 (file)
@@ -48,11 +48,10 @@ enum avr_builtin_id
 /* Implement `TARGET_RESOLVE_OVERLOADED_PLUGIN'.  */
 
 static tree
-avr_resolve_overloaded_builtin (unsigned int iloc, tree fndecl, void *vargs)
+avr_resolve_overloaded_builtin (location_t loc, tree fndecl, void *vargs)
 {
   tree type0, type1, fold = NULL_TREE;
   avr_builtin_id id = AVR_BUILTIN_COUNT;
-  location_t loc = (location_t) iloc;
   vec<tree, va_gc> &args = * (vec<tree, va_gc> *) vargs;
 
   switch (DECL_MD_FUNCTION_CODE (fndecl))
index c59f408d3a8ed357ea6edf1277827cc152a45454..7f78e2cf019fb481b6db3a32751783ebf6d32869 100644 (file)
@@ -312,11 +312,10 @@ riscv_check_builtin_call (location_t loc, vec<location_t> arg_loc, tree fndecl,
 
 /* Implement TARGET_RESOLVE_OVERLOADED_BUILTIN.  */
 static tree
-riscv_resolve_overloaded_builtin (unsigned int uncast_location, tree fndecl,
+riscv_resolve_overloaded_builtin (location_t loc, tree fndecl,
                                  void *uncast_arglist)
 {
   vec<tree, va_gc> empty = {};
-  location_t loc = (location_t) uncast_location;
   vec<tree, va_gc> *arglist = (vec<tree, va_gc> *) uncast_arglist;
   unsigned int code = DECL_MD_FUNCTION_CODE (fndecl);
   unsigned int subcode = code >> RISCV_BUILTIN_SHIFT;
index 05f85f83858f34a6b2f6a19f05edc6bb66415d72..64f9d7850638859d21b03b2623d9e50e5696c811 100644 (file)
@@ -12131,7 +12131,7 @@ ignored.  This function should return the result of the call to the
 built-in function.
 @end deftypefn
 
-@deftypefn {Target Hook} tree TARGET_RESOLVE_OVERLOADED_BUILTIN (unsigned int @var{loc}, tree @var{fndecl}, void *@var{arglist})
+@deftypefn {Target Hook} tree TARGET_RESOLVE_OVERLOADED_BUILTIN (location_t @var{loc}, tree @var{fndecl}, void *@var{arglist})
 Select a replacement for a machine specific built-in function that
 was set up by @samp{TARGET_INIT_BUILTINS}.  This is done
 @emph{before} regular type checking, and so allows the target to
index cda3d4f4b8ff4209885410ec324320d97a07d6d0..413fed9bff2dcddb18c6a58757514b08184faa2e 100644 (file)
@@ -2497,7 +2497,7 @@ arguments passed to the built-in function.  The result is a\n\
 complete expression that implements the operation, usually\n\
 another @code{CALL_EXPR}.\n\
 @var{arglist} really has type @samp{VEC(tree,gc)*}",
- tree, (unsigned int /*location_t*/ loc, tree fndecl, void *arglist), NULL)
+ tree, (location_t loc, tree fndecl, void *arglist), NULL)
 
 DEFHOOK
 (check_builtin_call,