mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-15 22:21:53 +08:00
decl.c (gnat_to_gnu_entity): Do not set force_global for imported subprograms.
* gcc-interface/decl.c (gnat_to_gnu_entity): Do not set force_global for imported subprograms. From-SVN: r146469
This commit is contained in:
parent
2f283818fc
commit
a962b0a184
@ -1,3 +1,8 @@
|
||||
2009-04-21 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gcc-interface/decl.c (gnat_to_gnu_entity): Do not set force_global
|
||||
for imported subprograms.
|
||||
|
||||
2009-04-21 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Do not make
|
||||
|
@ -332,13 +332,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
|
||||
another compilation unit) public entities, show we are at global level
|
||||
for the purpose of computing scopes. Don't do this for components or
|
||||
discriminants since the relevant test is whether or not the record is
|
||||
being defined. But do this for Imported functions or procedures in
|
||||
all cases. */
|
||||
if ((!definition && Is_Public (gnat_entity)
|
||||
&& !Is_Statically_Allocated (gnat_entity)
|
||||
&& kind != E_Discriminant && kind != E_Component)
|
||||
|| (Is_Imported (gnat_entity)
|
||||
&& (kind == E_Function || kind == E_Procedure)))
|
||||
being defined. */
|
||||
if (!definition
|
||||
&& Is_Public (gnat_entity)
|
||||
&& !Is_Statically_Allocated (gnat_entity)
|
||||
&& kind != E_Component
|
||||
&& kind != E_Discriminant)
|
||||
force_global++, this_global = true;
|
||||
|
||||
/* Handle any attributes directly attached to the entity. */
|
||||
|
@ -1,6 +1,11 @@
|
||||
2009-04-21 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gnat.dg/import1.ad[sb]: New test.
|
||||
|
||||
2009-04-20 Andrew Pinski <andrew_pinski@playstation.sony.com>
|
||||
|
||||
* objc/execute/exceptions/handler-1.m: For the NeXT runtime, just return 0.
|
||||
* objc/execute/exceptions/handler-1.m: For the NeXT runtime, just
|
||||
return 0.
|
||||
|
||||
2009-04-20 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
|
17
gcc/testsuite/gnat.dg/import1.adb
Normal file
17
gcc/testsuite/gnat.dg/import1.adb
Normal file
@ -0,0 +1,17 @@
|
||||
-- { dg-do compile }
|
||||
-- { dg-options "-g" }
|
||||
|
||||
package body Import1 is
|
||||
|
||||
procedure Create (Bounds : Arr) is
|
||||
type Bound_Array is array (Bounds'Range) of Integer;
|
||||
|
||||
procedure Proc (Ptr : access Bound_Array);
|
||||
pragma Import (C, Proc);
|
||||
|
||||
Temp : aliased Bound_Array;
|
||||
begin
|
||||
Proc (Temp'Access);
|
||||
end;
|
||||
|
||||
end Import1;
|
7
gcc/testsuite/gnat.dg/import1.ads
Normal file
7
gcc/testsuite/gnat.dg/import1.ads
Normal file
@ -0,0 +1,7 @@
|
||||
package Import1 is
|
||||
|
||||
type Arr is array (Positive range <>) of Integer;
|
||||
|
||||
procedure Create (Bounds : Arr);
|
||||
|
||||
end Import1;
|
Loading…
x
Reference in New Issue
Block a user