diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-15 10:52:24 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-15 10:52:24 +0000 |
commit | e1cedbae69770c11bd36f8aadddabd9c54ab204d (patch) | |
tree | 04c1eb149f086e71e621f985ba45cbbf1470156a /gcc/ada/exp_prag.adb | |
parent | 258a168decd85348a3c455c4d1c0592ff6604a69 (diff) | |
download | ppe42-gcc-e1cedbae69770c11bd36f8aadddabd9c54ab204d.tar.gz ppe42-gcc-e1cedbae69770c11bd36f8aadddabd9c54ab204d.zip |
2012-05-15 Tristan Gingold <gingold@adacore.com>
* a-exextr.adb: Add comment.
2012-05-15 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb: Minor reformatting (remove long dead code).
2012-05-15 Ed Schonberg <schonberg@adacore.com>
* aspects.adb, aspects.ads: Add aspects for Convention, Export,
External_Name, Import, and Link_Name.
* exp_prag.adb (Expand_Pragma_Import_Or_Interface): if the
pragma comes from an aspect specification, the entity is the
first argument.
* sem_prag.adb (Analyze_Pragma, cases Pragma_Export and
Pragma_Import): if the pragma comes from an aspect specification,
the entity is the first argument, and the second has the value
True by default.
* sem_ch13.adb (Analyze_Aspect_Specifications): generate pragam
for aspect Convention. Add placeholders for Link_Name and
External_Name.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187523 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_prag.adb')
-rw-r--r-- | gcc/ada/exp_prag.adb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb index 8cb084d6ba2..d283a6e397e 100644 --- a/gcc/ada/exp_prag.adb +++ b/gcc/ada/exp_prag.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2012, 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- -- @@ -527,10 +527,18 @@ package body Exp_Prag is -- seen (i.e. this elaboration cannot be deferred to the freeze point). procedure Expand_Pragma_Import_Or_Interface (N : Node_Id) is - Def_Id : constant Entity_Id := Entity (Arg2 (N)); + Def_Id : Entity_Id; Init_Call : Node_Id; begin + -- If the pragma comes from an aspect, the entity is its first argument. + + if Present (Corresponding_Aspect (N)) then + Def_Id := Entity (Arg1 (N)); + else + Def_Id := Entity (Arg2 (N)); + end if; + if Ekind (Def_Id) = E_Variable then -- Find generated initialization call for object, if any |