aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2009-07-11 20:52:28 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2009-07-11 20:52:28 +0000
commitf4cd2542becd2e4a9b648587693906a0e64531dd (patch)
tree5f43f396f64c2d468fbd26fc6394ff8b2d0734e9 /gcc/ada/gcc-interface/trans.c
parent97c281dacf21dcec5ed4f75f089960c8bfa81b0a (diff)
downloadgcc-f4cd2542becd2e4a9b648587693906a0e64531dd.zip
gcc-f4cd2542becd2e4a9b648587693906a0e64531dd.tar.gz
gcc-f4cd2542becd2e4a9b648587693906a0e64531dd.tar.bz2
checks.adb (Apply_Address_Clause_Check): Remove Size_Warning_Output local variable and do not test it in...
* checks.adb (Apply_Address_Clause_Check): Remove Size_Warning_Output local variable and do not test it in Compile_Time_Bad_Alignment. Do not issue size or alignment warnings for the X'Address form. * sem_util.ads (Find_Overlaid_Object): Delete. (Find_Overlaid_Entity): New procedure. * sem_util.adb (Find_Overlaid_Object): Rename to... (Find_Overlaid_Entity): ...this and turn into a procedure. Report whether the address is offseted within the overlaid entity. (Has_Compatible_Alignment): Track the offset globally instead of passing it to Check_Offset. For an indexed component, compute the full offset when possible. If the resulting offset is zero, only check the prefix. (Check_Offset): Delete. * sem_ch13.adb (Address_Clause_Check_Record): Add Off field. (Address_Aliased_Entity): Delete. (Analyze_Attribute_Definition_Clause) <Attribute_Address>: Call Find_Overlaid_Entity to find the overlaid entity and the offset. Adjust throughout for above change. (Validate_Address_Clauses): Always use attributes of entities, not of their type. Tweak message for warning. Call Has_Compatible_Alignment if the address is offseted to warn about incompatible alignments. * gcc-interface/gigi.h (annotate_object): Declare. * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Annotate renaming entity. Call annotate_object instead of annotating manually objects. (annotate_object): New function. * gcc-interface/trans.c (Subprogram_Body_to_gnu): Annotate parameters at the end. From-SVN: r149520
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r--gcc/ada/gcc-interface/trans.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 76200ab..5b4e5e8 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -2328,13 +2328,18 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
end_subprog_body (gnu_result, false);
- /* Disconnect the trees for parameters that we made variables for from the
- GNAT entities since these are unusable after we end the function. */
+ /* Finally annotate the parameters and disconnect the trees for parameters
+ that we have turned into variables since they are now unusable. */
for (gnat_param = First_Formal_With_Extras (gnat_subprog_id);
Present (gnat_param);
gnat_param = Next_Formal_With_Extras (gnat_param))
- if (TREE_CODE (get_gnu_tree (gnat_param)) == VAR_DECL)
- save_gnu_tree (gnat_param, NULL_TREE, false);
+ {
+ tree gnu_param = get_gnu_tree (gnat_param);
+ annotate_object (gnat_param, TREE_TYPE (gnu_param), NULL_TREE,
+ DECL_BY_REF_P (gnu_param));
+ if (TREE_CODE (gnu_param) == VAR_DECL)
+ save_gnu_tree (gnat_param, NULL_TREE, false);
+ }
if (DECL_FUNCTION_STUB (gnu_subprog_decl))
build_function_stub (gnu_subprog_decl, gnat_subprog_id);