diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-06 08:12:10 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-06 08:12:10 +0000 |
commit | 958b0dc0510c358e6cd887dfc895bc5883ab42bf (patch) | |
tree | f0cc8703a3dd5b12c3179ab47811052a3e29feef /gcc/ada/sem_ch9.adb | |
parent | a39ff5829e67c254be33ea807e2e8217f01c1fba (diff) | |
download | gcc-958b0dc0510c358e6cd887dfc895bc5883ab42bf.tar.gz |
2012-08-06 Vincent Pucci <pucci@adacore.com>
PR ada/54125
* exp_attr.adb (Expand_N_Attribute_Reference): Expand new
Atomic_Always_Lock_Free attribute.
* sem_attr.adb (Analyze_Attribute): Analyze new
Atomic_Always_Lock_Free attribute.
(Eval_Attribute): Nothing to do with new Atomic_Always_Lock_Free
attribute.
* sem_ch9.adb (Allows_Lock_Free_Implementation):
Support_Atomic_Primitives check replaces previous erroneous
size check.
* sem_util.adb, sem_util.ads (Support_Atomic_Primitives):
New routine.
* snames.ads-tmpl: New name Name_Atomic_Always_Lock_Free and
new attribute Attribute_Atomic_Always_Lock_Free defined.
* s-atopri.adb: Support_Atomic_Primitives checks replaced by
Atomic_Always_Lock_Free queries.
* system-aix64.ads, system-aix.ads, system-darwin-ppc.ads,
system-hpux.ads, system-linux-alpha.ads, system-linux-hppa.ads,
system-linux-ppc.ads, system-linux-s390.ads,
system-linux-s390x.ads, system-linux-sh4.ads,
system-linux-sparc.ads, system-lynxos178-ppc.ads,
system-lynxos-ppc.ads, system-mingw.ads,
system-vxworks-arm.ads, system-solaris-sparc.ads,
system-solaris-sparcv9.ads, system-vms_64.ads,
system-vxworks-m68k.ads, system-vxworks-mips.ads,
system-vxworks-ppc.ads, system-vxworks-sparcv9.ads: Flag
Support_Atomic_Primitives removed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190163 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch9.adb')
-rw-r--r-- | gcc/ada/sem_ch9.adb | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index e033afa97df..6ee0bceeb81 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -557,7 +557,6 @@ package body Sem_Ch9 is Id : constant Entity_Id := Entity (N); Comp_Decl : Node_Id; Comp_Id : Entity_Id := Empty; - Comp_Size : Int := 0; Comp_Type : Entity_Id; begin @@ -591,40 +590,19 @@ package body Sem_Ch9 is Layout_Type (Comp_Type); - if Known_Static_Esize (Comp_Type) then - Comp_Size := UI_To_Int (Esize (Comp_Type)); - - -- If the Esize (Object_Size) is unknown at - -- compile-time, look at the RM_Size - -- (Value_Size) since it may have been set by - -- an explicit representation clause. - - elsif Known_Static_RM_Size (Comp_Type) then - Comp_Size := - UI_To_Int (RM_Size (Comp_Type)); - - -- Worrisome missing else raise PE??? + if not + Support_Atomic_Primitives (Comp_Type) + then + if Lock_Free_Given then + Error_Msg_NE + ("type of& must support atomic " & + "operations", + N, Comp_Id); + return Skip; + end if; + + return Abandon; end if; - - -- Check that the size of the component is 8, - -- 16, 32 or 64 bits. - - -- What about AAMP here??? - - case Comp_Size is - when 8 | 16 | 32 | 64 => - null; - when others => - if Lock_Free_Given then - Error_Msg_NE - ("type of& must support atomic " & - "operations", - N, Comp_Id); - return Skip; - end if; - - return Abandon; - end case; end if; -- Check if another protected component has |