From d5be9f38b0fb47357fe6d69a7cfdb39a872ecb59 Mon Sep 17 00:00:00 2001 From: charlet Date: Fri, 30 Mar 2012 09:32:55 +0000 Subject: 2012-03-30 Robert Dewar * exp_ch5.adb, sem_util.adb, exp_ch4.adb: Minor comment updates. 2012-03-30 Yannick Moy * lib-xref-alfa.adb (Add_Alfa_File): Treat possibly 2 units at the same time, putting all scopes in the same Alfa file. (Add_Alfa_Xrefs): Correct errors in comparison function. Correct value of Def component. (Collect_Alfa): Possibly pass 2 units to Add_Alfa_File. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186006 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_util.adb | 1 - 1 file changed, 1 deletion(-) (limited to 'gcc/ada/sem_util.adb') diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 6519221cbe6..50200e73145 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -8674,7 +8674,6 @@ package body Sem_Util is -- only affects the generation of internal expanded code, since -- calls to instantiations of Unchecked_Conversion are never -- considered variables (since they are function calls). - -- This is also true for expression actions. when N_Unchecked_Type_Conversion => return Is_Variable (Expression (Orig_Node)); -- cgit v1.2.1 From d52c146a0ad595c53275ac4f40d46e3d43337aff Mon Sep 17 00:00:00 2001 From: charlet Date: Mon, 2 Apr 2012 09:14:47 +0000 Subject: 2012-04-02 Robert Dewar * einfo.adb (First_Component_Or_Discriminant) Now applies to all types with discriminants, not just records. * exp_attr.adb (Expand_N_Attribute): Add Scalar_Values handling for arrays, scalars and non-variant records. * sem_attr.adb (Analyze_Attribute): Handle Valid_Scalars * sem_attr.ads (Valid_Scalars): Update description * sem_util.ads, sem_util.adb (No_Scalar_Parts): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186069 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_util.adb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'gcc/ada/sem_util.adb') diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 50200e73145..e07d5bbb1fa 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -10499,6 +10499,34 @@ package body Sem_Util is Actual_Id := Next_Actual (Actual_Id); end Next_Actual; + --------------------- + -- No_Scalar_Parts -- + --------------------- + + function No_Scalar_Parts (T : Entity_Id) return Boolean is + C : Entity_Id; + + begin + if Is_Scalar_Type (T) then + return False; + + elsif Is_Array_Type (T) then + return No_Scalar_Parts (Component_Type (T)); + + elsif Is_Record_Type (T) or else Has_Discriminants (T) then + C := First_Component_Or_Discriminant (T); + while Present (C) loop + if not No_Scalar_Parts (Etype (C)) then + return False; + else + Next_Component_Or_Discriminant (C); + end if; + end loop; + end if; + + return True; + end No_Scalar_Parts; + ----------------------- -- Normalize_Actuals -- ----------------------- -- cgit v1.2.1 From 0baac39e93d230208a75f23a615c001dc0258def Mon Sep 17 00:00:00 2001 From: charlet Date: Mon, 2 Apr 2012 09:28:52 +0000 Subject: 2012-04-02 Emmanuel Briot * g-expect.adb (Expect_Internal): Fix leak of the input file descriptor. 2012-04-02 Hristian Kirtchev * exp_ch4.adb (Expand_N_Quantified_Expression): Reimplemented. The expansion no longer uses the copy of the original QE created during analysis. * sem.adb (Analyze): Add processing for loop parameter specifications. * sem_ch4.adb (Analyze_Quantified_Expression): Reimplemented. The routine no longer creates a copy of the original QE. All constituents of a QE are now preanalyzed and resolved. * sem_ch5.adb (Analyze_Iteration_Scheme): Remove the guard which bypasses all processing when the iteration scheme is related to a QE. Relovate the code which analyzes loop parameter specifications to a separate routine. (Analyze_Iterator_Specification): Preanalyze the iterator name. This action was originally done in Analyze_Iteration_Scheme. Update the check which detects an iterator specification in the context of a QE. (Analyze_Loop_Parameter_Specification): New routine. This procedure allows for a stand-alone analysis of a loop parameter specification without the need of a parent iteration scheme. Add code to update the type of the loop variable when the range generates an itype and the context is a QE. (Pre_Analyze_Range): Renamed to Preanalyze_Range. Update all references to the routine. * sem_ch5.ads: Code reformatting. (Analyze_Loop_Parameter_Specification): New routine. * sem_ch6.adb (Fully_Conformant_Expressions): Detect a case when establishing conformance between two QEs utilizing different specifications. * sem_res.adb (Proper_Current_Scope): New routine. (Resolve): Do not resolve a QE as there is nothing to be done now. Ignore any loop scopes generated for QEs when detecting an expression function as the scopes are cosmetic and do not appear in the tree. (Resolve_Quantified_Expression): Removed. All resolution of QE constituents is now performed during analysis. This ensures that loop variables appearing in array aggregates are properly resolved. 2012-04-02 Ed Schonberg * sem_util.adb (Build_Default_Subtype): If the base type is private and its full view is available, use the full view in the subtype declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186074 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_util.adb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'gcc/ada/sem_util.adb') diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index e07d5bbb1fa..e7958058cd6 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -740,12 +740,28 @@ package body Sem_Util is N : Node_Id) return Entity_Id is Loc : constant Source_Ptr := Sloc (N); + Bas : Entity_Id; + -- The base type that is to be constrained by the defaults. + Disc : Entity_Id; begin if not Has_Discriminants (T) or else Is_Constrained (T) then return T; end if; + Bas := Base_Type (T); + + -- If T is non-private but its base type is private, this is + -- the completion of a subtype declaration whose parent type + -- is private (see Complete_Private_Subtype in sem_ch3). The + -- proper discriminants are to be found in the full view of + -- the base. + + if Is_Private_Type (Bas) + and then Present (Full_View (Bas)) + then + Bas := Full_View (Bas); + end if; Disc := First_Discriminant (T); @@ -770,7 +786,7 @@ package body Sem_Util is Defining_Identifier => Act, Subtype_Indication => Make_Subtype_Indication (Loc, - Subtype_Mark => New_Occurrence_Of (T, Loc), + Subtype_Mark => New_Occurrence_Of (Bas, Loc), Constraint => Make_Index_Or_Discriminant_Constraint (Loc, Constraints => Constraints))); -- cgit v1.2.1 From 7a19298b2c3ca86a08b5151667cf3fec2c97f4af Mon Sep 17 00:00:00 2001 From: charlet Date: Mon, 2 Apr 2012 09:47:18 +0000 Subject: 2012-04-02 Yannick Moy * osint.adb, osint.ads (Add_Default_Search_Dirs): Add library search dirs in file specified with option -gnateO. 2012-04-02 Robert Dewar * sem_ch5.adb, exp_util.adb, sem_util.adb, exp_ch4.adb: Minor reformatting. 2012-04-02 Olivier Hainque * g-sse.ads: Add x86-solaris and x86_64-darwin to the set of platforms where the use of this spec is supported. Add current year to the copyright notice. * gcc-interfaces/Makefile.in: Add g-sse.o and g-ssvety.o to EXTRA_GNATRTL_NONTASKING_OBJS on x86 32/64 targets that support it and where they were missing (x86-solaris, x86-freebsd, x86_64-freebsd, and x86-darwin). 2012-04-02 Gary Dismukes * bindgen.adb (Gen_Ada_Init): When compiling for the AAMP small library, where we no longer suppress the Standard_Library, generate an empty body rather than the usual generation of assignments to imported globals, since those aren't present in the small library. 2012-04-02 Ed Schonberg * sinfo.ads: Minor documentation fix. 2012-04-02 Hristian Kirtchev * sem_res.adb (Resolve_Conditional_Expression): Add local variables Else_Typ and Then_Typ. Add missing type conversions to the "then" and "else" expressions when their respective types are scalar. 2012-04-02 Vincent Pucci * exp_ch9.adb: Reordering of the local subprograms. New Table for the lock free implementation that maps each protected subprograms with the protected component it references. (Allow_Lock_Free_Implementation): New routine. Check if the protected body enables the lock free implementation. (Build_Lock_Free_Protected_Subprogram_Body): New routine. (Build_Lock_Free_Unprotected_Subprogram_Body): New routine. (Comp_Of): New routine. * Makefile.rtl: Add s-atopri.o * debug.adb: New compiler debug flag -gnatd9 for lock free implementation. * rtsfind.ads: RE_Atomic_Compare_Exchange_8, RE_Atomic_Compare_Exchange_16, RE_Atomic_Compare_Exchange_32, RE_Atomic_Compare_Exchange_64, RE_Atomic_Load_8, RE_Atomic_Load_16, RE_Atomic_Load_32, RE_Atomic_Load_64, RE_Uint8, RE_Uint16, RE_Uint32, RE_Uint64 added. * s-atropi.ads: New file. Defines atomic primitives used by the lock free implementation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186076 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_util.adb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'gcc/ada/sem_util.adb') diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index e7958058cd6..b8e4d813c08 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -740,15 +740,16 @@ package body Sem_Util is N : Node_Id) return Entity_Id is Loc : constant Source_Ptr := Sloc (N); - Bas : Entity_Id; - -- The base type that is to be constrained by the defaults. - Disc : Entity_Id; + Bas : Entity_Id; + -- The base type that is to be constrained by the defaults + begin if not Has_Discriminants (T) or else Is_Constrained (T) then return T; end if; + Bas := Base_Type (T); -- If T is non-private but its base type is private, this is @@ -757,9 +758,7 @@ package body Sem_Util is -- proper discriminants are to be found in the full view of -- the base. - if Is_Private_Type (Bas) - and then Present (Full_View (Bas)) - then + if Is_Private_Type (Bas) and then Present (Full_View (Bas)) then Bas := Full_View (Bas); end if; -- cgit v1.2.1 From 2a9b01cb49d882a1c627b130572b408c529e9989 Mon Sep 17 00:00:00 2001 From: charlet Date: Mon, 2 Apr 2012 10:51:58 +0000 Subject: 2012-04-02 Robert Dewar * s-atopri.ads: Minor reformatting. 2012-04-02 Thomas Quinot * sem_util.adb: Minor reformatting, minor code cleanup. 2012-04-02 Ed Schonberg * lib-xref.adb (Generate_Reference): For a reference to an operator symbol, set the sloc to point to the first character of the operator name, and not to the initial quaote. (Output_References): Ditto for the definition of an operator symbol. 2012-04-02 Vincent Celier * ali.adb (Scan_Ali): Recognize Z lines. Set Implicit_With_From_Instantiation to True in the With_Record for Z lines. * ali.ads (With_Record): New Boolean component Implicit_With_From_Instantiation, defaulted to False. * csinfo.adb: Indicate that Implicit_With_From_Instantiation is special * lib-writ.adb (Write_ALI): New array Implicit_With. (Collect_Withs): Set Implicit_With for the unit is it is not Yes. (Write_With_Lines): Write a Z line instead of a W line if Implicit_With is Yes for the unit. * sem_ch12.adb (Inherit_Context): Only add a unit in the context if it is not there yet. * sinfo.ads: New flag Implicit_With_From_Instantiation (Flag12) added. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186079 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_util.adb | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) (limited to 'gcc/ada/sem_util.adb') diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index b8e4d813c08..b5255177b2c 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -752,11 +752,10 @@ package body Sem_Util is Bas := Base_Type (T); - -- If T is non-private but its base type is private, this is - -- the completion of a subtype declaration whose parent type - -- is private (see Complete_Private_Subtype in sem_ch3). The - -- proper discriminants are to be found in the full view of - -- the base. + -- If T is non-private but its base type is private, this is the + -- completion of a subtype declaration whose parent type is private + -- (see Complete_Private_Subtype in Sem_Ch3). The proper discriminants + -- are to be found in the full view of the base. if Is_Private_Type (Bas) and then Present (Full_View (Bas)) then Bas := Full_View (Bas); @@ -783,10 +782,10 @@ package body Sem_Util is Decl := Make_Subtype_Declaration (Loc, Defining_Identifier => Act, - Subtype_Indication => + Subtype_Indication => Make_Subtype_Indication (Loc, Subtype_Mark => New_Occurrence_Of (Bas, Loc), - Constraint => + Constraint => Make_Index_Or_Discriminant_Constraint (Loc, Constraints => Constraints))); @@ -813,8 +812,8 @@ package body Sem_Util is -- of the prefix. function Build_Discriminal_Record_Constraint return List_Id; - -- Similar to previous one, for discriminated components constrained - -- by the discriminant of the enclosing object. + -- Similar to previous one, for discriminated components constrained by + -- the discriminant of the enclosing object. ---------------------------------------- -- Build_Discriminal_Array_Constraint -- @@ -970,12 +969,7 @@ package body Sem_Util is -- and thus will not have the unit name automatically prepended. Set_Package_Name (Spec_Id); - - -- Append _E - - Name_Buffer (Name_Len + 1) := '_'; - Name_Buffer (Name_Len + 2) := 'E'; - Name_Len := Name_Len + 2; + Add_Str_To_Name_Buffer ("_E"); -- Create elaboration counter @@ -1001,9 +995,9 @@ package body Sem_Util is Set_Current_Value (Elab_Ent, Empty); Set_Last_Assignment (Elab_Ent, Empty); - -- We do not want any further qualification of the name (if we did - -- not do this, we would pick up the name of the generic package - -- in the case of a library level generic instantiation). + -- We do not want any further qualification of the name (if we did not + -- do this, we would pick up the name of the generic package in the case + -- of a library level generic instantiation). Set_Has_Qualified_Name (Elab_Ent); Set_Has_Fully_Qualified_Name (Elab_Ent); @@ -1088,8 +1082,7 @@ package body Sem_Util is then return False; else - return - Cannot_Raise_Constraint_Error (Expression (Expr)); + return Cannot_Raise_Constraint_Error (Expression (Expr)); end if; when N_Unchecked_Type_Conversion => @@ -1099,8 +1092,7 @@ package body Sem_Util is if Do_Overflow_Check (Expr) then return False; else - return - Cannot_Raise_Constraint_Error (Right_Opnd (Expr)); + return Cannot_Raise_Constraint_Error (Right_Opnd (Expr)); end if; when N_Op_Divide | @@ -1157,8 +1149,7 @@ package body Sem_Util is -- Check_Implicit_Dereference -- -------------------------------- - procedure Check_Implicit_Dereference (Nam : Node_Id; Typ : Entity_Id) - is + procedure Check_Implicit_Dereference (Nam : Node_Id; Typ : Entity_Id) is Disc : Entity_Id; Desig : Entity_Id; -- cgit v1.2.1