suppression: Better handle soname/filename properties evaluation

At the moment, we don't make any difference between these two cases:

  1/ A suppression specification has no soname or file name related
  property.

  2/ A suppression specification has a soname or file name related
  property that doesn't match the soname or file name of a given
  corpus.

In both cases 1/ and 2/ libabigail currently assumes that the
suppression specification does not match the given corpus we are
looking at.  This can be wrong, especially if we are in the case 1/
and if the suppression does have other properties that should make it
match the corpus.

This patch fixes this issue.

	* include/abg-suppression.h
	(suppression_base::has_{soname,file_name}_related_property): Add
	new member functions.
	* src/abg-dwarf-reader.cc (read_context::suppression_can_match):
	Fix the logic to make a difference between the case where the
	suppression doesn't have any soname/filename property and the case
	where the suppression does have a soname/filename property that
	does not match the current binary.
	* src/abg-reader.cc (read_context::suppression_can_match):
	Likewise.
	* src/abg-suppression-priv.h
	(suppression_base::priv::matches_soname): If the suppression does
	not have any soname related property then it doesn't match the
	soname we are looking at.
	(suppression_base::priv::matches_binary_name): If the suppression
	does not have any filename related property then it doesn't match
	the filename we are looking at.
	* src/abg-suppression.cc
	(suppression_base::has_{soname,file_name}_related_property):
	Define new member functions.
	(sonames_of_binaries_match): If the suppression does not have any
	soname related property then it doesn't match the corpora of the
	diff we are looking at.
	(names_of_binaries_match): If the suppression does not have any
	filename related property then it doesn't match the corpora of the
	diff we are looking at.
	(type_suppression::suppresses_type): Fix the logic to make a
	difference between the case where the suppression doesn't have any
	soname/filename property and the case where the suppression does
	have a soname/filename property that does not match the current
	binary.
	(function_suppression::suppresses_{function, function_symbol}):
	Likewise.
	(variable_suppression::suppresses_{variable, variable_symbol}):
	Likewise.
	(file_suppression::suppresses_file): Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
5 files changed