[Ada] Tbuild cleanup
authorBob Duff <duff@adacore.com>
Sat, 8 May 2021 15:39:52 +0000 (11:39 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 6 Jul 2021 14:46:54 +0000 (14:46 +0000)
commit82a794419a00ea98b68d69b64363ae6746710de9
treea216a476635457a50b68eac80396d690071b19a4
parent06a5fb60eb53ef297454f58db61d3374d538f515
[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.
gcc/ada/exp_ch7.adb
gcc/ada/gen_il-gen-gen_nodes.adb
gcc/ada/gen_il-gen.adb
gcc/ada/gen_il-gen.ads
gcc/ada/gen_il-internals.ads
gcc/ada/sinfo.ads
gcc/ada/tbuild.adb
gcc/ada/tbuild.ads