]> sourceware.org Git - libabigail.git/commit
Use size/alignment of class definition when requested on declaration
authorDodji Seketeli <dodji@redhat.com>
Fri, 28 Aug 2015 15:11:15 +0000 (17:11 +0200)
committerDodji Seketeli <dodji@redhat.com>
Sat, 29 Aug 2015 14:23:15 +0000 (16:23 +0200)
commit9ab2c3a3fd94116184df5bb0506d09acf59ff54b
tree832833a700b102eee796a492e9ddaca8326ddbb2
parentf609f3b8b93ee8d2f1beb4a6f154f45c81f532fa
Use size/alignment of class definition when requested on declaration

Sometimes during hashing the "type sub-object" of a class can be
queried for its size or alignment.  In those case, if the class is a
declaration that happens to be accompanied with a definition, its the
size/alignment of the definition that we want, not the one of the
declaration, that is zero.  Otherwise, this can cause spurious hashing
changes between two class types that are otherwise equivalent modulo
the use of a class declaration.

This patch being part of a series that aims at fixing a number of type
hashing issues, the regression tests are adjusted at the end of the
series, not here.

* include/abg-ir.h (type_base::{set_size_in_bits,
set_alignment_in_bits}): Make these member functions virtual.
(class_decl::{set_size_in_bits, get_size_in_bits,
get_alignment_in_bits, set_alignment_in_bits}): Declare these
virtual member functions.
* src/abg-ir.cc (class_decl::{set_size_in_bits, get_size_in_bits,
get_alignment_in_bits, set_alignment_in_bits}): Define these
virtual functions.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
include/abg-ir.h
src/abg-ir.cc
This page took 0.031892 seconds and 5 git commands to generate.