From a4fafb7722c9950dacd5689f1ce8e31f8fa94ed5 Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Mon, 13 Feb 2023 17:45:50 +0100 Subject: backends: Support returning lvalue and rvalue references On the low level, they are the same as pointers. The change needs to be done for all backends, so define a function and a macro to avoid repetition. Also add a native test, which has to be implemented in C++. Add the configure check for it. Signed-off-by: Ilya Leoshkevich --- backends/arm_retval.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'backends/arm_retval.c') diff --git a/backends/arm_retval.c b/backends/arm_retval.c index 1c28f016..fa6d3914 100644 --- a/backends/arm_retval.c +++ b/backends/arm_retval.c @@ -86,14 +86,13 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_base_type: case DW_TAG_enumeration_type: - case DW_TAG_pointer_type: - case DW_TAG_ptr_to_member_type: + CASE_POINTER: { Dwarf_Attribute attr_mem; if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, &attr_mem), &size) != 0) { - if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) + if (dwarf_is_pointer (tag)) size = 4; else return -1; -- cgit v1.2.3