diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-20 12:46:42 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-20 12:46:42 +0000 |
commit | eb10ea32dcbb75bcfc7882b645a64aab17720476 (patch) | |
tree | 71c7f44038b908a0d6c4e52f839a9fa3e3c2ed25 /gcc/ada/s-shasto.adb | |
parent | d54f6ec5353a384118649f31d83ece8aa1085d54 (diff) | |
download | gcc-eb10ea32dcbb75bcfc7882b645a64aab17720476.tar.gz |
2008-05-20 Kevin Pouget <pouget@adacore.com>
* exp_smem.ads, exp_smem.adb: Construction of access and assign
routines has been replaced by an instantiation of
System.Shared_Storage.Shared_Var_Procs generic package, while expanding
shared variable declaration.
Calls to access and assign routines have been replaced by calls to
Read/Write routines of System.Shared_Storage.Shared_Var_Procs
instantiated package.
* rtsfind.ads: RE_Shared_Var_Procs entry has been added in RE_Unit_Table
It identifies the new generic package added in s-shasto.
* s-shasto.adb, s-shasto.ads: A new generic package has been added, it
is instantiated for each shared passive variable. It provides
supporting procedures called upon each read or write access by the
expanded code.
* sem_attr.adb:
For this runtime unit (always compiled in GNAT mode), we allow
stream attributes references for limited types for the case where
shared passive objects are implemented using stream attributes,
which is the default in GNAT's persistent storage implementation.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135627 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-shasto.adb')
-rw-r--r-- | gcc/ada/s-shasto.adb | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/gcc/ada/s-shasto.adb b/gcc/ada/s-shasto.adb index 5dd775725bb..c4ef8628c0b 100644 --- a/gcc/ada/s-shasto.adb +++ b/gcc/ada/s-shasto.adb @@ -6,8 +6,8 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2007, Free Software Foundation, Inc. -- --- -- +-- Copyright (C) 1998-2008, Free Software Foundation, Inc. -- +-- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- @@ -364,6 +364,43 @@ package body System.Shared_Storage is end Shared_Var_Lock; ---------------------- + -- Shared_Var_Procs -- + ---------------------- + + package body Shared_Var_Procs is + + use type SIO.Stream_Access; + + ---------- + -- Read -- + ---------- + + procedure Read is + S : SIO.Stream_Access := null; + begin + S := Shared_Var_ROpen (Full_Name); + if S /= null then + Typ'Read (S, V); + Shared_Var_Close (S); + end if; + end Read; + + ------------ + -- Write -- + ------------ + + procedure Write is + S : SIO.Stream_Access := null; + begin + S := Shared_Var_WOpen (Full_Name); + Typ'Write (S, V); + Shared_Var_Close (S); + return; + end Write; + + end Shared_Var_Procs; + + ---------------------- -- Shared_Var_ROpen -- ---------------------- |