diff options
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r-- | gcc/ada/sem_util.adb | 60 |
1 files changed, 43 insertions, 17 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index b2b4fed..d19b3b9 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -1963,8 +1963,7 @@ package body Sem_Util is -- Local variables - Saved_GM : constant Ghost_Mode_Type := Ghost_Mode; - Saved_IGR : constant Node_Id := Ignored_Ghost_Region; + Saved_Ghost_Config : constant Ghost_Config_Type := Ghost_Config; -- Save the Ghost-related attributes to restore on exit -- Start of processing for Build_Elaboration_Entity @@ -2060,7 +2059,7 @@ package body Sem_Util is Set_Has_Qualified_Name (Elab_Ent); Set_Has_Fully_Qualified_Name (Elab_Ent); - Restore_Ghost_Region (Saved_GM, Saved_IGR); + Restore_Ghost_Region (Saved_Ghost_Config); end Build_Elaboration_Entity; -------------------------------- @@ -12473,6 +12472,41 @@ package body Sem_Util is end if; end Is_Extended_Access_Type; + ---------------------------------------- + -- Is_Ignored_Ghost_Entity_In_Codegen -- + ---------------------------------------- + + function Is_Ignored_Ghost_Entity_In_Codegen (N : Entity_Id) return Boolean + is + begin + return + Is_Ignored_Ghost_Entity (N) + and then not GNATprove_Mode + and then not CodePeer_Mode; + end Is_Ignored_Ghost_Entity_In_Codegen; + + ---------------------------------------- + -- Is_Ignored_Ghost_Pragma_In_Codegen -- + ---------------------------------------- + + function Is_Ignored_Ghost_Pragma_In_Codegen (N : Node_Id) return Boolean is + begin + return + Is_Ignored_Ghost_Pragma (N) + and then not GNATprove_Mode + and then not CodePeer_Mode; + end Is_Ignored_Ghost_Pragma_In_Codegen; + + --------------------------- + -- Is_Ignored_In_Codegen -- + --------------------------- + + function Is_Ignored_In_Codegen (N : Node_Id) return Boolean is + begin + return + Is_Ignored (N) and then not GNATprove_Mode and then not CodePeer_Mode; + end Is_Ignored_In_Codegen; + --------------------------------- -- Side_Effect_Free_Statements -- --------------------------------- @@ -22574,7 +22608,7 @@ package body Sem_Util is -- Mark the Ghost and SPARK mode in effect if Modes then - if Ghost_Mode = Ignore then + if Ghost_Config.Ghost_Mode = Ignore then Set_Is_Ignored_Ghost_Node (N); end if; @@ -26439,16 +26473,6 @@ package body Sem_Util is end if; end if; - -- In CodePeer mode and GNATprove mode, we need to consider all - -- assertions, unless they are disabled. Force Name_Check on - -- ignored assertions. - - if Kind in Name_Ignore | Name_Off - and then (CodePeer_Mode or GNATprove_Mode) - then - Kind := Name_Check; - end if; - return Kind; end Policy_In_Effect; @@ -26482,9 +26506,11 @@ package body Sem_Util is function Predicate_Enabled (Typ : Entity_Id) return Boolean is begin - return Present (Predicate_Function (Typ)) - and then not Predicates_Ignored (Typ) - and then not Predicate_Checks_Suppressed (Empty); + return + Present (Predicate_Function (Typ)) + and then (GNATprove_Mode + or else (not Predicates_Ignored (Typ) + and then not Predicate_Checks_Suppressed (Empty))); end Predicate_Enabled; ---------------------------------- |