Commit a7a3cf5c by Arnaud Charlet

[multiple changes]

2009-04-24  Ed Schonberg  <schonberg@adacore.com>

	* sem_res.adb: additional optimization to inhibit creation of
	redundant transient scopes.

2009-04-24  Bob Duff  <duff@adacore.com>

	* rtsfind.ads: Minor comment fix

2009-04-24  Emmanuel Briot  <briot@adacore.com>

	* prj-proc.adb, prj-nmsc.adb (Find_Ada_Sources,
	Get_Path_Name_And_Record_Ada_Sources): merged, since these were
	basically doing the same work (for explicit or implicit sources).
	(Find_Explicit_Sources): renamed to Find_Sources to better reflect its
	role. Rewritten to share some code (testing that all explicit sources
	have been found) between ada_only and multi_language modes.

2009-04-24  Jerome Lambourg  <lambourg@adacore.com>

	* sem_prag.adb (Check_Form_Of_Interface_Name): Allow space in Ext_Name
	for CLI imported types.
	(Analyze_Pragma): Allow CIL or Java imported functions returning
	access-to-subprogram types.

From-SVN: r146720
parent 2324b3fd
2009-04-24 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb: additional optimization to inhibit creation of
redundant transient scopes.
2009-04-24 Bob Duff <duff@adacore.com>
* rtsfind.ads: Minor comment fix
2009-04-24 Emmanuel Briot <briot@adacore.com>
* prj-proc.adb, prj-nmsc.adb (Find_Ada_Sources,
Get_Path_Name_And_Record_Ada_Sources): merged, since these were
basically doing the same work (for explicit or implicit sources).
(Find_Explicit_Sources): renamed to Find_Sources to better reflect its
role. Rewritten to share some code (testing that all explicit sources
have been found) between ada_only and multi_language modes.
2009-04-24 Jerome Lambourg <lambourg@adacore.com>
* sem_prag.adb (Check_Form_Of_Interface_Name): Allow space in Ext_Name
for CLI imported types.
(Analyze_Pragma): Allow CIL or Java imported functions returning
access-to-subprogram types.
2009-04-24 Emmanuel Briot <briot@adacore.com>
* make.adb, prj.adb, prj.ads, makeutl.adb, makeutl.ads:
......
......@@ -2391,8 +2391,7 @@ package body Prj.Proc is
Extending2 := Extending;
while Extending2 /= No_Project loop
if In_Tree.Projects.Table (Extending2).Ada_Sources /=
Nil_String
if Has_Ada_Sources (In_Tree.Projects.Table (Extending2))
and then
In_Tree.Projects.Table
(Extending2).Object_Directory.Name = Obj_Dir
......
......@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2009, 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- --
......@@ -2922,7 +2922,7 @@ package Rtsfind is
-- Returns True if the given Nam is an Expanded Name, whose Prefix is Ada,
-- and whose selector is either Text_IO.xxx or Wide_Text_IO.xxx or
-- Wide_Wide_Text_IO.xxx, where xxx is one of the subpackages of Text_IO
-- that is specially handled as described above for Text_IO_Kludge.
-- that is specially handled as described below for Text_IO_Kludge.
function RTE (E : RE_Id) return Entity_Id;
-- Given the entity defined in the above tables, as identified by the
......
......@@ -3929,20 +3929,21 @@ package body Sem_Prag is
if not In_Character_Range (C)
-- For all cases except external names on CLI target,
-- For all cases except CLI target,
-- commas, spaces and slashes are dubious (in CLI, we use
-- spaces and commas in external names to specify assembly
-- version and public key, while slashes can be used in
-- names to mark nested classes).
-- commas and backslashes in external names to specify
-- assembly version and public key, while slashes and spaces
-- can be used in names to mark nested classes and
-- valuetypes).
or else ((not Ext_Name_Case or else VM_Target /= CLI_Target)
and then (Get_Character (C) = ' '
or else
Get_Character (C) = ','
and then (Get_Character (C) = ','
or else
Get_Character (C) = '\'))
or else (VM_Target /= CLI_Target
and then Get_Character (C) = '/')
and then (Get_Character (C) = ' '
or else
Get_Character (C) = '/'))
then
Error_Msg
("?interface name contains illegal character",
......@@ -8249,6 +8250,10 @@ package body Sem_Prag is
and then
(Is_Value_Type (Etype (Def_Id))
or else
(Ekind (Etype (Def_Id)) = E_Access_Subprogram_Type
and then
Atree.Convention (Etype (Def_Id)) = Convention)
or else
(Ekind (Etype (Def_Id)) in Access_Kind
and then
(Atree.Convention
......@@ -8271,7 +8276,7 @@ package body Sem_Prag is
pragma Assert (Convention = Convention_CIL);
Error_Pragma_Arg
("pragma% requires function returning a " &
"'CIL access type", Arg1);
"'C'I'L access type", Arg1);
end if;
end if;
......
......@@ -2668,6 +2668,12 @@ package body Sem_Res is
-- common type. Used to enforce the restrictions on array conversions
-- of AI95-00246.
function Static_Concatenation (N : Node_Id) return Boolean;
-- Predicate to determine whether an actual that is a concatenation
-- will be evaluated statically and does not need a transient scope.
-- This must be determined before the actual is resolved and expanded
-- because if needed the transient scope must be introduced earlier.
--------------------------
-- Check_Argument_Order --
--------------------------
......@@ -3014,6 +3020,43 @@ package body Sem_Res is
return Root_Type (Base_Type (FT1)) = Root_Type (Base_Type (FT2));
end Same_Ancestor;
--------------------------
-- Static_Concatenation --
--------------------------
function Static_Concatenation (N : Node_Id) return Boolean is
begin
if Nkind (N) /= N_Op_Concat
or else Etype (N) /= Standard_String
then
return False;
elsif Nkind (Left_Opnd (N)) = N_String_Literal then
return Static_Concatenation (Right_Opnd (N));
elsif Is_Entity_Name (Left_Opnd (N)) then
declare
Ent : constant Entity_Id := Entity (Left_Opnd (N));
begin
if Ekind (Ent) = E_Constant
and then Present (Constant_Value (Ent))
and then Is_Static_Expression (Constant_Value (Ent))
then
return Static_Concatenation (Right_Opnd (N));
else
return False;
end if;
end;
elsif Static_Concatenation (Left_Opnd (N)) then
return Static_Concatenation (Right_Opnd (N));
else
return False;
end if;
end Static_Concatenation;
-- Start of processing for Resolve_Actuals
begin
......@@ -3184,6 +3227,7 @@ package body Sem_Res is
and then
not (Is_Intrinsic_Subprogram (Nam)
and then Chars (Nam) = Name_Asm)
and then not Static_Concatenation (A)
then
Establish_Transient_Scope (A, False);
Resolve (A, Etype (F));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment