libabigail
Loading...
Searching...
No Matches
abg-suppression-priv.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2// -*- Mode: C++ -*-
3//
4// Copyright (C) 2016-2026 Red Hat, Inc.
5//
6// Author: Dodji Seketeli
7
8/// @file
9///
10/// This contains the private implementation of the suppression engine
11/// of libabigail.
12
13#ifndef __ABG_SUPPRESSION_PRIV_H__
14#define __ABG_SUPPRESSION_PRIV_H__
15
16#include <atomic>
17#include <mutex>
18
19#include "abg-fwd.h"
20#include "abg-regex.h"
21#include "abg-sptr-utils.h"
22#include "abg-suppression.h"
23
24namespace abigail
25{
26
27namespace suppr
28{
29
30using std::mutex;
31using std::lock_guard;
32using std::atomic;
33
34// <suppression_base stuff>
35
36/// The private data of @ref suppression_base.
38{
39 mutable mutex mutex_;
40 std::atomic<bool> is_artificial_;
41 std::atomic<bool> drops_artifact_;
42 string label_;
43 string file_name_regex_str_;
44 mutable regex::regex_t_sptr file_name_regex_;
45 string file_name_not_regex_str_;
46 mutable regex::regex_t_sptr file_name_not_regex_;
47 string soname_regex_str_;
48 mutable regex::regex_t_sptr soname_regex_;
49 string soname_not_regex_str_;
50 mutable regex::regex_t_sptr soname_not_regex_;
51
52public:
53 priv()
54 : is_artificial_(),
55 drops_artifact_()
56 {}
57
58 priv(const string& label)
59 : is_artificial_(),
60 drops_artifact_(),
61 label_(label)
62 {}
63
64 priv(const string& label,
65 const string& file_name_regex_str,
66 const string& file_name_not_regex_str)
67 : is_artificial_(),
68 drops_artifact_(),
69 label_(label),
70 file_name_regex_str_(file_name_regex_str),
71 file_name_not_regex_str_(file_name_not_regex_str)
72 {}
73
74 friend class suppression_base;
75
76 /// Get the regular expression object associated to the 'file_name_regex'
77 /// property of @ref suppression_base.
78 ///
79 /// If the regular expression object is not created, this method
80 /// creates it and returns it.
81 ///
82 /// If the 'file_name_regex' property of @ref suppression_base is
83 /// empty then this method returns nil.
86 {
87 lock_guard<mutex> lock(mutex_);
88 if (!file_name_regex_ && !file_name_regex_str_.empty())
89 file_name_regex_ = regex::compile(file_name_regex_str_);
90 return file_name_regex_;
91 }
92
93 /// Get the regular expression object associated to the
94 /// 'file_name_not_regex' property of @ref suppression_base.
95 ///
96 /// If the regular expression object is not created, this method
97 /// creates it and returns it.
98 ///
99 /// If the 'file_name_not_regex' property of @ref suppression_base
100 /// is empty then this method returns nil.
103 {
104 lock_guard<mutex> lock(mutex_);
105 if (!file_name_not_regex_ && !file_name_not_regex_str_.empty())
106 file_name_not_regex_ = regex::compile(file_name_not_regex_str_);
107 return file_name_not_regex_;
108 }
109
110 /// Get the regular expression object associated to the
111 /// 'soname_regex' property of @ref suppression_base.
112 ///
113 /// If the regular expression object is not created, this method
114 /// creates it and returns it.
115 ///
116 /// If the 'soname_regex' property of @ref suppression_base is empty
117 /// then this method returns nil.
120 {
121 lock_guard<mutex> lock(mutex_);
122 if (!soname_regex_ && !soname_regex_str_.empty())
123 soname_regex_ = regex::compile(soname_regex_str_);
124 return soname_regex_;
125 }
126
127 /// Get the regular expression object associated to the
128 /// 'soname_not_regex' property of @ref suppression_base.
129 ///
130 /// If the regular expression object is not created, this method
131 /// creates it and returns it.
132 ///
133 /// If the 'soname_not_regex' property of @ref suppression_base is
134 /// empty then this method returns nil.
137 {
138 lock_guard<mutex> lock(mutex_);
139 if (!soname_not_regex_ && !soname_not_regex_str_.empty())
140 soname_not_regex_ = regex::compile(soname_not_regex_str_);
141 return soname_not_regex_;
142 }
143
144 /// Test if the current suppression matches a given SONAME.
145 ///
146 /// @param soname the SONAME to consider.
147 ///
148 /// @return true iff the suppression matches the SONAME denoted by
149 /// @p soname.
150 ///
151 /// Note that if the suppression contains no property that is
152 /// related to SONAMEs, the function returns false.
153 bool
154 matches_soname(const string& soname) const
155 {
156 bool has_regexp = false;
158 {
159 has_regexp = true;
160 if (!regex::match(regexp, soname))
161 return false;
162 }
163
165 {
166 has_regexp = true;
167 if (regex::match(regexp, soname))
168 return false;
169 }
170
171 if (!has_regexp)
172 return false;
173
174 return true;
175 }
176
177 /// Test if the current suppression matches the full file path to a
178 /// given binary.
179 ///
180 /// @param binary_name the full path to the binary.
181 ///
182 /// @return true iff the suppression matches the path denoted by @p
183 /// binary_name.
184 ///
185 /// Note that if the suppression contains no property that is
186 /// related to file name, the function returns false.
187 bool
188 matches_binary_name(const string& binary_name) const
189 {
190 bool has_regexp = false;
191
193 {
194 has_regexp = true;
195 if (!regex::match(regexp, binary_name))
196 return false;
197 }
198
200 {
201 has_regexp = true;
202 if (regex::match(regexp, binary_name))
203 return false;
204 }
205
206 if (!has_regexp)
207 return false;
208
209 return true;
210 }
211
212}; // end clas suppression_base::priv
213
214// </suppression_base stuff>
215
216// <function_suppression stuff>
217
219{
221 friend class function_suppression;
222
223 mutable mutex mutex_;
224 size_t index_;
225 string type_name_;
226 string type_name_regex_str_;
227 mutable regex::regex_t_sptr type_name_regex_;
228
229 priv()
230 : index_()
231 {}
232
233 priv(size_t i, const string& tn)
234 : index_(i), type_name_(tn)
235 {}
236
237 priv(size_t i, const string& tn, const string& tn_regex)
238 : index_(i), type_name_(tn), type_name_regex_str_(tn_regex)
239 {}
240
242 get_type_name_regex() const
243 {
244 lock_guard<mutex> lock(mutex_);
245 if (!type_name_regex_ && !type_name_regex_str_.empty())
246 type_name_regex_ = regex::compile(type_name_regex_str_);
247 return type_name_regex_;
248 }
249}; // end class function_suppression::parameter_spec::priv
250
251
252/// The type of the private data of the @ref function_suppression
253/// type.
255{
256 friend class function_suppression;
257
258 mutable std::mutex mutex_;
259 change_kind change_kind_;
260 string name_;
261 string name_regex_str_;
262 mutable regex::regex_t_sptr name_regex_;
263 string name_not_regex_str_;
264 mutable regex::regex_t_sptr name_not_regex_;
265 string return_type_name_;
266 string return_type_regex_str_;
267 mutable regex::regex_t_sptr return_type_regex_;
268 parameter_specs_type parm_specs_;
269 string symbol_name_;
270 string symbol_name_regex_str_;
271 mutable regex::regex_t_sptr symbol_name_regex_;
272 string symbol_name_not_regex_str_;
273 mutable regex::regex_t_sptr symbol_name_not_regex_;
274 string symbol_version_;
275 string symbol_version_regex_str_;
276 mutable regex::regex_t_sptr symbol_version_regex_;
277 std::atomic<bool> allow_other_aliases_;
278
279 priv():
280 change_kind_(ALL_CHANGE_KIND),
281 allow_other_aliases_(true)
282 {}
283
284 priv(const string& name,
285 const string& name_regex_str,
286 const string& return_type_name,
287 const string& return_type_regex_str,
288 const parameter_specs_type& parm_specs,
289 const string& symbol_name,
290 const string& symbol_name_regex_str,
291 const string& symbol_version,
292 const string& symbol_version_regex_str)
293 : change_kind_(ALL_CHANGE_KIND),
294 name_(name),
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)
304 {}
305
306
307 /// Getter for a pointer to a regular expression object built from
308 /// the regular expression string
309 /// function_suppression::priv::name_regex_str_.
310 ///
311 /// If that string is empty, then an empty regular expression object
312 /// pointer is returned.
313 ///
314 /// @return a pointer to the regular expression object of
315 /// function_suppression::priv::name_regex_str_..
318 {
319 lock_guard<mutex> lock(mutex_);
320 if (!name_regex_ && !name_regex_str_.empty())
321 name_regex_ = regex::compile(name_regex_str_);
322 return name_regex_;
323 }
324
325 /// Getter for a pointer to a regular expression object built from
326 /// the regular expression string
327 /// function_suppression::priv::name_not_regex_str_.
328 ///
329 /// If that string is empty, then an empty regular expression object
330 /// pointer is returned.
331 ///
332 /// @return a pointer to the regular expression object of
333 /// function_suppression::priv::name_not_regex_str_..
336 {
337 lock_guard<mutex> lock(mutex_);
338 if (!name_not_regex_ && !name_not_regex_str_.empty())
339 name_not_regex_ = regex::compile(name_not_regex_str_);
340 return name_not_regex_;
341 }
342
343 /// Getter for a pointer to a regular expression object built from
344 /// the regular expression string
345 /// function_suppression::priv::return_type_regex_str_.
346 ///
347 /// If that string is empty, then an empty regular expression object
348 /// pointer is returned.
349 ///
350 /// @return a pointer to the regular expression object of
351 /// function_suppression::priv::return_type_regex_str_.
354 {
355 lock_guard<mutex> lock(mutex_);
356 if (!return_type_regex_ && !return_type_regex_str_.empty())
357 return_type_regex_ = regex::compile(return_type_regex_str_);
358 return return_type_regex_;
359 }
360
361 /// Getter for a pointer to a regular expression object built from
362 /// the regular expression string
363 /// function_suppression::priv::symbol_name_regex_str_.
364 ///
365 /// If that string is empty, then an empty regular expression object
366 /// pointer is returned.
367 ///
368 /// @return a pointer to the regular expression object of
369 /// function_suppression::priv::symbol_name_regex_str_.
372 {
373 lock_guard<mutex> lock(mutex_);
374 if (!symbol_name_regex_ && !symbol_name_regex_str_.empty())
375 symbol_name_regex_ = regex::compile(symbol_name_regex_str_);
376 return symbol_name_regex_;
377 }
378
379 /// Getter for a pointer to a regular expression object built from
380 /// the regular expression string
381 /// function_suppression::priv::symbol_name_not_regex_str_.
382 ///
383 /// If that string is empty, then an empty regular expression object
384 /// pointer is returned.
385 ///
386 /// @return a pointer to the regular expression object of
387 /// function_suppression::priv::symbol_name_not_regex_str_.
390 {
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_;
395 }
396
397 /// Getter for a pointer to a regular expression object built from
398 /// the regular expression string
399 /// function_suppression::priv::symbol_version_regex_str_.
400 ///
401 /// If that string is empty, then an empty regular expression object
402 /// pointer is returned.
403 ///
404 /// @return a pointer to the regular expression object of
405 /// function_suppression::priv::symbol_version_regex_str_.
408 {
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_;
413 }
414}; // end class function_suppression::priv
415
416bool
417suppression_matches_function_name(const suppr::function_suppression& s,
418 const string& fn_name);
419
420bool
421suppression_matches_function_sym_name(const suppr::function_suppression& s,
422 const string& fn_linkage_name);
423
424bool
426 const string& var_name);
427
428bool
430 const string& var_linkage_name);
431
432// <variable_suppression stuff>
433/// The type of the private data of the @ref variable_suppression
434/// type.
436{
437 friend class variable_suppression;
438
439 mutable mutex mutex_;
440 change_kind change_kind_;
441 string name_;
442 string name_regex_str_;
443 mutable regex::regex_t_sptr name_regex_;
444 string name_not_regex_str_;
445 mutable regex::regex_t_sptr name_not_regex_;
446 string symbol_name_;
447 string symbol_name_regex_str_;
448 mutable regex::regex_t_sptr symbol_name_regex_;
449 string symbol_name_not_regex_str_;
450 mutable regex::regex_t_sptr symbol_name_not_regex_;
451 string symbol_version_;
452 string symbol_version_regex_str_;
453 mutable regex::regex_t_sptr symbol_version_regex_;
454 string type_name_;
455 string type_name_regex_str_;
456 mutable regex::regex_t_sptr type_name_regex_;
457
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)
466 : change_kind_(ALL_CHANGE_KIND),
467 name_(name),
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)
475 {}
476
477 /// Getter for a pointer to a regular expression object built from
478 /// the regular expression string
479 /// variable_suppression::priv::name_regex_str_.
480 ///
481 /// If that string is empty, then an empty regular expression object
482 /// pointer is returned.
483 ///
484 /// @return a pointer to the regular expression object of
485 /// variable_suppression::priv::name_regex_str_.
488 {
489 lock_guard<mutex> lock(mutex_);
490 if (!name_regex_ && !name_regex_str_.empty())
491 name_regex_ = regex::compile(name_regex_str_);
492 return name_regex_;
493 }
494
495 /// Getter for a pointer to a regular expression object built from
496 /// the regular expression string
497 /// variable_suppression::priv::name_not_regex_str_.
498 ///
499 /// If that string is empty, then an empty regular expression object
500 /// pointer is returned.
501 ///
502 /// @return a pointer to the regular expression object of
503 /// variable_suppression::priv::name_not_regex_str_..
506 {
507 lock_guard<mutex> lock(mutex_);
508 if (!name_not_regex_ && !name_not_regex_str_.empty())
509 name_not_regex_ = regex::compile(name_not_regex_str_);
510 return name_not_regex_;
511 }
512
513 /// Getter for a pointer to a regular expression object built from
514 /// the regular expression string
515 /// variable_suppression::priv::symbol_name_regex_str_.
516 ///
517 /// If that string is empty, then an empty regular expression object
518 /// pointer is returned.
519 ///
520 /// @return a pointer to the regular expression object of
521 /// variable_suppression::priv::symbol_name_regex_str_.
524 {
525 lock_guard<mutex> lock(mutex_);
526 if (!symbol_name_regex_ && !symbol_name_regex_str_.empty())
527 symbol_name_regex_ = regex::compile(symbol_name_regex_str_);
528 return symbol_name_regex_;
529 }
530
531 /// Getter for a pointer to a regular expression object built from
532 /// the regular expression string
533 /// variable_suppression::priv::symbol_name_not_regex_str_.
534 ///
535 /// If that string is empty, then an empty regular expression object
536 /// pointer is returned.
537 ///
538 /// @return a pointer to the regular expression object of
539 /// variable_suppression::priv::symbol_name_not_regex_str_.
542 {
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_;
547 }
548
549 /// Getter for a pointer to a regular expression object built from
550 /// the regular expression string
551 /// variable_suppression::priv::symbol_version_regex_str_.
552 ///
553 /// If that string is empty, then an empty regular expression object
554 /// pointer is returned.
555 ///
556 /// @return a pointer to the regular expression object of
557 /// variable_suppression::priv::symbol_version_regex_str_.
560 {
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_;
565 }
566
567 /// Getter for a pointer to a regular expression object built from
568 /// the regular expression string
569 /// variable_suppression::priv::type_name_regex_str_.
570 ///
571 /// If that string is empty, then an empty regular expression object
572 /// pointer is returned.
573 ///
574 /// @return a pointer to the regular expression object of
575 /// variable_suppression::priv::type_name_regex_str_.
578 {
579 lock_guard<mutex> lock(mutex_);
580 if (!type_name_regex_ && !type_name_regex_str_.empty())
581 type_name_regex_ = regex::compile(type_name_regex_str_);
582 return type_name_regex_;
583 }
584};// end class variable_supppression::priv
585
586// </variable_suppression stuff>
587
588// <type_suppression stuff>
589/// The private data for @ref type_suppression.
591{
592 mutable std::mutex mutex_;
593 string type_name_regex_str_;
594 mutable regex::regex_t_sptr type_name_regex_;
595 string type_name_;
596 string type_name_not_regex_str_;
597 mutable regex::regex_t_sptr type_name_not_regex_;
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_;
603 // The data members a class needs to have to match this suppression
604 // specification. These might be selected by a regular expression.
605 string_set_type potential_data_members_;
606 // The regular expression string that selects the potential data
607 // members of the class.
608 string potential_data_members_regex_str_;
609 // The compiled regular expression that selects the potential data
610 // members of the class.
611 mutable regex::regex_t_sptr potential_data_members_regex_;
612 type_suppression::insertion_ranges insertion_ranges_;
613 unordered_set<string> source_locations_to_keep_;
614 string source_location_to_keep_regex_str_;
615 mutable regex::regex_t_sptr source_location_to_keep_regex_;
616 mutable vector<string> changed_enumerator_names_;
617 mutable vector<regex::regex_t_sptr> changed_enumerators_regexp_;
618 // Whether the "has_strict_flexible_array_data_member_conversion"
619 // property was set.
620 std::atomic<bool> has_strict_fam_conv_;
621
622 priv();
623
624public:
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),
634 type_kind_(type_kind),
635 consider_reach_kind_(consider_reach_kind),
636 reach_kind_(reach_kind),
637 has_size_change_(false),
638 has_strict_fam_conv_(false)
639 {}
640
641 /// Get the regular expression object associated to the 'type_name_regex'
642 /// property of @ref type_suppression.
643 ///
644 /// If the regular expression object is not created, this method
645 /// creates it and returns it.
646 ///
647 /// If the 'type_name_regex' property of @ref type_suppression is
648 /// empty then this method returns nil.
651 {
652 lock_guard<mutex> lock(mutex_);
653 if (!type_name_regex_ && !type_name_regex_str_.empty())
654 type_name_regex_ = regex::compile(type_name_regex_str_);
655 return type_name_regex_;
656 }
657
658 /// Setter for the type_name_regex object.
659 ///
660 /// @param r the new type_name_regex object.
661 void
663 {
664 lock_guard<mutex> lock(mutex_);
665 type_name_regex_ = r;
666 }
667
668 /// Get the regular expression object associated to the
669 /// 'type_name_not_regex' property of @ref type_suppression.
670 ///
671 /// If the regular expression object is not created, this method
672 /// creates it and returns it.
673 ///
674 /// If the 'type_name_not_regex' property of @ref type_suppression is
675 /// empty then this method returns nil.
678 {
679 lock_guard<mutex> lock(mutex_);
680 if (!type_name_not_regex_ && !type_name_not_regex_str_.empty())
681 type_name_not_regex_ = regex::compile(type_name_not_regex_str_);
682 return type_name_not_regex_;
683 }
684
685 /// Setter for the type_name_not_regex object.
686 ///
687 /// @param r the new type_name_not_regex object.
688 void
690 {
691 lock_guard<mutex> lock(mutex_);
692 type_name_not_regex_ = r;
693 }
694
695 /// Getter for the string that denotes the 'type_name_not_regex'
696 /// property.
697 ///
698 /// @return the value of the string value of the
699 /// 'type_name_not_regex' property.
700 const string&
702 {
703 lock_guard<mutex> lock(mutex_);
704 return type_name_not_regex_str_;
705 }
706
707 /// Setter for the string that denotes the 'type_name_not_regex'
708 /// property.
709 ///
710 /// @return the value of the string value of the
711 /// 'type_name_not_regex' property.
712 void
713 set_type_name_not_regex_str(const string regex_str)
714 {
715 lock_guard<mutex> lock(mutex_);
716 type_name_not_regex_str_ = regex_str;
717 }
718
719 /// Getter for the source_location_to_keep_regex object.
720 ///
721 /// This function builds the regex if it's not yet built.
724 {
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_ =
729 regex::compile(source_location_to_keep_regex_str_);
730 return source_location_to_keep_regex_;
731 }
732
733 /// Setter for the source_location_to_keep_regex object.
734 ///
735 /// @param r the new regex object.
736 void
738 {
739 lock_guard<mutex> lock(mutex_);
740 source_location_to_keep_regex_ = r;
741 }
742
743 /// Getter for the "potential_data_member_names_regex" object.
744 ///
745 /// This regex object matches the names of the data members that are
746 /// needed for this suppression specification to select the type.
747 ///
748 /// @return the "potential_data_member_names_regex" object.
751 {
752 lock_guard<mutex> lock(mutex_);
753 if (!potential_data_members_regex_
754 && !potential_data_members_regex_str_.empty())
755 {
756 potential_data_members_regex_ =
757 regex::compile(potential_data_members_regex_str_);
758 }
759 return potential_data_members_regex_;
760 }
761
762 /// Setter for the "potential_data_member_names_regex" object.
763 ///
764 /// This regex object matches the names of the data members that are
765 /// needed for this suppression specification to select the type.
766 ///
767 /// @param r the new "potential_data_member_names_regex" object.
768 void
770 {
771 lock_guard<mutex> lock(mutex_);
772 potential_data_members_regex_ = r;
773 }
774
775 friend class type_suppression;
776}; // class type_suppression::priv
777
778bool
780 const string& type_name);
781
782bool
784 scope_decl_sptr scope,
785 const type_base_sptr& type);
786
787bool
789 const location& loc);
790
791bool
793 const type_base_sptr& type);
794
795bool
797 const string& type_name,
798 const location& type_location);
799
800// </type_suppression stuff>
801
802}// end namespace suppr
803} // end namespace abigail
804
805#endif // __ABG_SUPPRESSION_PRIV_H__
Wrappers around regex types and functions.
Utilities to ease the wrapping of C types into std::shared_ptr.
The source location of a token.
Definition abg-ir.h:385
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.
Definition abg-fwd.h:265
bool match(const regex_t_sptr &r, const std::string &str)
See if a string matches a regex.
Definition abg-regex.cc:127
regex_t_sptr compile(const std::string &str)
Compile a regex from a string.
Definition abg-regex.cc:111
std::shared_ptr< regex_t > regex_t_sptr
A convenience typedef for a shared pointer of regex_t.
Definition abg-fwd.h:84
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...