aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/restrict.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-07-08 10:15:25 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2013-07-08 10:15:25 +0200
commit2cbac6c692b9a68e9fedaa193ae756eea8ac23c5 (patch)
tree50c5674f4b0dc7891f7116f7ee46b8a75f9b73f7 /gcc/ada/restrict.adb
parentd7a3e18ca87744c3bd293396952a7ff36412d1ce (diff)
downloadgcc-2cbac6c692b9a68e9fedaa193ae756eea8ac23c5.zip
gcc-2cbac6c692b9a68e9fedaa193ae756eea8ac23c5.tar.gz
gcc-2cbac6c692b9a68e9fedaa193ae756eea8ac23c5.tar.bz2
[multiple changes]
2013-07-08 Robert Dewar <dewar@adacore.com> * sem.ads: Minor comment updates. * s-restri.ads, exp_ch6.adb, lib-load.ads, exp_ch3.adb, sem_ch10.adb: Minor reformatting. 2013-07-08 Robert Dewar <dewar@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference): Add dummy entry for Restriction_Set. * gnat_rm.texi: Add missing menu entry for Attribute Ref Add documentation for attribute Restriction_Set. * lib-writ.adb (Write_With_Lines): Generate special W lines for Restriction_Set. * lib-writ.ads: Document special use of W lines for Restriction_Set. * lib.ads (Restriction_Set_Dependences): New table. * par-ch4.adb (Is_Parameterless_Attribute): Add Loop_Entry to list (Scan_Name_Extension_Apostrophe): Remove kludge test for Loop_Entry (Scan_Name_Extension_Apostrophe): Handle No_Dependence for Restricton_Set. * restrict.adb (Check_SPARK_Restriction): Put in Alfa order (OK_No_Dependence_Unit_Name): New function. * restrict.ads (OK_No_Dependence_Unit_Name): New function. * rtsfind.adb: Minor reformatting Minor code reorganization. * sem_attr.adb (Analyze_Attribute): Add processing for Restriction_Set. * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings): Remove Check_Unit_Name and use new function OK_No_Dependence_Unit_Name instead. * sinfo.ads: Minor comment updates. * snames.ads-tmpl: Add entry for Restriction_Set attribute. 2013-07-08 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Apply_Accessibility_Check): Remove local constant Pool_Id and local variable Free_Stmt. Do not deallocate the faulty object as "free" is not available on all targets/profiles. 2013-07-08 Robert Dewar <dewar@adacore.com> * sem_ch13.adb (Analyze_Aspect_Specifications): Handle Storage_Size aspect for task type in case discriminant is referenced. (Analyze_Attribute_Definition_Clause): Do not flag Storage_Size attribute definition clause as obsolescent if from aspect. From-SVN: r200771
Diffstat (limited to 'gcc/ada/restrict.adb')
-rw-r--r--gcc/ada/restrict.adb147
1 files changed, 84 insertions, 63 deletions
diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb
index a90cf1a..ea0f89c 100644
--- a/gcc/ada/restrict.adb
+++ b/gcc/ada/restrict.adb
@@ -184,69 +184,6 @@ package body Restrict is
Check_Restriction (No_Elaboration_Code, N);
end Check_Elaboration_Code_Allowed;
- -----------------------------
- -- Check_SPARK_Restriction --
- -----------------------------
-
- procedure Check_SPARK_Restriction
- (Msg : String;
- N : Node_Id;
- Force : Boolean := False)
- is
- Msg_Issued : Boolean;
- Save_Error_Msg_Sloc : Source_Ptr;
-
- begin
- if Force or else Comes_From_Source (Original_Node (N)) then
- if Restriction_Check_Required (SPARK_05)
- and then Is_In_Hidden_Part_In_SPARK (Sloc (N))
- then
- return;
- end if;
-
- -- Since the call to Restriction_Msg from Check_Restriction may set
- -- Error_Msg_Sloc to the location of the pragma restriction, save and
- -- restore the previous value of the global variable around the call.
-
- Save_Error_Msg_Sloc := Error_Msg_Sloc;
- Check_Restriction (Msg_Issued, SPARK_05, First_Node (N));
- Error_Msg_Sloc := Save_Error_Msg_Sloc;
-
- if Msg_Issued then
- Error_Msg_F ("\\| " & Msg, N);
- end if;
- end if;
- end Check_SPARK_Restriction;
-
- procedure Check_SPARK_Restriction (Msg1, Msg2 : String; N : Node_Id) is
- Msg_Issued : Boolean;
- Save_Error_Msg_Sloc : Source_Ptr;
-
- begin
- pragma Assert (Msg2'Length /= 0 and then Msg2 (Msg2'First) = '\');
-
- if Comes_From_Source (Original_Node (N)) then
- if Restriction_Check_Required (SPARK_05)
- and then Is_In_Hidden_Part_In_SPARK (Sloc (N))
- then
- return;
- end if;
-
- -- Since the call to Restriction_Msg from Check_Restriction may set
- -- Error_Msg_Sloc to the location of the pragma restriction, save and
- -- restore the previous value of the global variable around the call.
-
- Save_Error_Msg_Sloc := Error_Msg_Sloc;
- Check_Restriction (Msg_Issued, SPARK_05, First_Node (N));
- Error_Msg_Sloc := Save_Error_Msg_Sloc;
-
- if Msg_Issued then
- Error_Msg_F ("\\| " & Msg1, N);
- Error_Msg_F (Msg2, N);
- end if;
- end if;
- end Check_SPARK_Restriction;
-
--------------------------------
-- Check_No_Implicit_Aliasing --
--------------------------------
@@ -883,6 +820,27 @@ package body Restrict is
and then Restriction_Active (No_Exception_Propagation);
end No_Exception_Propagation_Active;
+ --------------------------------
+ -- OK_No_Dependence_Unit_Name --
+ --------------------------------
+
+ function OK_No_Dependence_Unit_Name (N : Node_Id) return Boolean is
+ begin
+ if Nkind (N) = N_Selected_Component then
+ return
+ OK_No_Dependence_Unit_Name (Prefix (N))
+ and then
+ OK_No_Dependence_Unit_Name (Selector_Name (N));
+
+ elsif Nkind (N) = N_Identifier then
+ return True;
+
+ else
+ Error_Msg_N ("wrong form for unit name for No_Dependence", N);
+ return False;
+ end if;
+ end OK_No_Dependence_Unit_Name;
+
----------------------------------
-- Process_Restriction_Synonyms --
----------------------------------
@@ -1437,6 +1395,69 @@ package body Restrict is
end if;
end Set_Restriction_No_Use_Of_Pragma;
+ -----------------------------
+ -- Check_SPARK_Restriction --
+ -----------------------------
+
+ procedure Check_SPARK_Restriction
+ (Msg : String;
+ N : Node_Id;
+ Force : Boolean := False)
+ is
+ Msg_Issued : Boolean;
+ Save_Error_Msg_Sloc : Source_Ptr;
+
+ begin
+ if Force or else Comes_From_Source (Original_Node (N)) then
+ if Restriction_Check_Required (SPARK_05)
+ and then Is_In_Hidden_Part_In_SPARK (Sloc (N))
+ then
+ return;
+ end if;
+
+ -- Since the call to Restriction_Msg from Check_Restriction may set
+ -- Error_Msg_Sloc to the location of the pragma restriction, save and
+ -- restore the previous value of the global variable around the call.
+
+ Save_Error_Msg_Sloc := Error_Msg_Sloc;
+ Check_Restriction (Msg_Issued, SPARK_05, First_Node (N));
+ Error_Msg_Sloc := Save_Error_Msg_Sloc;
+
+ if Msg_Issued then
+ Error_Msg_F ("\\| " & Msg, N);
+ end if;
+ end if;
+ end Check_SPARK_Restriction;
+
+ procedure Check_SPARK_Restriction (Msg1, Msg2 : String; N : Node_Id) is
+ Msg_Issued : Boolean;
+ Save_Error_Msg_Sloc : Source_Ptr;
+
+ begin
+ pragma Assert (Msg2'Length /= 0 and then Msg2 (Msg2'First) = '\');
+
+ if Comes_From_Source (Original_Node (N)) then
+ if Restriction_Check_Required (SPARK_05)
+ and then Is_In_Hidden_Part_In_SPARK (Sloc (N))
+ then
+ return;
+ end if;
+
+ -- Since the call to Restriction_Msg from Check_Restriction may set
+ -- Error_Msg_Sloc to the location of the pragma restriction, save and
+ -- restore the previous value of the global variable around the call.
+
+ Save_Error_Msg_Sloc := Error_Msg_Sloc;
+ Check_Restriction (Msg_Issued, SPARK_05, First_Node (N));
+ Error_Msg_Sloc := Save_Error_Msg_Sloc;
+
+ if Msg_Issued then
+ Error_Msg_F ("\\| " & Msg1, N);
+ Error_Msg_F (Msg2, N);
+ end if;
+ end if;
+ end Check_SPARK_Restriction;
+
----------------------------------
-- Suppress_Restriction_Message --
----------------------------------