Commit f96b2d85 by Arnaud Charlet

[multiple changes]

2011-08-02  Eric Botcazou  <ebotcazou@adacore.com>

	* einfo.adb (Base_Type): Tune implementation for speed.

2011-08-02  Robert Dewar  <dewar@adacore.com>

	* freeze.adb: Minor reformatting.

From-SVN: r177122
parent 8b3c6430
2011-08-02 Eric Botcazou <ebotcazou@adacore.com>
* einfo.adb (Base_Type): Tune implementation for speed.
2011-08-02 Robert Dewar <dewar@adacore.com>
* freeze.adb: Minor reformatting.
2011-08-02 Thomas Quinot <quinot@adacore.com> 2011-08-02 Thomas Quinot <quinot@adacore.com>
* scos.ads: Update comments. * scos.ads: Update comments.
......
...@@ -5608,7 +5608,13 @@ package body Einfo is ...@@ -5608,7 +5608,13 @@ package body Einfo is
--------------- ---------------
function Base_Type (Id : E) return E is function Base_Type (Id : E) return E is
Is_Base_Type : Boolean;
begin begin
-- Implementation note: this function shows up high in the profile.
-- We use a fully static case construct so as to make it easier for
-- the compiler to build a static table out of it, instead of using
-- a less efficient jump table.
case Ekind (Id) is case Ekind (Id) is
when E_Enumeration_Subtype | when E_Enumeration_Subtype |
E_Incomplete_Type | E_Incomplete_Type |
...@@ -5628,11 +5634,17 @@ package body Einfo is ...@@ -5628,11 +5634,17 @@ package body Einfo is
E_Task_Subtype | E_Task_Subtype |
E_String_Literal_Subtype | E_String_Literal_Subtype |
E_Class_Wide_Subtype => E_Class_Wide_Subtype =>
return Etype (Id); Is_Base_Type := False;
when others => when others =>
return Id; Is_Base_Type := True;
end case; end case;
if Is_Base_Type then
return Id;
end if;
return Etype (Id);
end Base_Type; end Base_Type;
------------------------- -------------------------
......
...@@ -2455,8 +2455,7 @@ package body Freeze is ...@@ -2455,8 +2455,7 @@ package body Freeze is
and then Nkind (Parent (E)) = N_Object_Declaration and then Nkind (Parent (E)) = N_Object_Declaration
and then Present (Expression (Parent (E))) and then Present (Expression (Parent (E)))
and then Nkind (Expression (Parent (E))) = N_Aggregate and then Nkind (Expression (Parent (E))) = N_Aggregate
and then and then Is_Atomic_Aggregate (Expression (Parent (E)), Etype (E))
Is_Atomic_Aggregate (Expression (Parent (E)), Etype (E))
then then
null; null;
end if; end if;
......
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