aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch13.adb
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2019-08-20 09:50:19 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-08-20 09:50:19 +0000
commitcf0e5ca723edbb63719ca075fce3f84eb8e43553 (patch)
treecd0ad2fd4b60b699963083199c6eae5157111a3c /gcc/ada/exp_ch13.adb
parent31fde973e5cb886dca17e61b84a72a26a81487ad (diff)
downloadgcc-cf0e5ca723edbb63719ca075fce3f84eb8e43553.zip
gcc-cf0e5ca723edbb63719ca075fce3f84eb8e43553.tar.gz
gcc-cf0e5ca723edbb63719ca075fce3f84eb8e43553.tar.bz2
[Ada] Improve speed of discriminated return types
The compiler now generates faster code for functions that return discriminated types in many cases where the size is known at compile time. 2019-08-20 Bob Duff <duff@adacore.com> gcc/ada/ * exp_ch6.adb (Needs_BIP_Alloc_Form): Call Requires_Transient_Scope rather than checking constrainedness and so forth. We have previously improved Requires_Transient_Scope to return False in various cases, notably a limited record with an access discriminant. This change takes advantage of that to avoid using the secondary stack for functions returning such types. (Make_Build_In_Place_Call_In_Allocator): Be consistent by calling Needs_BIP_Alloc_Form rather than Is_Constrained and so forth. * sem_ch4.adb (Analyze_Allocator): The above change causes the compiler to generate code that is not legal Ada, in particular an uninitialized allocator for indefinite subtype. This is harmless, so we suppress the error message in this case. From-SVN: r274738
Diffstat (limited to 'gcc/ada/exp_ch13.adb')
0 files changed, 0 insertions, 0 deletions