[committed] d: Field names of anonymous delegates should be same as regular delegate types.

Message ID 20220815194009.2356082-1-ibuclaw@gdcproject.org
State Committed
Commit 9fb12ee6fb75be4f980a235dc3f28a29ecc80de0
Headers
Series [committed] d: Field names of anonymous delegates should be same as regular delegate types. |

Commit Message

Iain Buclaw Aug. 15, 2022, 7:40 p.m. UTC
  Hi,

This patch adjusts the field names of delegate csts constructed inline.
Doesn't change anything in the code generation or ABI, but makes it
consistent with regular delegates as names would match up when
inspecting tree dumps.

Regression tested on x86_64-linux-gnu and committed to mainline.

Regards,
Iain.

---
gcc/d/ChangeLog:

	* d-codegen.cc (build_delegate_cst): Give anonymous delegate field
	names same as per ABI spec.
---
 gcc/d/d-codegen.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc
index 3fd4bee58f6..d02da1f81e3 100644
--- a/gcc/d/d-codegen.cc
+++ b/gcc/d/d-codegen.cc
@@ -419,8 +419,8 @@  build_delegate_cst (tree method, tree object, Type *type)
     {
       /* Convert a function method into an anonymous delegate.  */
       ctype = make_struct_type ("delegate()", 2,
-				get_identifier ("object"), TREE_TYPE (object),
-				get_identifier ("func"), TREE_TYPE (method));
+				get_identifier ("ptr"), TREE_TYPE (object),
+				get_identifier ("funcptr"), TREE_TYPE (method));
       TYPE_DELEGATE (ctype) = 1;
     }