\f
/* Built-in functions to perform an untyped call and return. */
-#define set_apply_args_size(x) \
- (this_target_builtins->x_apply_args_size_plus_one = 1 + (x))
-#define get_apply_args_size() \
- (this_target_builtins->x_apply_args_size_plus_one - 1)
+/* Wrapper that implicitly applies a delta when getting or setting the
+ enclosed value. */
+template <typename T>
+class delta_type
+{
+ T &value; T const delta;
+public:
+ delta_type (T &val, T dlt) : value (val), delta (dlt) {}
+ operator T () const { return value + delta; }
+ T operator = (T val) const { value = val - delta; return val; }
+};
+
+#define saved_apply_args_size \
+ (delta_type<int> (this_target_builtins->x_apply_args_size_plus_one, -1))
#define apply_args_mode \
(this_target_builtins->x_apply_args_mode)
-#define set_apply_result_size(x) \
- (this_target_builtins->x_apply_result_size_plus_one = 1 + (x))
-#define get_apply_result_size() \
- (this_target_builtins->x_apply_result_size_plus_one - 1)
+#define saved_apply_result_size \
+ (delta_type<int> (this_target_builtins->x_apply_result_size_plus_one, -1))
#define apply_result_mode \
(this_target_builtins->x_apply_result_mode)
static int
apply_args_size (void)
{
- int size = get_apply_args_size ();
+ int size = saved_apply_args_size;
int align;
unsigned int regno;
else
apply_args_mode[regno] = as_a <fixed_size_mode> (VOIDmode);
- set_apply_args_size (size);
+ saved_apply_args_size = size;
}
return size;
}
static int
apply_result_size (void)
{
- int size = get_apply_result_size ();
+ int size = saved_apply_result_size;
int align, regno;
/* The values computed by this function never change. */
size = APPLY_RESULT_SIZE;
#endif
- set_apply_result_size (size);
+ saved_apply_result_size = size;
}
return size;
}