From: Arnaud Charlet Date: Tue, 2 Aug 2011 10:07:34 +0000 (+0200) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f96b2d8594d3ae2352d7f8356336b1411ba14e3b;p=gcc.git [multiple changes] 2011-08-02 Eric Botcazou * einfo.adb (Base_Type): Tune implementation for speed. 2011-08-02 Robert Dewar * freeze.adb: Minor reformatting. From-SVN: r177122 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1bba5f3e50b..a78d1b98fc0 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2011-08-02 Eric Botcazou + + * einfo.adb (Base_Type): Tune implementation for speed. + +2011-08-02 Robert Dewar + + * freeze.adb: Minor reformatting. + 2011-08-02 Thomas Quinot * scos.ads: Update comments. diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 408f3c5760a..662af6735a6 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -5608,7 +5608,13 @@ package body Einfo is --------------- function Base_Type (Id : E) return E is + Is_Base_Type : Boolean; 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 when E_Enumeration_Subtype | E_Incomplete_Type | @@ -5628,11 +5634,17 @@ package body Einfo is E_Task_Subtype | E_String_Literal_Subtype | E_Class_Wide_Subtype => - return Etype (Id); + Is_Base_Type := False; when others => - return Id; + Is_Base_Type := True; end case; + + if Is_Base_Type then + return Id; + end if; + + return Etype (Id); end Base_Type; ------------------------- diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 08aed5550a8..0db54598599 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -2455,8 +2455,7 @@ package body Freeze is and then Nkind (Parent (E)) = N_Object_Declaration and then Present (Expression (Parent (E))) and then Nkind (Expression (Parent (E))) = N_Aggregate - and then - Is_Atomic_Aggregate (Expression (Parent (E)), Etype (E)) + and then Is_Atomic_Aggregate (Expression (Parent (E)), Etype (E)) then null; end if;