summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-07-20 15:06:01 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-07-20 15:06:01 +0200
commit6fb4cddeee68c3284e62389aadc9e505092c11a9 (patch)
treed18d20b93c356cb855681e19f4cae6b09a57c073 /gcc/ada/sem_res.adb
parentae65d635df87446453628c005cacf2ed3850b9c6 (diff)
downloadgcc-6fb4cddeee68c3284e62389aadc9e505092c11a9.tar.gz
[multiple changes]
2009-07-20 Robert Dewar <dewar@adacore.com> * vms_data.ads: Minor reformatting * einfo.ads, einfo.adb (Parent_Subtype): Now allowed on record subtype, applies to base type. (Parent_Subtype): Now allowed on record subtype, applies to base type * exp_ch5.adb (Expand_Assign_Record): Handle Componentwise_Assignment for case of fully repped tagged type. (Make_Tag_Ctrl_Assignment): Set Componentwise_Assignment and avoid tag save/restore for fully repped tagged type case. * exp_util.ads, exp_util.adb (Is_Fully_Repped_Tagged_Type): New function * fe.h (Is_Fully_Repped_Tagged_Type): New function * sem_ch13.adb (Analyze_Recorrd_Representation_Clause): Check for overlap of tagged type components with parent type if parent type is fully repped. * sinfo.ads, sinfo.adb (Componentwise_Assignment): New flag * sem_res.adb (Check_No_Direct_Boolean_Operators): Remove handling of comparisons. (Resolve_Comparison_Operators): Remove No_Direct_Boolean_Operators check (Resolve_Equality_Op): Remove No_Direct_Boolean_Operators check * gnat_rm.texi: Restriction No_Direct_Boolean_Operators includes only logical operators (AND/OR/XOR), not comparison operators. * sprint.ads: Minor reformatting 2009-07-20 Ed Schonberg <schonberg@adacore.com> * sem_intr.adb (Check_Intrinsic_Call): For Import_Value and related intrinsics, check that argument is a string literal, rather than checking for staticness. From-SVN: r149811
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb29
1 files changed, 5 insertions, 24 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index e6c4f59def2..372750b1b47 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -120,9 +120,9 @@ package body Sem_Res is
-- Could be optimized away perhaps?
procedure Check_No_Direct_Boolean_Operators (N : Node_Id);
- -- N is the node for a comparison or logical operator. If the operator
- -- is predefined, and the root type of the operands is Standard.Boolean,
- -- then a check is made for restriction No_Direct_Boolean_Operators.
+ -- N is the node for a logical operator. If the operator is predefined, and
+ -- the root type of the operands is Standard.Boolean, then a check is made
+ -- for restriction No_Direct_Boolean_Operators.
function Is_Definite_Access_Type (E : Entity_Id) return Boolean;
-- Determine whether E is an access type declared by an access
@@ -941,24 +941,9 @@ package body Sem_Res is
if Scope (Entity (N)) = Standard_Standard
and then Root_Type (Etype (Left_Opnd (N))) = Standard_Boolean
then
- -- Restriction does not apply to generated code
+ -- Restriction only applies to original source code
- if not Comes_From_Source (N) then
- null;
-
- -- Restriction does not apply for A=False, A=True
-
- elsif Nkind (N) = N_Op_Eq
- and then (Is_Entity_Name (Right_Opnd (N))
- and then (Entity (Right_Opnd (N)) = Standard_True
- or else
- Entity (Right_Opnd (N)) = Standard_False))
- then
- null;
-
- -- Otherwise restriction applies
-
- else
+ if Comes_From_Source (N) then
Check_Restriction (No_Direct_Boolean_Operators, N);
end if;
end if;
@@ -5478,8 +5463,6 @@ package body Sem_Res is
T : Entity_Id;
begin
- Check_No_Direct_Boolean_Operators (N);
-
-- If this is an intrinsic operation which is not predefined, use the
-- types of its declared arguments to resolve the possibly overloaded
-- operands. Otherwise the operands are unambiguous and specify the
@@ -6224,8 +6207,6 @@ package body Sem_Res is
-- Start of processing for Resolve_Equality_Op
begin
- Check_No_Direct_Boolean_Operators (N);
-
Set_Etype (N, Base_Type (Typ));
Generate_Reference (T, N, ' ');