Merge common attribute handling code between D and c-family #247

Closed
imperio wants to merge 1 commit from imperio/gcc:d-common-attrs into trunk
Member

Follow-up of #207 and of #241.

It merges common code for attributes handling between the D front-end and attr-handlers.c.

CC: gcc-patches@gcc.gnu.org @ibuclaw

Follow-up of #207 and of #241. It merges common code for attributes handling between the D front-end and `attr-handlers.c`. CC: gcc-patches@gcc.gnu.org @ibuclaw
Merge common attribute handling code between D and c-family
Some checks failed
/ format-checks (pull_request) Failing after 1m22s
5d442ee15b
gcc/d/ChangeLog:

	* Make-lang.in: Add compilation of `attr-handlers.c` in
	D front-end.
	* d-attribs.cc (handle_leaf_attribute) (handle_const_attribute)
	(handle_pure_attribute) (handle_novops_attribute)
	(handle_nothrow_attribute) (handle_type_generic_attribute)
	(handle_returns_twice_attribute) (handle_fnspec_attribute)
	(d_handle_noinline_attribute) (d_handle_used_attribute)
	(d_handle_simd_attribute): Remove the functions provided by
	`attr-handlers.c`.
Author
Member

/submit

/submit
ibuclaw approved these changes 2026-10-09 12:57:26 +00:00
ibuclaw left a comment

SGTM

SGTM
@ -244,3 +244,3 @@
@$(call LINK_PROGRESS,$(INDEX.d),start)
+$(DLLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -static-libphobos -o $@ \
$(D_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
$(D_ALL_OBJS) attribs.o attr-handlers.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
Member

CI says please wrap these to 80 characters.

d21$(exeext): $(D_ALL_OBJS) attribs.o attr-handlers.o $(BACKEND) $(LIBDEPS) $(d.prev)
		@$(call LINK_PROGRESS,$(INDEX.d),start)
		+$(DLLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -static-libphobos -o $@ \
			$(D_ALL_OBJS) attribs.o attr-handlers.o $(BACKEND) $(LIBS) \
			$(BACKENDLIBS)

Not so bothered myself though, as these makefiles barely adhere to the rule themselves.

CI says please wrap these to 80 characters. ```make d21$(exeext): $(D_ALL_OBJS) attribs.o attr-handlers.o $(BACKEND) $(LIBDEPS) $(d.prev) @$(call LINK_PROGRESS,$(INDEX.d),start) +$(DLLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -static-libphobos -o $@ \ $(D_ALL_OBJS) attribs.o attr-handlers.o $(BACKEND) $(LIBS) \ $(BACKENDLIBS) ``` Not so bothered myself though, as these makefiles barely adhere to the rule themselves.
Author
Member

I didn't even know they were following the rules considering how many lines are longer than 80 columns. Well, gonna ignore it if you don't mind. ^^'

I didn't even know they were following the rules considering how many lines are longer than 80 columns. Well, gonna ignore it if you don't mind. ^^'
Member

Hi @imperio. This bot helps send your PR as a patch series to the mailing list.

Next steps

  1. Write a clear PR description. It will be used as the cover letter.
  2. To CC extra people, add lines like this at the end of the PR description: CC: Reviewer1 <revi.ewer@example.com>, Reviewer2 <an.other@example.com>.
  3. To preview the emails, comment with /preview.
  4. When ready, request review in the Reviewers section. Or, if you just want to send the series, comment with /submit.
  5. Use the cover-letter links below to follow replies.
  6. For a new patch series, push your changes, update the PR description with a Changes since vX section, and comment with /submit again.

See Submitting Patches and UsingForge.

Consider joining the gcc and gcc-patches mailing lists..
For real time communication, check the gcc irc channels.

Or join #overseers on Libera Chat, particularly if this automation is not working (stay online to get replies, IRC does not save messages if people are not online).

<!-- pr-welcome --> Hi @imperio. This bot helps send your PR as a patch series to the mailing list. ## Next steps 1. Write a clear PR description. It will be used as the cover letter. 2. To CC extra people, add lines like this **at the end** of the PR description: `CC: Reviewer1 <revi.ewer@example.com>, Reviewer2 <an.other@example.com>`. 3. To preview the emails, comment with `/preview`. 4. When ready, request review in the Reviewers section. Or, if you just want to send the series, comment with `/submit`. 5. Use the cover-letter links below to follow replies. 6. For a new patch series, push your changes, update the PR description with a `Changes since vX` section, and comment with `/submit` again. See [Submitting Patches](https://gcc.gnu.org/contribute.html#patches) and [UsingForge](https://gcc.gnu.org/wiki/UsingForge). Consider joining the [gcc and gcc-patches mailing lists.](https://gcc.gnu.org/lists.html). For real time communication, check the [gcc irc channels](https://gcc.gnu.org/wiki/GCConIRC). Or join [`#overseers`](https://web.libera.chat/#overseers) on Libera Chat, particularly if this automation is not working (stay online to get replies, IRC does not save messages if people are not online).
Member
Cannot post as:
<!-- pr-not-posted -->Cannot post as: - gcc-patches@gcc.gnu.org @ibuclaw is not a valid email address
Member
Cannot publish to mailing list as:
<!-- pr-not-posted -->Cannot publish to mailing list as: - gcc-patches@gcc.gnu.org @ibuclaw is not a valid email address
Author
Member

Patch merged in commit 27e2ba94e1. Closing.

Patch merged in commit 27e2ba94e16ab5bf7972e626f5df4e753d305152. Closing.
imperio closed this pull request 2026-10-22 15:07:50 +00:00
Some checks failed
/ format-checks (pull_request) Failing after 1m22s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gcc/gcc!247
No description provided.