diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-07-31 14:51:34 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-07-31 14:51:34 +0200 |
commit | f087ea4445c639926873179da29955c3a968ddc7 (patch) | |
tree | 22a06ca7e0f64d9f875617f4a6913429cf2785ab /gcc/ada/gcc-interface/utils.c | |
parent | d780e54fa036407bc057a43f2ebf7d945b80add0 (diff) | |
download | gcc-f087ea4445c639926873179da29955c3a968ddc7.zip gcc-f087ea4445c639926873179da29955c3a968ddc7.tar.gz gcc-f087ea4445c639926873179da29955c3a968ddc7.tar.bz2 |
[multiple changes]
2014-07-31 Hristian Kirtchev <kirtchev@adacore.com>
* sem_util.adb (Is_Effectively_Volatile): New routine.
2014-07-31 Fedor Rybin <frybin@adacore.com>
* gnat_ugn.texi: Document --test-duration option for gnattest.
2014-07-31 Javier Miranda <miranda@adacore.com>
* opt.ads (Back_End_Inlining): New variable which controls
activation of inlining by back-end expansion.
* gnat1drv.adb (Adjust_Global_Switches): Initialize Back_End_Inlining
* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Do not build
the body to be inlined by the frontend if Back_End_Inlining
is enabled.
* exp_ch6.adb (Register_Backend_Call): Moved to inline.adb.
(Expand_Call): If backend inlining is enabled let the backend to
handle inlined subprograms.
* inline.ads (Register_Backend_Call): Moved here from exp_ch6
* inline.adb (Register_Backend_Call): Moved here from exp_ch6.
(Add_Inlined_Subprogram): Add subprograms when Back_End_Inlining is set.
(Must_Inline): Do not return Inline_Call if Back_End_Inlining is
enabled.
* debug.adb Document -gnatd.z
* fe.h Import Back_End_Inlining variable.
* gcc-interface/utils.c (create_subprog_decl): If Back_End_Inlining is
enabled then declare attribute "always inline"
2014-07-31 Robert Dewar <dewar@adacore.com>
* a-ngelfu.ads: Minor comment fix.
From-SVN: r213353
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index a9afc53..fa6f791 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -94,6 +94,7 @@ static tree handle_nonnull_attribute (tree *, tree, tree, int, bool *); static tree handle_sentinel_attribute (tree *, tree, tree, int, bool *); static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *); static tree handle_leaf_attribute (tree *, tree, tree, int, bool *); +static tree handle_always_inline_attribute (tree *, tree, tree, int, bool *); static tree handle_malloc_attribute (tree *, tree, tree, int, bool *); static tree handle_type_generic_attribute (tree *, tree, tree, int, bool *); static tree handle_vector_size_attribute (tree *, tree, tree, int, bool *); @@ -125,6 +126,8 @@ const struct attribute_spec gnat_internal_attribute_table[] = false }, { "leaf", 0, 0, true, false, false, handle_leaf_attribute, false }, + { "always_inline",0, 0, true, false, false, handle_always_inline_attribute, + false }, { "malloc", 0, 0, true, false, false, handle_malloc_attribute, false }, { "type generic", 0, 0, false, true, true, handle_type_generic_attribute, @@ -2715,6 +2718,14 @@ create_subprog_decl (tree subprog_name, tree asm_name, tree subprog_type, case is_disabled: break; + case is_required: + if (Back_End_Inlining) + decl_attributes (&subprog_decl, + tree_cons (get_identifier ("always_inline"), + NULL_TREE, NULL_TREE), + ATTR_FLAG_TYPE_IN_PLACE); + /* ... fall through ... */ + case is_enabled: DECL_DECLARED_INLINE_P (subprog_decl) = 1; DECL_NO_INLINE_WARNING_P (subprog_decl) = artificial_flag; @@ -5790,6 +5801,7 @@ gnat_write_global_declarations (void) TREE_STATIC (dummy_global) = 1; node = varpool_node::get_create (dummy_global); node->definition = 1; + node->definition = 1; node->force_output = 1; while (!types_used_by_cur_var_decl->is_empty ()) @@ -6382,8 +6394,7 @@ handle_noreturn_attribute (tree *node, tree name, tree ARG_UNUSED (args), struct attribute_spec.handler. */ static tree -handle_leaf_attribute (tree *node, tree name, - tree ARG_UNUSED (args), +handle_leaf_attribute (tree *node, tree name, tree ARG_UNUSED (args), int ARG_UNUSED (flags), bool *no_add_attrs) { if (TREE_CODE (*node) != FUNCTION_DECL) @@ -6400,6 +6411,27 @@ handle_leaf_attribute (tree *node, tree name, return NULL_TREE; } +/* Handle a "always_inline" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_always_inline_attribute (tree *node, tree name, tree ARG_UNUSED (args), + int ARG_UNUSED (flags), bool *no_add_attrs) +{ + if (TREE_CODE (*node) == FUNCTION_DECL) + { + /* Set the attribute and mark it for disregarding inline limits. */ + DECL_DISREGARD_INLINE_LIMITS (*node) = 1; + } + else + { + warning (OPT_Wattributes, "%qE attribute ignored", name); + *no_add_attrs = true; + } + + return NULL_TREE; +} + /* Handle a "malloc" attribute; arguments as in struct attribute_spec.handler. */ |