13#ifndef __ABG_SUPPRESSION_PRIV_H__
14#define __ABG_SUPPRESSION_PRIV_H__
19#include "abg-suppression.h"
35 string file_name_regex_str_;
37 string file_name_not_regex_str_;
39 string soname_regex_str_;
41 string soname_not_regex_str_;
50 priv(
const string& label)
56 priv(
const string& label,
57 const string& file_name_regex_str,
58 const string& file_name_not_regex_str)
62 file_name_regex_str_(file_name_regex_str),
63 file_name_not_regex_str_(file_name_not_regex_str)
79 if (!file_name_regex_ && !file_name_regex_str_.empty())
81 return file_name_regex_;
95 if (!file_name_not_regex_ && !file_name_not_regex_str_.empty())
97 return file_name_not_regex_;
111 if (!soname_regex_ && !soname_regex_str_.empty())
113 return soname_regex_;
127 if (!soname_not_regex_ && !soname_not_regex_str_.empty())
129 return soname_not_regex_;
144 bool has_regexp =
false;
178 bool has_regexp =
false;
213 string type_name_regex_str_;
220 priv(
size_t i,
const string& tn)
221 : index_(i), type_name_(tn)
224 priv(
size_t i,
const string& tn,
const string& tn_regex)
225 : index_(i), type_name_(tn), type_name_regex_str_(tn_regex)
229 get_type_name_regex()
const
231 if (!type_name_regex_ && !type_name_regex_str_.empty())
233 return type_name_regex_;
246 string name_regex_str_;
248 string name_not_regex_str_;
250 string return_type_name_;
251 string return_type_regex_str_;
255 string symbol_name_regex_str_;
257 string symbol_name_not_regex_str_;
259 string symbol_version_;
260 string symbol_version_regex_str_;
262 bool allow_other_aliases_;
266 allow_other_aliases_(
true)
269 priv(
const string& name,
270 const string& name_regex_str,
271 const string& return_type_name,
272 const string& return_type_regex_str,
274 const string& symbol_name,
275 const string& symbol_name_regex_str,
276 const string& symbol_version,
277 const string& symbol_version_regex_str)
280 name_regex_str_(name_regex_str),
281 return_type_name_(return_type_name),
282 return_type_regex_str_(return_type_regex_str),
283 parm_specs_(parm_specs),
284 symbol_name_(symbol_name),
285 symbol_name_regex_str_(symbol_name_regex_str),
286 symbol_version_(symbol_version),
287 symbol_version_regex_str_(symbol_version_regex_str),
288 allow_other_aliases_(
true)
304 if (!name_regex_ && !name_regex_str_.empty())
321 if (!name_not_regex_ && !name_not_regex_str_.empty())
323 return name_not_regex_;
338 if (!return_type_regex_ && !return_type_regex_str_.empty())
340 return return_type_regex_;
355 if (!symbol_name_regex_ && !symbol_name_regex_str_.empty())
357 return symbol_name_regex_;
372 if (!symbol_name_not_regex_ && !symbol_name_not_regex_str_.empty())
373 symbol_name_not_regex_ =
regex::compile(symbol_name_not_regex_str_);
374 return symbol_name_not_regex_;
389 if (!symbol_version_regex_ && !symbol_version_regex_str_.empty())
390 symbol_version_regex_ =
regex::compile(symbol_version_regex_str_);
391 return symbol_version_regex_;
397 const string& fn_name);
401 const string& fn_linkage_name);
405 const string& var_name);
409 const string& var_linkage_name);
420 string name_regex_str_;
422 string name_not_regex_str_;
425 string symbol_name_regex_str_;
427 string symbol_name_not_regex_str_;
429 string symbol_version_;
430 string symbol_version_regex_str_;
433 string type_name_regex_str_;
436 priv(
const string& name,
437 const string& name_regex_str,
438 const string& symbol_name,
439 const string& symbol_name_regex_str,
440 const string& symbol_version,
441 const string& symbol_version_regex_str,
442 const string& type_name,
443 const string& type_name_regex_str)
446 name_regex_str_(name_regex_str),
447 symbol_name_(symbol_name),
448 symbol_name_regex_str_(symbol_name_regex_str),
449 symbol_version_(symbol_version),
450 symbol_version_regex_str_(symbol_version_regex_str),
451 type_name_(type_name),
452 type_name_regex_str_(type_name_regex_str)
467 if (!name_regex_ && !name_regex_str_.empty())
484 if (!name_not_regex_ && !name_not_regex_str_.empty())
486 return name_not_regex_;
501 if (!symbol_name_regex_ && !symbol_name_regex_str_.empty())
503 return symbol_name_regex_;
518 if (!symbol_name_not_regex_ && !symbol_name_not_regex_str_.empty())
519 symbol_name_not_regex_ =
regex::compile(symbol_name_not_regex_str_);
520 return symbol_name_not_regex_;
535 if (!symbol_version_regex_ && !symbol_version_regex_str_.empty())
536 symbol_version_regex_ =
regex::compile(symbol_version_regex_str_);
537 return symbol_version_regex_;
552 if (!type_name_regex_ && !type_name_regex_str_.empty())
554 return type_name_regex_;
564 string type_name_regex_str_;
567 string type_name_not_regex_str_;
569 bool consider_type_kind_;
571 bool consider_reach_kind_;
573 bool has_size_change_;
576 string_set_type potential_data_members_;
579 string potential_data_members_regex_str_;
584 unordered_set<string> source_locations_to_keep_;
585 string source_location_to_keep_regex_str_;
587 mutable vector<string> changed_enumerator_names_;
588 mutable vector<regex::regex_t_sptr> changed_enumerators_regexp_;
591 bool has_strict_fam_conv_;
596 priv(
const string& type_name_regexp,
597 const string& type_name,
598 bool consider_type_kind,
600 bool consider_reach_kind,
602 : type_name_regex_str_(type_name_regexp),
603 type_name_(type_name),
604 consider_type_kind_(consider_type_kind),
606 consider_reach_kind_(consider_reach_kind),
608 has_size_change_(
false),
609 has_strict_fam_conv_(
false)
623 if (!type_name_regex_ && !type_name_regex_str_.empty())
625 return type_name_regex_;
633 {type_name_regex_ = r;}
646 if (!type_name_not_regex_ && !type_name_not_regex_str_.empty())
648 return type_name_not_regex_;
656 {type_name_not_regex_ = r;}
665 {
return type_name_not_regex_str_;}
674 {type_name_not_regex_str_ = regex_str;}
682 if (!source_location_to_keep_regex_
683 && !source_location_to_keep_regex_str_.empty())
684 source_location_to_keep_regex_ =
686 return source_location_to_keep_regex_;
694 {source_location_to_keep_regex_ = r;}
705 if (!potential_data_members_regex_
706 && !potential_data_members_regex_str_.empty())
708 potential_data_members_regex_ =
711 return potential_data_members_regex_;
722 {potential_data_members_regex_ = r;}
729 const string& type_name);
734 const type_base_sptr& type);
742 const type_base_sptr& type);
746 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.
A declaration that introduces a scope.
Abstraction of the specification of a function parameter in a function suppression specification.
Abstraction of a function suppression specification.
vector< parameter_spec_sptr > parameter_specs_type
Convenience typedef for vector of parameter_spec_sptr.
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...
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.
Base type of a direct suppression specifications types.
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...
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.
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...