writer: Make sorting referenced typedefs types stable in abixml
authorDodji Seketeli <dodji@redhat.com>
Sun, 24 Jul 2022 15:33:02 +0000 (17:33 +0200)
committerDodji Seketeli <dodji@redhat.com>
Sun, 24 Jul 2022 15:33:02 +0000 (17:33 +0200)
After the latest commits, it apears that sorting typedefs referenced
by by other types that are emitted in the abixml file is not stable
when the underlying types are integral types.

This happens after the commit:

commit 7cd83740bfe7e58c03ea2a66386dbb0962f7f6de
Author: Dodji Seketeli <dodji@redhat.com>
Date:   Fri Jul 22 22:45:04 2022 +0200

    ir: Consider integral types of same kind and size as equivalent

This patch fixes that by using the non-internal pretty representation
(which disambiguates integral types) of types for sorting purposes.

* src/abg-writer.cc (read_context::type_ptr_cmp::operator()): In
the less-than operator the type pointer comparison functor, use
the non-internal pretty representation of types for sorting
purposes.
* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
Adjust
* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-writer.cc
tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi
tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi

index 04f26edfbe9e7ea0a486c4fb695735b9c98e5e50..3fab488b94df95502c491440732fd077efe36004 100644 (file)
@@ -693,8 +693,8 @@ public:
              l = peel_typedef_type(l);
              r = peel_typedef_type(r);
 
-             r1 = ir::get_pretty_representation(l, true),
-               r2 = ir::get_pretty_representation(r, true);
+             r1 = ir::get_pretty_representation(l, /*internal=*/false),
+               r2 = ir::get_pretty_representation(r, /*internal=*/false);
 
              if (r1 != r2)
                return r1 < r2;
index 83dbc6ffeaadaa563fa590478698d6ff388ed898..326c3187404bae8dafdb5bf92a60d99ea776c93d 100644 (file)
     </class-decl>
     <class-decl name='vtkPixelTransfer' size-in-bits='8' visibility='default' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='35' column='1' id='type-id-63'>
       <member-type access='private'>
-        <!-- typedef long long int vtkPixelTransfer::VTK_TT -->
-        <typedef-decl name='VTK_TT' type-id='type-id-15' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='138' column='1' id='type-id-419'/>
+        <!-- typedef int vtkPixelTransfer::VTK_TT -->
+        <typedef-decl name='VTK_TT' type-id='type-id-12' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='138' column='1' id='type-id-417'/>
       </member-type>
     </class-decl>
     <class-decl name='vtkPixelTransfer' size-in-bits='8' visibility='default' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='35' column='1' id='type-id-63'>
       <member-type access='private'>
-        <!-- typedef int vtkPixelTransfer::VTK_TT -->
-        <typedef-decl name='VTK_TT' type-id='type-id-12' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='138' column='1' id='type-id-417'/>
+        <!-- typedef long long int vtkPixelTransfer::VTK_TT -->
+        <typedef-decl name='VTK_TT' type-id='type-id-15' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='138' column='1' id='type-id-419'/>
       </member-type>
     </class-decl>
     <class-decl name='vtkPixelTransfer' size-in-bits='8' visibility='default' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='35' column='1' id='type-id-63'>
index f13dc32f709b12dcde1b93311c1556a75edffb0a..e5a121d2baa875fb452b88aee3fd23d3fcff3e98 100644 (file)
     </class-decl>
     <class-decl name='vtkPixelTransfer' size-in-bits='8' visibility='default' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='35' column='1' id='type-id-63'>
       <member-type access='private'>
-        <typedef-decl name='VTK_TT' type-id='type-id-15' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='138' column='1' id='type-id-419'/>
+        <typedef-decl name='VTK_TT' type-id='type-id-12' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='138' column='1' id='type-id-417'/>
       </member-type>
     </class-decl>
     <class-decl name='vtkPixelTransfer' size-in-bits='8' visibility='default' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='35' column='1' id='type-id-63'>
       <member-type access='private'>
-        <typedef-decl name='VTK_TT' type-id='type-id-12' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='138' column='1' id='type-id-417'/>
+        <typedef-decl name='VTK_TT' type-id='type-id-15' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='138' column='1' id='type-id-419'/>
       </member-type>
     </class-decl>
     <class-decl name='vtkPixelTransfer' size-in-bits='8' visibility='default' filepath='/tmp/legendre/spack-stage/spack-stage-R_crTC/VTK-6.1.0/Rendering/LIC/vtkPixelTransfer.h' line='35' column='1' id='type-id-63'>