aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-02 12:07:34 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-02 12:07:34 +0200
commitf96b2d8594d3ae2352d7f8356336b1411ba14e3b (patch)
tree993229cdb5b779c426ed2a6868101142791fa964
parent8b3c64300b604fa06ca1e09b243bcfe424d883c0 (diff)
downloadgcc-f96b2d8594d3ae2352d7f8356336b1411ba14e3b.zip
gcc-f96b2d8594d3ae2352d7f8356336b1411ba14e3b.tar.gz
gcc-f96b2d8594d3ae2352d7f8356336b1411ba14e3b.tar.bz2
[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
-rw-r--r--gcc/ada/ChangeLog8
-rw-r--r--gcc/ada/einfo.adb16
-rw-r--r--gcc/ada/freeze.adb3
3 files changed, 23 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 1bba5f3..a78d1b9 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,11 @@
+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>
* scos.ads: Update comments.
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index 408f3c5..662af67 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 08aed55..0db5459 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;