public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6461] [Ada] Deconstruct a VMS utility routine which is only used by GNATprove Date: Tue, 11 Jan 2022 13:27:50 +0000 (GMT) [thread overview] Message-ID: <20220111132750.5F76538A9427@sourceware.org> (raw) https://gcc.gnu.org/g:58a9ed1187e5ba190828dff6c5d1e88ebe7dbb3a commit r12-6461-g58a9ed1187e5ba190828dff6c5d1e88ebe7dbb3a Author: Piotr Trojanek <trojanek@adacore.com> Date: Wed Jan 5 11:53:32 2022 +0100 [Ada] Deconstruct a VMS utility routine which is only used by GNATprove gcc/ada/ * sem_eval.ads (Compile_Time_Known_Value_Or_Aggr): Remove spec. * sem_eval.adb (Compile_Time_Known_Value_Or_Aggr): Remove body. Diff: --- gcc/ada/sem_eval.adb | 84 ---------------------------------------------------- gcc/ada/sem_eval.ads | 9 ------ 2 files changed, 93 deletions(-) diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 2a6ca78e919..2881a148c31 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -1916,90 +1916,6 @@ package body Sem_Eval is return False; end Compile_Time_Known_Value; - -------------------------------------- - -- Compile_Time_Known_Value_Or_Aggr -- - -------------------------------------- - - function Compile_Time_Known_Value_Or_Aggr (Op : Node_Id) return Boolean is - begin - -- If we have an entity name, then see if it is the name of a constant - -- and if so, test the corresponding constant value, or the name of - -- an enumeration literal, which is always a constant. - - if Is_Entity_Name (Op) then - declare - E : constant Entity_Id := Entity (Op); - V : Node_Id; - - begin - if Ekind (E) = E_Enumeration_Literal then - return True; - - elsif Ekind (E) /= E_Constant then - return False; - - else - V := Constant_Value (E); - return Present (V) - and then Compile_Time_Known_Value_Or_Aggr (V); - end if; - end; - - -- We have a value, see if it is compile-time-known - - else - if Compile_Time_Known_Value (Op) then - return True; - - elsif Nkind (Op) = N_Aggregate then - - if Present (Expressions (Op)) then - declare - Expr : Node_Id; - begin - Expr := First (Expressions (Op)); - while Present (Expr) loop - if not Compile_Time_Known_Value_Or_Aggr (Expr) then - return False; - else - Next (Expr); - end if; - end loop; - end; - end if; - - if Present (Component_Associations (Op)) then - declare - Cass : Node_Id; - - begin - Cass := First (Component_Associations (Op)); - while Present (Cass) loop - if not - Compile_Time_Known_Value_Or_Aggr (Expression (Cass)) - then - return False; - end if; - - Next (Cass); - end loop; - end; - end if; - - return True; - - elsif Nkind (Op) = N_Qualified_Expression then - return Compile_Time_Known_Value_Or_Aggr (Expression (Op)); - - -- All other types of values are not known at compile time - - else - return False; - end if; - - end if; - end Compile_Time_Known_Value_Or_Aggr; - --------------------------------------- -- CRT_Safe_Compile_Time_Known_Value -- --------------------------------------- diff --git a/gcc/ada/sem_eval.ads b/gcc/ada/sem_eval.ads index cacbd1ffb4c..eb919f17cb4 100644 --- a/gcc/ada/sem_eval.ads +++ b/gcc/ada/sem_eval.ads @@ -236,15 +236,6 @@ package Sem_Eval is -- WARNING: There is a matching C declaration of this subprogram in fe.h - function Compile_Time_Known_Value_Or_Aggr (Op : Node_Id) return Boolean; - -- Similar to Compile_Time_Known_Value, but also returns True if the value - -- is a compile-time-known aggregate, i.e. an aggregate all of whose - -- constituent expressions are either compile-time-known values (based on - -- calling Compile_Time_Known_Value) or compile-time-known aggregates. - -- Note that the aggregate could still involve run-time checks that might - -- fail (such as for subtype checks in component associations), but the - -- evaluation of the expressions themselves will not raise an exception. - function CRT_Safe_Compile_Time_Known_Value (Op : Node_Id) return Boolean; -- In the case of configurable run-times, there may be an issue calling -- Compile_Time_Known_Value with non-static expressions where the legality
reply other threads:[~2022-01-11 13:27 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220111132750.5F76538A9427@sourceware.org \ --to=pmderodat@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).