aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sinfo.ads
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2021-05-08 11:39:52 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2021-07-06 14:46:54 +0000
commit82a794419a00ea98b68d69b64363ae6746710de9 (patch)
treea216a476635457a50b68eac80396d690071b19a4 /gcc/ada/sinfo.ads
parent06a5fb60eb53ef297454f58db61d3374d538f515 (diff)
downloadgcc-82a794419a00ea98b68d69b64363ae6746710de9.zip
gcc-82a794419a00ea98b68d69b64363ae6746710de9.tar.gz
gcc-82a794419a00ea98b68d69b64363ae6746710de9.tar.bz2
[Ada] Tbuild cleanup
gcc/ada/ * tbuild.adb (Convert_To): Add assert, along with a comment. (Make_DT_Access): Remove this function, which is not used. It was incorrect anyway (the call to New_Occurrence_Of should not be there). (Unchecked_Convert_To): Add assert. The previous version's test for unchecked conversion to the same type was redundant and could never be true, because the previous 'if' already checked for ANY expression of the same type. Remove that, and replace with a test for unchecked conversion to a related type. Otherwise, we somethings get things like "finalize(some_type!(some_type!(x)))" in the generated code, where x is already of type some_type, but we're converting it to the private type and then to the full type or vice versa (so the types aren't equal, so the previous 'if' doesn't catch it). Avoid updating the Parent. This is not necessary; the Parent will be updated if/when the node is attached to the tree. * tbuild.ads: Fix comments. No need to say "this is safe" when we just explained that a few lines earlier. Remove Make_DT_Access. * sinfo.ads: Add comments. * exp_ch7.adb (Make_Finalize_Address_Stmts): Minor comment fix. * gen_il-gen.adb, gen_il-gen.ads, gen_il-gen-gen_nodes.adb, gen_il-internals.ads: Implement a feature where you can put: Nmake_Assert => "expr" where expr is a boolean expression in a call to Create_Concrete_Node_Type. It is added in a pragma Assert in the Nmake.Make_... function for that type.
Diffstat (limited to 'gcc/ada/sinfo.ads')
-rw-r--r--gcc/ada/sinfo.ads7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index 8f23f7d..f6c5e0d 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -8420,8 +8420,11 @@ package Sinfo is
-- An unchecked type conversion node represents the semantic action
-- corresponding to a call to an instantiation of Unchecked_Conversion.
-- It is generated as a result of actual use of Unchecked_Conversion
- -- and also the expander generates unchecked type conversion nodes
- -- directly for expansion of complex semantic actions.
+ -- and also by the expander.
+
+ -- Unchecked type conversion nodes should normally be created by calling
+ -- Tbuild.Unchecked_Convert_To, rather than by directly calling
+ -- Nmake.Make_Unchecked_Type_Conversion.
-- Note: an unchecked type conversion is a variable as far as the
-- semantics are concerned, which is convenient for the expander.