e861bd3 Introduce on-the-fly type canonicalization

Authored and Committed by Dodji Seketeli 8 years ago
20 files changed. 8100 lines added. 7968 lines removed.
include/abg-ir.h
file modified
+12 -4
src/abg-ir.cc
file modified
+114 -2
tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt
file modified
+1 -3
tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-1.txt
file modified
+0 -2
tests/data/test-read-dwarf/libtest23.so.abi
file modified
+6 -6
tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi
file modified
+8 -8
tests/data/test-read-dwarf/libtest24-drop-fns.so.abi
file modified
+8 -8
tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi
file modified
+40 -40
tests/data/test-read-dwarf/test11-pr18828.so.abi
file modified
+19 -19
tests/data/test-read-dwarf/test12-pr18844.so.abi
file modified
+24 -24
tests/data/test-read-dwarf/test13-pr18894.so.abi
file modified
+150 -150
tests/data/test-read-dwarf/test14-pr18893.so.abi
file modified
+16 -16
tests/data/test-read-dwarf/test15-pr18892.so.abi
file modified
+26 -26
tests/data/test-read-dwarf/test16-pr18904.so.abi
file modified
+54 -54
tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi
file modified
+2 -2
tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi
file modified
+1 -1
tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi
file modified
+2 -2
tests/data/test-read-dwarf/test21-pr19092.so.abi
file modified
+182 -182
tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi
file modified
+7386 -7370
tests/data/test-read-dwarf/test9-pr18818-clang.so.abi
file modified
+49 -49
    Introduce on-the-fly type canonicalization
    
    During canonicalization of a type T, when T is structurally compared
    to an already canonicalized type C, it can happen that
    non-canonicalized sub-types of T are structurally compared again and
    again to canonicalized sub-types of C.
    
    This patch introduces a new optimization or those cases: on-the-fly
    type canonicalized.
    
    That means, if a not-yet-canonicalized sub-type S of the type T being
    canonicalized structurally compares equal to a canonicalized sub-type,
    then the canonical type of S is said to be the canonical type of the
    canonicalized sub-type.  So sub-type S is canonicalized, on-the-fly,
    during canonicalization of type T.
    
    This considerably speeds up the canonicalization process while doing
    "abidiff vmlinux vmlinux".  It goes from taking forever to taking 45
    seconds on a non-optimized build.
    
    	* include/abg-ir.h (environment::do_on_the_fly_canonicalization):
    	Declare new member functions.
    	({type_base, function_type}::priv_): Make this public so that
    	static non-member functions defined in abg-ir.cc can access it.
    	* src/abg-ir.cc
    	(environment::priv::do_on_the_fly_canonicalization_): New data
    	member.
    	(environment::priv::priv): Initialize it.
    	(environment::do_on_the_fly_canonicalization): Define new member
    	functions.
    	(type_base::get_canonical_type_for): Trigger on-the-fly
    	canonicalization during comparison of the type being canonicalized
    	and an already canonicalized type.
    	(types_are_being_compared, maybe_propagate_canonical_type): Define
    	new static functions.
    	(equals): In overloads for class_decl and function_type, call
    	maybe_propagate_canonical_type when the two types compare equal.
    	* tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt:
    	Adjust.
    	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.
    
    Signed-off-by: Dodji Seketeli <dodji@redhat.com>
    
        
file modified
+12 -4
file modified
+114 -2