This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Tested on i686-linux, committed on trunk
When debugging generated code we indicate to the debugger the location of the
source code that triggers the expansion. When we debug the original source we
want to make the generated code invisible to the debugger, by indicating that
its Sloc is not a source position at all.
This patch adds a level of indirection via the usage of a dummy record
type and System.Address when building predefined primitive operations for
interfaces in order to avoid importing System.Tasking and System.Tasking.
Protected_Objects.Protected_Operations when no implementing types are
present.
Source:
package Iface is
type I is limited interface;
end Iface;
Compilation:
gnatmake -gnat05 -gnatDG iface.ads
Execution:
grep "tasking" iface.ads.dg
Result:
The "grep" command should return zero occurences of "tasking".
Also, in Ada 2005 the return type of a function can be an anonymous access to
subprogram type. If the designated type is protected, we must create an
explicit declaration for it, because it must be expanded into an equivalent
record type that holds a pointer to the operation and a pointer to the
enclosing protected object. The declaration of the access subprogram component
must be identical to that of the original anonymous access, but the formal
parameters must be distinct (even though they will have the same names). In
Ada 95 the return type of the function could only be an entity, and it was
sufficient to copy it to create the signature of the new subprogram type.
In Ada 2005 we must build a new signature with distinct formals.
gnat.dg/specs/access3.ads must compile quietly.
2007-06-06 Ed Schonberg <schonberg@adacore.com>
Robert Dewar <dewar@adacore.com>
Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch9.ads, exp_ch9.adb (Build_Protected_Entry): Set sloc of
generated exception handler appropriately when debugging generated code.
Deal properly with No_Exception_Propagation restriction mode.
(Expand_N_Abort_Statement): Add an unchecked type conversion from
System.Address to System.Tasking.Task_Id when processing the result of
the predefined primitive _disp_get_task_id.
(Expand_N_Asynchronous_Select): Clarify comment.
(Expand_N_Protected_Type_Declaration): Minor code cleanup.
(Find_Parameter_Type): New routine inside Type_Conformant_Parameters.
(Type_Conformant_Parameters): New parameter Prim_Op_Typ. Code cleanup.
(Add_Private_Declarations, Build_Protected_Body): Use proper slocs for
privals and for generated call to Complete_Entry_Body, for better gdb
behavior.
(Copy_Result_Type): Utility to construct a parameter and result profile
for protected functions whose return type is an anonymous access to
subprogram.
(Build_Protected_Sub_Spec and Expand_Access_Protected_Subprogram_Type):
call the above.
(Build_Task_Activation_Call): Insert Activate_Tasks call at proper
point when the local-raise-to-goto transformation has taken place.
Attachment:
difs
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |