13#ifndef __ABG_SUPPRESSION_PRIV_H__
14#define __ABG_SUPPRESSION_PRIV_H__
22#include "abg-suppression.h"
40 std::atomic<bool> is_artificial_;
41 std::atomic<bool> drops_artifact_;
43 string file_name_regex_str_;
45 string file_name_not_regex_str_;
47 string soname_regex_str_;
49 string soname_not_regex_str_;
58 priv(
const string& label)
64 priv(
const string& label,
65 const string& file_name_regex_str,
66 const string& file_name_not_regex_str)
70 file_name_regex_str_(file_name_regex_str),
71 file_name_not_regex_str_(file_name_not_regex_str)
74 friend class suppression_base;
87 lock_guard<mutex> lock(mutex_);
88 if (!file_name_regex_ && !file_name_regex_str_.empty())
90 return file_name_regex_;
104 lock_guard<mutex> lock(mutex_);
105 if (!file_name_not_regex_ && !file_name_not_regex_str_.empty())
107 return file_name_not_regex_;
121 lock_guard<mutex> lock(mutex_);
122 if (!soname_regex_ && !soname_regex_str_.empty())
124 return soname_regex_;
138 lock_guard<mutex> lock(mutex_);
139 if (!soname_not_regex_ && !soname_not_regex_str_.empty())
141 return soname_not_regex_;
156 bool has_regexp =
false;
190 bool has_regexp =
false;
221 friend class function_suppression;
223 mutable mutex mutex_;
226 string type_name_regex_str_;
233 priv(
size_t i,
const string& tn)
234 : index_(i), type_name_(tn)
237 priv(
size_t i,
const string& tn,
const string& tn_regex)
238 : index_(i), type_name_(tn), type_name_regex_str_(tn_regex)
242 get_type_name_regex()
const
244 lock_guard<mutex> lock(mutex_);
245 if (!type_name_regex_ && !type_name_regex_str_.empty())
247 return type_name_regex_;
256 friend class function_suppression;
258 mutable std::mutex mutex_;
261 string name_regex_str_;
263 string name_not_regex_str_;
265 string return_type_name_;
266 string return_type_regex_str_;
270 string symbol_name_regex_str_;
272 string symbol_name_not_regex_str_;
274 string symbol_version_;
275 string symbol_version_regex_str_;
277 std::atomic<bool> allow_other_aliases_;
281 allow_other_aliases_(
true)
284 priv(
const string& name,
285 const string& name_regex_str,
286 const string& return_type_name,
287 const string& return_type_regex_str,
289 const string& symbol_name,
290 const string& symbol_name_regex_str,
291 const string& symbol_version,
292 const string& symbol_version_regex_str)
295 name_regex_str_(name_regex_str),
296 return_type_name_(return_type_name),
297 return_type_regex_str_(return_type_regex_str),
298 parm_specs_(parm_specs),
299 symbol_name_(symbol_name),
300 symbol_name_regex_str_(symbol_name_regex_str),
301 symbol_version_(symbol_version),
302 symbol_version_regex_str_(symbol_version_regex_str),
303 allow_other_aliases_(
true)
319 lock_guard<mutex> lock(mutex_);
320 if (!name_regex_ && !name_regex_str_.empty())
337 lock_guard<mutex> lock(mutex_);
338 if (!name_not_regex_ && !name_not_regex_str_.empty())
340 return name_not_regex_;
355 lock_guard<mutex> lock(mutex_);
356 if (!return_type_regex_ && !return_type_regex_str_.empty())
358 return return_type_regex_;
373 lock_guard<mutex> lock(mutex_);
374 if (!symbol_name_regex_ && !symbol_name_regex_str_.empty())
376 return symbol_name_regex_;
391 lock_guard<mutex> lock(mutex_);
392 if (!symbol_name_not_regex_ && !symbol_name_not_regex_str_.empty())
393 symbol_name_not_regex_ =
regex::compile(symbol_name_not_regex_str_);
394 return symbol_name_not_regex_;
409 lock_guard<mutex> lock(mutex_);
410 if (!symbol_version_regex_ && !symbol_version_regex_str_.empty())
411 symbol_version_regex_ =
regex::compile(symbol_version_regex_str_);
412 return symbol_version_regex_;
418 const string& fn_name);
422 const string& fn_linkage_name);
426 const string& var_name);
430 const string& var_linkage_name);
437 friend class variable_suppression;
439 mutable mutex mutex_;
442 string name_regex_str_;
444 string name_not_regex_str_;
447 string symbol_name_regex_str_;
449 string symbol_name_not_regex_str_;
451 string symbol_version_;
452 string symbol_version_regex_str_;
455 string type_name_regex_str_;
458 priv(
const string& name,
459 const string& name_regex_str,
460 const string& symbol_name,
461 const string& symbol_name_regex_str,
462 const string& symbol_version,
463 const string& symbol_version_regex_str,
464 const string& type_name,
465 const string& type_name_regex_str)
468 name_regex_str_(name_regex_str),
469 symbol_name_(symbol_name),
470 symbol_name_regex_str_(symbol_name_regex_str),
471 symbol_version_(symbol_version),
472 symbol_version_regex_str_(symbol_version_regex_str),
473 type_name_(type_name),
474 type_name_regex_str_(type_name_regex_str)
489 lock_guard<mutex> lock(mutex_);
490 if (!name_regex_ && !name_regex_str_.empty())
507 lock_guard<mutex> lock(mutex_);
508 if (!name_not_regex_ && !name_not_regex_str_.empty())
510 return name_not_regex_;
525 lock_guard<mutex> lock(mutex_);
526 if (!symbol_name_regex_ && !symbol_name_regex_str_.empty())
528 return symbol_name_regex_;
543 lock_guard<mutex> lock(mutex_);
544 if (!symbol_name_not_regex_ && !symbol_name_not_regex_str_.empty())
545 symbol_name_not_regex_ =
regex::compile(symbol_name_not_regex_str_);
546 return symbol_name_not_regex_;
561 lock_guard<mutex> lock(mutex_);
562 if (!symbol_version_regex_ && !symbol_version_regex_str_.empty())
563 symbol_version_regex_ =
regex::compile(symbol_version_regex_str_);
564 return symbol_version_regex_;
579 lock_guard<mutex> lock(mutex_);
580 if (!type_name_regex_ && !type_name_regex_str_.empty())
582 return type_name_regex_;
592 mutable std::mutex mutex_;
593 string type_name_regex_str_;
596 string type_name_not_regex_str_;
598 std::atomic<bool> consider_type_kind_;
600 std::atomic<bool> consider_reach_kind_;
601 std::atomic<type_suppression::reach_kind> reach_kind_;
602 std::atomic<bool> has_size_change_;
605 string_set_type potential_data_members_;
608 string potential_data_members_regex_str_;
613 unordered_set<string> source_locations_to_keep_;
614 string source_location_to_keep_regex_str_;
620 std::atomic<bool> has_strict_fam_conv_;
625 priv(
const string& type_name_regexp,
626 const string& type_name,
627 bool consider_type_kind,
629 bool consider_reach_kind,
631 : type_name_regex_str_(type_name_regexp),
632 type_name_(type_name),
633 consider_type_kind_(consider_type_kind),
635 consider_reach_kind_(consider_reach_kind),
637 has_size_change_(
false),
638 has_strict_fam_conv_(
false)
652 lock_guard<mutex> lock(mutex_);
653 if (!type_name_regex_ && !type_name_regex_str_.empty())
655 return type_name_regex_;
664 lock_guard<mutex> lock(mutex_);
665 type_name_regex_ = r;
679 lock_guard<mutex> lock(mutex_);
680 if (!type_name_not_regex_ && !type_name_not_regex_str_.empty())
682 return type_name_not_regex_;
691 lock_guard<mutex> lock(mutex_);
692 type_name_not_regex_ = r;
703 lock_guard<mutex> lock(mutex_);
704 return type_name_not_regex_str_;
715 lock_guard<mutex> lock(mutex_);
716 type_name_not_regex_str_ = regex_str;
725 lock_guard<mutex> lock(mutex_);
726 if (!source_location_to_keep_regex_
727 && !source_location_to_keep_regex_str_.empty())
728 source_location_to_keep_regex_ =
730 return source_location_to_keep_regex_;
739 lock_guard<mutex> lock(mutex_);
740 source_location_to_keep_regex_ = r;
752 lock_guard<mutex> lock(mutex_);
753 if (!potential_data_members_regex_
754 && !potential_data_members_regex_str_.empty())
756 potential_data_members_regex_ =
759 return potential_data_members_regex_;
771 lock_guard<mutex> lock(mutex_);
772 potential_data_members_regex_ = r;
775 friend class type_suppression;
780 const string& type_name);
785 const type_base_sptr& type);
793 const type_base_sptr& type);
797 const string& type_name,
Wrappers around regex types and functions.
Utilities to ease the wrapping of C types into std::shared_ptr.
The source location of a token.
Abstraction of the specification of a function parameter in a function suppression specification.
Abstraction of a function suppression specification.
change_kind
The kind of change the current function suppression should apply to.
@ ALL_CHANGE_KIND
This represents all the changes possibly described by this enum. It's a logical 'OR' of all the chang...
vector< parameter_spec_sptr > parameter_specs_type
Convenience typedef for vector of parameter_spec_sptr.
The private data of suppression_base.
bool matches_binary_name(const string &binary_name) const
Test if the current suppression matches the full file path to a given binary.
const regex::regex_t_sptr & get_file_name_regex() const
Get the regular expression object associated to the 'file_name_regex' property of suppression_base.
const regex::regex_t_sptr & get_file_name_not_regex() const
Get the regular expression object associated to the 'file_name_not_regex' property of suppression_bas...
const regex::regex_t_sptr & get_soname_not_regex() const
Get the regular expression object associated to the 'soname_not_regex' property of suppression_base.
bool matches_soname(const string &soname) const
Test if the current suppression matches a given SONAME.
const regex::regex_t_sptr & get_soname_regex() const
Get the regular expression object associated to the 'soname_regex' property of suppression_base.
The private data for type_suppression.
const regex::regex_t_sptr get_type_name_not_regex() const
Get the regular expression object associated to the 'type_name_not_regex' property of type_suppressio...
const regex::regex_t_sptr get_potential_data_member_names_regex() const
Getter for the "potential_data_member_names_regex" object.
void set_potential_data_member_names_regex(regex::regex_t_sptr &r)
Setter for the "potential_data_member_names_regex" object.
const string & get_type_name_not_regex_str() const
Getter for the string that denotes the 'type_name_not_regex' property.
void set_type_name_not_regex(regex::regex_t_sptr r)
Setter for the type_name_not_regex object.
void set_source_location_to_keep_regex(regex::regex_t_sptr r)
Setter for the source_location_to_keep_regex object.
void set_type_name_regex(regex::regex_t_sptr r)
Setter for the type_name_regex object.
void set_type_name_not_regex_str(const string regex_str)
Setter for the string that denotes the 'type_name_not_regex' property.
const regex::regex_t_sptr get_source_location_to_keep_regex() const
Getter for the source_location_to_keep_regex object.
const regex::regex_t_sptr get_type_name_regex() const
Get the regular expression object associated to the 'type_name_regex' property of type_suppression.
Abstraction of a type suppression specification.
vector< insertion_range_sptr > insertion_ranges
A convenience typedef for a vector of insertion_range_sptr.
type_kind
The kind of the type the current type suppression is supposed to be about.
reach_kind
The different ways through which the type diff has been reached.
The abstraction of a variable suppression specification.
change_kind
The kind of change the current variable suppression should apply to.
@ ALL_CHANGE_KIND
This represents all the changes possibly described by this enum. It's a logical 'OR' of all the chang...
shared_ptr< scope_decl > scope_decl_sptr
Convenience typedef for a shared pointer on a scope_decl.
bool match(const regex_t_sptr &r, const std::string &str)
See if a string matches a regex.
regex_t_sptr compile(const std::string &str)
Compile a regex from a string.
std::shared_ptr< regex_t > regex_t_sptr
A convenience typedef for a shared pointer of regex_t.
an engine to suppress the parts of the result of comparing two sets of ABI artifacts.
bool suppression_matches_type_name(const suppr::type_suppression &s, const string &type_name)
Test if a type suppression specification matches a type name.
bool suppression_matches_variable_name(const suppr::variable_suppression &s, const string &var_name)
Test if a variable suppression matches a variable denoted by its name.
bool suppression_matches_type_name_or_location(const type_suppression &s, const string &type_name, const location &type_location)
Test if a type suppression matches a type name and location.
bool suppression_matches_type_location(const type_suppression &s, const location &loc)
Test if a type suppression matches a source location.
bool suppression_matches_variable_sym_name(const suppr::variable_suppression &s, const string &var_linkage_name)
Test if a variable suppression matches a variable denoted by its symbol name.
Toplevel namespace for libabigail.
The type of the private data of the function_suppression type.
const regex::regex_t_sptr get_return_type_regex() const
Getter for a pointer to a regular expression object built from the regular expression string function...
const regex::regex_t_sptr get_symbol_name_not_regex() const
Getter for a pointer to a regular expression object built from the regular expression string function...
const regex::regex_t_sptr get_name_regex() const
Getter for a pointer to a regular expression object built from the regular expression string function...
const regex::regex_t_sptr get_symbol_version_regex() const
Getter for a pointer to a regular expression object built from the regular expression string function...
const regex::regex_t_sptr get_name_not_regex() const
Getter for a pointer to a regular expression object built from the regular expression string function...
const regex::regex_t_sptr get_symbol_name_regex() const
Getter for a pointer to a regular expression object built from the regular expression string function...
The type of the private data of the variable_suppression type.
const regex::regex_t_sptr get_symbol_name_not_regex() const
Getter for a pointer to a regular expression object built from the regular expression string variable...
const regex::regex_t_sptr get_name_regex() const
Getter for a pointer to a regular expression object built from the regular expression string variable...
const regex::regex_t_sptr get_symbol_version_regex() const
Getter for a pointer to a regular expression object built from the regular expression string variable...
const regex::regex_t_sptr get_name_not_regex() const
Getter for a pointer to a regular expression object built from the regular expression string variable...
const regex::regex_t_sptr get_symbol_name_regex() const
Getter for a pointer to a regular expression object built from the regular expression string variable...
const regex::regex_t_sptr get_type_name_regex() const
Getter for a pointer to a regular expression object built from the regular expression string variable...