2015-10-23 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Oct 2015 12:21:21 +0000 (12:21 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Oct 2015 12:21:21 +0000 (12:21 +0000)
* sem_util.adb (Is_Iterator, Is_Reversible_iterator): Use
root type to determine whether the type is a descendant of the
corresponding interface type, so take into account multiple
levels of subtypes and derivations.

2015-10-23  Olivier Hainque  <hainque@adacore.com>

* tracebak.c: Refine selection of GCC/GENERIC_UNWINDER for
tracebacks on x86 & x86_64.
(x86 & x86_64): If !SJLJ, always pick the
GCC_UNWINDER for x86_64 (not only on linux).
* sem_util.ads: Minor fix in comment.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229239 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads
gcc/ada/tracebak.c

index 17fa34a..f1ef4ab 100644 (file)
@@ -1,3 +1,18 @@
+2015-10-23  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_util.adb (Is_Iterator, Is_Reversible_iterator): Use
+       root type to determine whether the type is a descendant of the
+       corresponding interface type, so take into account multiple
+       levels of subtypes and derivations.
+
+2015-10-23  Olivier Hainque  <hainque@adacore.com>
+
+       * tracebak.c: Refine selection of GCC/GENERIC_UNWINDER for
+       tracebacks on x86 & x86_64.
+       (x86 & x86_64): If !SJLJ, always pick the
+       GCC_UNWINDER for x86_64 (not only on linux).
+       * sem_util.ads: Minor fix in comment.
+
 2015-10-23  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * sem_prag.adb (Analyze_Pragma): Pragma Volatile_Function should
index 90cd1ca..325e3c5 100644 (file)
@@ -12119,12 +12119,16 @@ package body Sem_Util is
       Iface       : Entity_Id;
 
    begin
+      --  The type may be a subtype of a descendant of the proper instance of
+      --  the predefined interface type, so we must use the root type of the
+      --  given type. The same us done for Is_Reversible_Iterator.
+
       if Is_Class_Wide_Type (Typ)
-        and then Nam_In (Chars (Etype (Typ)), Name_Forward_Iterator,
+        and then Nam_In (Chars (Root_Type (Typ)), Name_Forward_Iterator,
                                               Name_Reversible_Iterator)
         and then
           Is_Predefined_File_Name
-            (Unit_File_Name (Get_Source_Unit (Etype (Typ))))
+            (Unit_File_Name (Get_Source_Unit (Root_Type (Typ))))
       then
          return True;
 
@@ -13009,9 +13013,9 @@ package body Sem_Util is
 
    begin
       if Is_Class_Wide_Type (Typ)
-        and then Chars (Etype (Typ)) = Name_Reversible_Iterator
+        and then Chars (Root_Type (Typ)) = Name_Reversible_Iterator
         and then Is_Predefined_File_Name
-                   (Unit_File_Name (Get_Source_Unit (Etype (Typ))))
+                   (Unit_File_Name (Get_Source_Unit (Root_Type (Typ))))
       then
          return True;
 
index 6fba622..1ed93de 100644 (file)
@@ -2156,7 +2156,7 @@ package Sem_Util is
    --  Determines if Current_Scope is within an init proc
 
    function Within_Scope (E : Entity_Id; S : Entity_Id) return Boolean;
-   --  Returns True if entity Id is declared within scope S
+   --  Returns True if entity E is declared within scope S
 
    procedure Wrong_Type (Expr : Node_Id; Expected_Type : Entity_Id);
    --  Output error message for incorrectly typed expression. Expr is the node
index c91f147..ff85ca5 100644 (file)
@@ -433,7 +433,7 @@ struct layout
    but our only alternative is the generic unwinder which requires
    compilation forcing a frame pointer to be reliable.  */
 
-#if defined (__linux__) && !defined (__USING_SJLJ_EXCEPTIONS__)
+#if (defined (__x86_64__) || defined (__linux__)) && !defined (__USING_SJLJ_EXCEPTIONS__)
 #define USE_GCC_UNWINDER
 #else
 #define USE_GENERIC_UNWINDER