diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-11-04 12:51:47 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-11-04 12:51:47 +0000 |
commit | cafd02b3e86511710dff2234a989975336909601 (patch) | |
tree | 8a2906f87ff8dae462187a72710b5203b22a6c1b /gcc/ada/sem_attr.adb | |
parent | 3f26eaa9e3a48823a83959fbd9fbabc64a7b55aa (diff) | |
download | gcc-cafd02b3e86511710dff2234a989975336909601.tar.gz |
* sysdep.c: Problem discovered during IA64 VMS port.
[VMS] #include <unixio.h> to get proper prototypes.
* adaint.c:
Issues discovered/problems fixed during IA64 VMS port.
[VMS] #define _POSIX_EXIT for proper semantics.
[VMS] #include <unixio.h> for proper prototypes.
[VMS] (fork): #define IA64 version.
(__gnat_os_exit): Remove unnecessary VMS specific code.
* 3vtrasym.adb: Minor reformatting
Use terminology encoded/decoded name, rather than C++ specific notion
of mangling (this is the terminology used throughout GNAT).
* einfo.h: Regenerated
* einfo.ads, einfo.adb: Add new flag Is_Thread_Body
* exp_ch6.adb:
(Expand_N_Subprogram_Body): Handle expansion of thread body procedure
* par-prag.adb: Add dummy entry for Thread_Body pragma
* rtsfind.ads:
Add entries for System.Threads entities for thread body processing
* sem_attr.adb:
(Analyze_Pragma, Access attributes): Check these are not applied to a
thread body, since this is not permitted
* sem_prag.adb: Add processing for Thread_Body pragma.
Minor comment fix.
* sem_res.adb:
(Resolve_Call): Check for incorrect attempt to call a thread body
procedure with a direct call.
* snames.ads, snames.adb: Add entry for Thread_Body pragma
Add names associated with thread body expansion
* snames.h: Add entry for Thread_Body pragma
* s-thread.adb: Add entries for thread body processing
These are dummy bodies so far
* s-thread.ads: Add documentation on thread body handling.
Add entries for thread body processing.
* sem_ch10.adb:
(Build_Limited_Views): Return after posting an error in case of limited
with_clause on subprograms, generics, instances or generic renamings
(Install_Limited_Withed_Unit): Do nothing in case of limited with_clause
on subprograms, generics, instances or generic renamings
* raise.c (setup_to_install): Correct mistake in last revision; two
arguments out of order.
* trans.c, cuintp.c, argv.c, aux-io.c, cal.c, errno.c, exit.c,
gnatbl.c, init.c, stringt.h, utils.c, utils2.c: Update copyright
notice, missed in previous change.
Remove trailing blanks and other style errors introduced in previous
change.
* decl.c (gnat_to_gnu_field): Adjust the conditions under which we get
rid of the wrapper for a LJM type, ensuring we don't do that if the
field is addressable. This avoids potential low level type view
mismatches later on, for instance in a by-reference argument passing
process.
* decl.c (gnat_to_gnu_field): No longer check for BLKmode being
aligned at byte boundary.
* decl.c (components_to_record): Do not delete the empty variants from
the end of the union type.
* exp_ch4.adb (Expand_N_Op_Eq): Use base type when locating primitive
operation for a derived type, an explicit declaration may use a local
subtype of Boolean.
* make.adb (Gnatmake): Allow main sources on the command line with a
library project when it is only for compilation (no binding or
linking).
Part of PR ada/12806:
* ada-tree.h (TYPE_DIGITS_VALUE, SET_TYPE_DIGITS_VALUE): Save count as
tree, not integer.
* decl.c:
(gnat_to_gnu_entity, case E_Floating_Point_Type): Save count as tree,
not integer.
* targtyps.c, decl.c, misc.c,
gigi.h (fp_prec_to_size, fp_size_to_prec): Temporary
routines to work around change in FP sizing semantics in GCC.
* utils.c:
(build_vms_descriptor): TYPE_DIGITS_VALUE is tree, not integer.
* gigi.h: (enumerate_modes): New function.
* Make-lang.in: (ada/misc.o): Add real.h.
* misc.c: (enumerate_modes): New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73250 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r-- | gcc/ada/sem_attr.adb | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 83833c15b5a..efefdb82068 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -372,8 +372,8 @@ package body Sem_Attr is ---------------------------------- procedure Build_Access_Subprogram_Type (P : Node_Id) is - Index : Interp_Index; - It : Interp; + Index : Interp_Index; + It : Interp; function Get_Kind (E : Entity_Id) return Entity_Kind; -- Distinguish between access to regular and protected @@ -395,6 +395,10 @@ package body Sem_Attr is -- Start of processing for Build_Access_Subprogram_Type begin + -- In the case of an access to subprogram, use the name of the + -- subprogram itself as the designated type. Type-checking in + -- this case compares the signatures of the designated types. + if not Is_Overloaded (P) then Acc_Type := New_Internal_Entity @@ -408,7 +412,6 @@ package body Sem_Attr is Set_Etype (N, Any_Type); while Present (It.Nam) loop - if not Is_Intrinsic_Subprogram (It.Nam) then Acc_Type := New_Internal_Entity @@ -437,17 +440,20 @@ package body Sem_Attr is ("prefix of % attribute cannot be enumeration literal", P); end if; - -- In the case of an access to subprogram, use the name of the - -- subprogram itself as the designated type. Type-checking in - -- this case compares the signatures of the designated types. + -- Case of access to subprogram if Is_Entity_Name (P) and then Is_Overloadable (Entity (P)) then + -- Not allowed for nested subprograms if No_Implicit_Dynamic_Code + -- restriction set (since in general a trampoline is required). + if not Is_Library_Level_Entity (Entity (P)) then Check_Restriction (No_Implicit_Dynamic_Code, P); end if; + -- Build the appropriate subprogram type + Build_Access_Subprogram_Type (P); -- For unrestricted access, kill current values, since this @@ -460,7 +466,7 @@ package body Sem_Attr is return; - -- Component is an operation of a protected type. + -- Component is an operation of a protected type elsif Nkind (P) = N_Selected_Component and then Is_Overloadable (Entity (Selector_Name (P))) @@ -6406,7 +6412,6 @@ package body Sem_Attr is end if; if Is_Entity_Name (P) then - if Is_Overloaded (P) then Get_First_Interp (P, Index, It); @@ -6437,19 +6442,18 @@ package body Sem_Attr is Resolve (P); end if; + Error_Msg_Name_1 := Aname; + if not Is_Entity_Name (P) then null; elsif Is_Abstract (Entity (P)) and then Is_Overloadable (Entity (P)) then - Error_Msg_Name_1 := Aname; Error_Msg_N ("prefix of % attribute cannot be abstract", P); Set_Etype (N, Any_Type); elsif Convention (Entity (P)) = Convention_Intrinsic then - Error_Msg_Name_1 := Aname; - if Ekind (Entity (P)) = E_Enumeration_Literal then Error_Msg_N ("prefix of % attribute cannot be enumeration literal", @@ -6460,6 +6464,10 @@ package body Sem_Attr is end if; Set_Etype (N, Any_Type); + + elsif Is_Thread_Body (Entity (P)) then + Error_Msg_N + ("prefix of % attribute cannot be a thread body", P); end if; -- Assignments, return statements, components of aggregates, |