8sa1-gcc/gcc/d
Iain Buclaw 8e84a14291 d: Update language attribute support, and implement gcc.attributes
D attribute support has been updated to have a baseline parity with the
LLVM D compiler's own `ldc.attributes'.

The handler that extracts GCC attributes from a list of UDAs has been
improved to take care of some mistakes that could have been warnings.
UDAs attached to field variables are also now processed for any GCC
attributes attached to them.

The following new attributes have been added to the D front-end:

 - @attribute("alloc_size")
 - @attribute("used")
 - @attribute("optimize")
 - @attribute("restrict")
 - @attribute("cold")
 - @attribute("noplt")
 - @attribute("target_clones")
 - @attribute("no_icf")
 - @attribute("noipa")
 - @attribute("symver")

With convenience aliases in a new `gcc.attributes' module to match
the same naming convention as `ldc.attributes':

 - @allocSize()
 - @assumeUsed
 - @fastmath
 - @naked
 - @restrict
 - @cold
 - @noplt
 - @optStrategy()
 - @polly
 - @section()
 - @target()
 - @weak

The old gcc.attribute module has been deprecated, along with the removal
of the following attribute handlers:

 - @attribute("alias"): Has been superseded by `pragma(mangle)'.
 - @attribute("forceinline"): Renamed to always_inline.

gcc/d/ChangeLog:

	* d-attribs.cc: Include fold-const.h and opts.h.
	(attr_noreturn_exclusions): Add alloc_size.
	(attr_const_pure_exclusions): Likewise.
	(attr_inline_exclusions): Add target_clones.
	(attr_noinline_exclusions): Rename forceinline to always_inline.
	(attr_target_exclusions): New array.
	(attr_target_clones_exclusions): New array.
	(attr_alloc_exclusions): New array.
	(attr_cold_hot_exclusions): New array.
	(d_langhook_common_attribute_table): Add new D attribute handlers.
	(build_attributes): Update to look for gcc.attributes.  Issue warning
	if not given a struct literal.  Handle void initialized arguments.
	(handle_always_inline_attribute): Remove function.
	(d_handle_noinline_attribute): Don't extract TYPE_LANG_FRONTEND.
	(d_handle_forceinline_attribute): Rename to...
	(d_handle_always_inline_attribute): ...this.  Remove special handling.
	(d_handle_flatten_attribute): Don't extract TYPE_LANG_FRONTEND.
	(d_handle_target_attribute): Likewise.  Warn about empty arguments.
	(d_handle_target_clones_attribute): New function.
	(optimize_args): New static variable.
	(parse_optimize_options): New function.
	(d_handle_optimize_attribute): New function.
	(d_handle_noclone_attribute): Don't extract TYPE_LANG_FRONTEND.
	(d_handle_alias_attribute): Remove function.
	(d_handle_noicf_attribute): New function.
	(d_handle_noipa_attribute): New function.
	(d_handle_section_attribute): Call the handle_generic_attribute target
	hook after performing target independent processing.
	(d_handle_symver_attribute): New function.
	(d_handle_noplt_attribute): New function.
	(positional_argument): New function.
	(d_handle_alloc_size_attribute): New function.
	(d_handle_cold_attribute): New function.
	(d_handle_restrict_attribute): New function.
	(d_handle_used_attribute): New function.
	* decl.cc (gcc_attribute_p): Update to look for gcc.attributes.
	(get_symbol_decl): Update decl source location of old prototypes to
	the new declaration being merged.
	* types.cc (layout_aggregate_members): Apply user defined attributes
	on fields.

libphobos/ChangeLog:

	* libdruntime/Makefile.am (DRUNTIME_DSOURCES): Add
	  gcc/attributes.d.
	* libdruntime/Makefile.in: Regenerate.
	* libdruntime/gcc/attribute.d: Deprecate module, publicly import
	gcc.attributes.
	* libdruntime/gcc/deh.d: Update imports.
	* libdruntime/gcc/attributes.d: New file.

gcc/testsuite/ChangeLog:

	* gdc.dg/gdc108.d: Update test.
	* gdc.dg/gdc142.d: Likewise.
	* gdc.dg/pr90136a.d: Likewise.
	* gdc.dg/pr90136b.d: Likewise.
	* gdc.dg/pr90136c.d: Likewise.
	* gdc.dg/pr95173.d: Likewise.
	* gdc.dg/attr_allocsize1.d: New test.
	* gdc.dg/attr_allocsize2.d: New test.
	* gdc.dg/attr_alwaysinline1.d: New test.
	* gdc.dg/attr_cold1.d: New test.
	* gdc.dg/attr_exclusions1.d: New test.
	* gdc.dg/attr_exclusions2.d: New test.
	* gdc.dg/attr_flatten1.d: New test.
	* gdc.dg/attr_module.d: New test.
	* gdc.dg/attr_noclone1.d: New test.
	* gdc.dg/attr_noicf1.d: New test.
	* gdc.dg/attr_noinline1.d: New test.
	* gdc.dg/attr_noipa1.d: New test.
	* gdc.dg/attr_noplt1.d: New test.
	* gdc.dg/attr_optimize1.d: New test.
	* gdc.dg/attr_optimize2.d: New test.
	* gdc.dg/attr_optimize3.d: New test.
	* gdc.dg/attr_optimize4.d: New test.
	* gdc.dg/attr_restrict1.d: New test.
	* gdc.dg/attr_section1.d: New test.
	* gdc.dg/attr_symver1.d: New test.
	* gdc.dg/attr_target1.d: New test.
	* gdc.dg/attr_targetclones1.d: New test.
	* gdc.dg/attr_used1.d: New test.
	* gdc.dg/attr_used2.d: New test.
	* gdc.dg/attr_weak1.d: New test.
	* gdc.dg/imports/attributes.d: New test.
2021-04-08 15:30:47 +02:00
..
dmd d: Fix missing call to va_end in getMatchError [PR99917] 2021-04-06 19:43:31 +02:00
ChangeLog Daily bump. 2021-04-07 00:16:39 +00:00
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020
config-lang.in d: Don't generate per-module wrapper for calling DSO constructor/destructor. 2021-03-28 14:47:35 +02:00
d-attribs.cc d: Update language attribute support, and implement gcc.attributes 2021-04-08 15:30:47 +02:00
d-builtins.cc d: Predefine the D_PIE version condition when flag_pie is set. 2021-03-28 17:46:36 +02:00
d-codegen.cc d: Use Array::find to get index of element 2021-04-06 19:43:31 +02:00
d-compiler.cc d: Merge upstream dmd 7132b3537 2021-02-13 12:50:45 +01:00
d-convert.cc d: Merge upstream dmd 3b808e838, druntime 483bc129, phobos f89dc217a 2021-04-04 01:26:20 +02:00
d-ctfloat.cc
d-diagnostic.cc d: Increment gaggedWarnings if warning or deprecation message was suppressed 2021-04-06 19:43:31 +02:00
d-frontend.cc d: Merge upstream dmd 46133f761, druntime 0fd4364c 2021-02-04 23:04:48 +01:00
d-gimplify.cc
d-incpath.cc
d-lang.cc d: Use weak linkage for template symbols instead of gnu.linkonce (PR99914) 2021-04-05 13:40:36 +02:00
d-longdouble.cc
d-port.cc
d-spec.cc
d-system.h d: Use COMPILER_FOR_BUILD to build all D front-end generator programs 2021-03-28 14:47:35 +02:00
d-target-def.h
d-target.cc d: Merge upstream dmd 3b808e838, druntime 483bc129, phobos f89dc217a 2021-04-04 01:26:20 +02:00
d-target.def
d-target.h
d-tree.def
d-tree.h d: Use weak linkage for template symbols instead of gnu.linkonce (PR99914) 2021-04-05 13:40:36 +02:00
decl.cc d: Update language attribute support, and implement gcc.attributes 2021-04-08 15:30:47 +02:00
expr.cc
gdc.texi d: Use weak linkage for template symbols instead of gnu.linkonce (PR99914) 2021-04-05 13:40:36 +02:00
imports.cc
intrinsics.cc d: Remove the expansion of intrinsic and built-in codes from the DEF_D_INTRINSIC macro 2021-02-05 18:27:49 +01:00
intrinsics.def d: Remove the expansion of intrinsic and built-in codes from the DEF_D_INTRINSIC macro 2021-02-05 18:27:49 +01:00
lang-specs.h
lang.opt d: Use weak linkage for template symbols instead of gnu.linkonce (PR99914) 2021-04-05 13:40:36 +02:00
longdouble.h
Make-lang.in d: Merge upstream dmd 3b808e838, druntime 483bc129, phobos f89dc217a 2021-04-04 01:26:20 +02:00
modules.cc d: Use weak linkage for template symbols instead of gnu.linkonce (PR99914) 2021-04-05 13:40:36 +02:00
README.gcc
runtime.cc
runtime.def
toir.cc d: Merge upstream dmd 3b808e838, druntime 483bc129, phobos f89dc217a 2021-04-04 01:26:20 +02:00
typeinfo.cc d: Use weak linkage for template symbols instead of gnu.linkonce (PR99914) 2021-04-05 13:40:36 +02:00
types.cc d: Update language attribute support, and implement gcc.attributes 2021-04-08 15:30:47 +02:00
verstr.h

The files in the dmd subdirectory are part of the front-end for the
Digital Mars D compiler, hosted at https://github.com/dlang/dmd/.

They cover the lexical analysis, parsing, and semantic analysis of the
D Programming Language defined in the documents at https://dlang.org/.

To report a problem or look up known issues with the dmd front-end,
please visit the issue tracker at https://issues.dlang.org/.

All changes to dmd should go through the upstream repository first,
then merged back to GCC.