libabigail
abg-ir.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) 2013-2025 Red Hat, Inc.
5 //
6 // Author: Dodji Seketeli
7 
8 /// @file
9 ///
10 /// Types of the main internal representation of libabigail.
11 ///
12 /// This internal representation abstracts the artifacts that make up
13 /// an application binary interface.
14 
15 #ifndef __ABG_IR_H__
16 #define __ABG_IR_H__
17 
18 #include <assert.h>
19 #include <stdint.h>
20 #include <cstdlib>
21 #include <functional>
22 #include <set>
23 #include <unordered_map>
24 #include "abg-cxx-compat.h"
25 #include "abg-fwd.h"
26 #include "abg-traverse.h"
27 #include "abg-config.h"
28 
29 /// @file
30 ///
31 /// This file contains the declarations of the Internal Representation
32 /// of libabigail.
33 
34 /// @defgroup Memory Memory management
35 /// @{
36 ///
37 /// How objects' lifetime is handled in libabigail.
38 ///
39 /// For memory management and garbage collection of libabigail's IR
40 /// artifacts, we use std::shared_ptr and std::weak_ptr.
41 ///
42 /// When manipulating these IR artifacts, there are a few rules to keep in
43 /// mind.
44 ///
45 /// <b>The declaration for a type is owned by only one scope </b>
46 ///
47 /// This means that for each instance of abigail::type_base (a type) there
48 /// is an instance of abigail::scope_decl that owns a @ref
49 /// abigail::decl_base_sptr (a shared pointer to an abigail::decl_base)
50 /// that points to the declaration of that type. The
51 /// abigail::type_base_sptr is added to the scope using the function
52 /// abigail::add_decl_to_scope().
53 ///
54 /// There is a kind of type that is usually not syntactically owned by
55 /// a scope: it's function type. In libabigail, function types are
56 /// represented by abigail::function_type and abigail::method_type.
57 /// These types must be owned by the translation unit they originate
58 /// from. Adding them to the translation unit must be done by a call
59 /// to the method function
60 /// abigail::translation::bind_function_type_life_time().
61 ///
62 /// <b> A declaration that has a type does NOT own the type </b>
63 ///
64 /// This means that, for instance, in an abigail::var_decl (a variable
65 /// declaration), the type of the declaration is not owned by the
66 /// declaration. In other (concrete) words, the variable declaration
67 /// doesn't have a shared pointer to the type. Rather, it has a *weak*
68 /// pointer to its type. That means that it has a data member of type
69 /// abigail::type_base_wptr that contains the type of the declaration.
70 ///
71 /// But then abigail::var_decl::get_type() returns a shared pointer that
72 /// is constructed from the internal weak pointer to the type. That way,
73 /// users of the type of the var can own a temporary reference on it and
74 /// be assured that the type's life time is long enough for their need.
75 ///
76 /// Likewise, data members, function and template parameters similarly
77 /// have weak pointers on their type.
78 ///
79 /// If, for a reason, you really need to keep a type alive for the
80 /// entire lifetime of the type system, then you can bind the life
81 /// time of that type to the life time of the @ref environment that is
82 /// supposed to outlive the type system. You do that by passing the
83 /// type to the function environment::keep_type_alive().
84 ///
85 /// @}
86 
87 namespace abigail
88 {
89 
90 /// The namespace of the internal representation of ABI artifacts like
91 /// types and decls.
92 namespace ir
93 {
94 
95 // Inject some std types in here.
96 using std::unordered_map;
97 
98 /// A convenience typedef for an unordered set of pointer values
99 typedef unordered_set<uintptr_t> pointer_set;
100 
101 /// The abstraction for an 8 bytes hash value.
102 ///
103 /// As this is an optional uint64_t value, it allows the represent
104 /// empty hash values.
106 
107 hash_t
109 
110 /// Functor to hash a canonical type by using its pointer value.
112 {
113  size_t operator()(const type_base_sptr& l) const;
114  size_t operator()(const type_base *l) const;
115 }; //end struct canonical_type_hash
116 
117 /// Helper typedef for an unordered set of type_base_sptr which uses
118 /// pointer value to tell its members appart, because the members are
119 /// canonical types.
120 typedef unordered_set<type_base_sptr,
122 
123 /// Helper typedef for a vector of pointer to type_base.
124 typedef vector<type_base*> type_base_ptrs_type;
125 
126 /// Helper typedef for a vector of shared pointer to a type_base.
127 typedef vector<type_base_sptr> type_base_sptrs_type;
128 
129 void
130 sort_types(const canonical_type_sptr_set_type& types,
131  vector<type_base_sptr>& result);
132 
133 /// This is an abstraction of the set of resources necessary to manage
134 /// several aspects of the internal representations of the Abigail
135 /// library.
136 ///
137 /// An environment can be seen as the boundaries in which all related
138 /// Abigail artifacts live. So before doing anything using this
139 /// library, the first thing to create is, well, you know it now, an
140 /// environment.
141 ///
142 /// Note that the lifetime of environment objects must be longer than
143 /// the lifetime of any other type in the Abigail system. So a given
144 /// instance of @ref environment must stay around as long as you are
145 /// using libabigail. It's only when you are done using the library
146 /// that you can de-allocate the environment instance.
148 {
149 public:
150  struct priv;
151  std::unique_ptr<priv> priv_;
152 
153  /// A convenience typedef for a map of canonical types. The key is
154  /// the pretty representation string of a particular type and the
155  /// value is the vector of canonical types that have the same pretty
156  /// representation string.
157  typedef std::unordered_map<string, std::vector<type_base_sptr> >
159 
160  environment();
161 
162  virtual ~environment();
163 
166 
168  get_canonical_types_map() const;
169 
170  const type_base_sptr&
171  get_void_type() const;
172 
173  const type_base_sptr&
174  get_void_pointer_type() const;
175 
176  const type_base_sptr&
178 
179  static string&
181 
182  bool
183  canonicalization_is_done() const;
184 
185  void
187 
188  bool
189  canonicalization_started() const;
190 
191  void
193 
194  bool
196 
197  void
198  decl_only_class_equals_definition(bool f) const;
199 
200  bool
201  is_void_type(const type_base_sptr&) const;
202 
203  bool
204  is_void_type(const type_base*) const;
205 
206  bool
207  is_void_pointer_type(const type_base_sptr&) const;
208 
209  bool
210  is_void_pointer_type(const type_base*) const;
211 
212  bool
214 
215  bool
216  is_variadic_parameter_type(const type_base_sptr&) const;
217 
219  intern(const string&) const;
220 
221  const config&
222  get_config() const;
223 
224  bool
226 
227  void
229 
230  bool
232 
233 #ifdef WITH_DEBUG_SELF_COMPARISON
234  void
235  set_self_comparison_debug_input(const corpus_sptr& corpus);
236 
237  void
238  get_self_comparison_debug_inputs(corpus_sptr& first_corpus,
239  corpus_sptr& second_corpus);
240 
241  void
242  self_comparison_debug_is_on(bool);
243 
244  bool
245  self_comparison_debug_is_on() const;
246 #endif
247 
248 #ifdef WITH_DEBUG_TYPE_CANONICALIZATION
249  void
250  debug_type_canonicalization_is_on(bool flag);
251 
252  bool
253  debug_type_canonicalization_is_on() const;
254 
255  void
256  debug_die_canonicalization_is_on(bool flag);
257 
258  bool
259  debug_die_canonicalization_is_on() const;
260 #endif
261 
262  const vector<type_base_sptr>* get_canonical_types(const char* name) const;
263 
264  type_base* get_canonical_type(const char* name, unsigned index);
265 
266 #ifdef WITH_DEBUG_SELF_COMPARISON
267  const unordered_map<string, uintptr_t>&
268  get_type_id_canonical_type_map() const;
269 
270  unordered_map<string, uintptr_t>&
271  get_type_id_canonical_type_map();
272 
273  const unordered_map<uintptr_t, string>&
274  get_pointer_type_id_map() const;
275 
276  unordered_map<uintptr_t, string>&
277  get_pointer_type_id_map();
278 
279  string
280  get_type_id_from_pointer(uintptr_t ptr) const;
281 
282  string
283  get_type_id_from_type(const type_base *ptr) const;
284 
285  uintptr_t
286  get_canonical_type_from_type_id(const char*) const;
287 #endif
288 
289  friend class class_or_union;
290  friend class class_decl;
291  friend class function_type;
292 
293  friend void keep_type_alive(type_base_sptr);
294 }; // end class environment
295 
296 class location_manager;
297 /// @brief The source location of a token.
298 ///
299 /// This represents the location of a token coming from a given
300 /// translation unit. This location is actually an abstraction of
301 /// cursor in the table of all the locations of all the tokens of the
302 /// translation unit. That table is managed by the @ref location_manager
303 /// type. To get the file path, line and column numbers associated to
304 /// a given instance of @ref location, you need to use the
305 /// location_manager::expand_location method.
306 class location
307 {
308  unsigned value_;
309  // The location manager to use to decode the value above. There is
310  // one location manager per translation unit, and the location
311  // manager's life time is managed by its translation unit.
312  location_manager* loc_manager_;
313  // Whether the location is artificial. Being artificial means that
314  // the location wasn't generated by the original emitter of the
315  // metadata (i.e, the compiler if the metadata is debug info). For
316  // instance, implicit location derived from the position of XML
317  // elements in the abixml file is represented as artificial
318  // locations.
319  bool is_artificial_;
320 
321  location(unsigned v, location_manager* m)
322  : value_(v), loc_manager_(m), is_artificial_(false)
323  {}
324 
325  /// Get the location manager to use to decode the value of this
326  /// location.
327  ///
328  /// @return the location manager for the current location value.
330  get_location_manager() const
331  {return loc_manager_;}
332 
333 public:
334 
335  /// Test if the location is artificial.
336  ///
337  /// Being artificial means that the location wasn't generated by the
338  /// original emitter of the metadata (i.e, the compiler if the
339  /// metadata is debug info). For instance, the implicit location
340  /// derived from the position of a given XML element in the abixml
341  /// file is represented as artificial locations. The same XML
342  /// element might carry a non-artificial (natural?) location that was
343  /// originally emitted by the compiler that generated the original
344  /// debug info the abixml file is derived from.
345  ///
346  /// @return true iff the location is artificial.
347  bool
349  {return is_artificial_;}
350 
351  /// Set the artificial-ness of the location.
352  ///
353  /// Being artificial means that the location wasn't generated by the
354  /// original emitter of the metadata (i.e, the compiler if the
355  /// metadata is debug info). For instance, the implicit location
356  /// derived from the position of a given XML element in the abixml
357  /// file is represented as artificial locations. The same XML
358  /// element might carry a non-artificial (natural?) location that
359  /// was originally emitted by the compiler that generated the
360  /// original debug info the abixml file is derived from.
361  ///
362  /// @param f the new artificial-ness state.
363  void
365  {is_artificial_ = f;}
366 
367  /// Copy constructor of the location.
368  ///
369  /// @param l the location to copy from.
370  location(const location& l)
371  : value_(l.value_),
372  loc_manager_(l.loc_manager_),
373  is_artificial_(l.is_artificial_)
374  {}
375 
376  /// Assignment operator of the location.
377  ///
378  /// @param l the location to assign to the current one.
379  location&
380  operator=(const location& l)
381  {
382  value_ = l.value_;
383  loc_manager_ = l.loc_manager_;
384  is_artificial_ = l.is_artificial_;
385  return *this;
386  }
387 
388  /// Default constructor for the @ref location type.
390  : value_(), loc_manager_(), is_artificial_()
391  {}
392 
393  /// Get the value of the location.
394  unsigned
395  get_value() const
396  {return value_;}
397 
398  /// Convert the location into a boolean.
399  ///
400  /// @return true iff the value of the location is different from
401  /// zero.
402  operator bool() const
403  {return !!value_;}
404 
405  /// Equality operator of the @ref location type.
406  ///
407  /// @param other the other location to compare against.
408  ///
409  /// @return true iff both locations are equal.
410  bool
411  operator==(const location &other) const
412  {return value_ == other.value_;}
413 
414  /// "Less than" operator of the @ref location type.
415  ///
416  /// @parm other the other location type to compare against.
417  ///
418  /// @return true iff the current instance is less than the @p other
419  /// one.
420  bool
421  operator<(const location &other) const
422  {return value_ < other.value_;}
423 
424  /// Expand the current location into a tripplet file path, line and
425  /// column number.
426  ///
427  /// @param path the output parameter this function sets the expanded
428  /// path to.
429  ///
430  /// @param line the output parameter this function sets the expanded
431  /// line number to.
432  ///
433  /// @param column the output parameter this function sets the
434  /// expanded column number to.
435  void
436  expand(std::string& path, unsigned& line, unsigned& column) const;
437 
438  string
439  expand(void) const;
440 
441  friend class location_manager;
442 }; // end class location
443 
444 /// @brief The entry point to manage locations.
445 ///
446 /// This type keeps a table of all the locations for tokens of a
447 /// given translation unit.
449 {
450  struct priv;
451  std::unique_ptr<priv> priv_;
452 
453 public:
454 
456 
457  ~location_manager();
458 
459  location
460  create_new_location(const std::string& fle, size_t lne, size_t col);
461 
462  void
463  expand_location(const location& location, std::string& path,
464  unsigned& line, unsigned& column) const;
465 };
466 
467 /// The base of an entity of the intermediate representation that is
468 /// to be traversed.
470 {
471  /// Traverse a given IR node and its children, calling an visitor on
472  /// each node.
473  ///
474  /// @param v the visitor to call on each traversed node.
475  ///
476  /// @return true if the all the IR node tree was traversed.
477  virtual bool
479 }; // end class ir_traversable_base
480 
481 /// The comparison functor for using instances of @ref
482 /// type_or_decl_base as values in a hash map or set.
484 {
485 
486  /// The function-call operator to compare the string representations
487  /// of two ABI artifacts.
488  ///
489  /// @param l the left hand side ABI artifact operand of the
490  /// comparison.
491  ///
492  /// @param r the right hand side ABI artifact operand of the
493  /// comparison.
494  ///
495  /// @return true iff the string representation of @p l equals the one
496  /// of @p r.
497  bool
499  {
500  string repr1 = get_pretty_representation(l);
501  string repr2 = get_pretty_representation(r);
502 
503  return repr1 == repr2;
504  }
505 
506  /// The function-call operator to compare the string representations
507  /// of two ABI artifacts.
508  ///
509  /// @param l the left hand side ABI artifact operand of the
510  /// comparison.
511  ///
512  /// @param r the right hand side ABI artifact operand of the
513  /// comparison.
514  ///
515  /// @return true iff the string representation of @p l equals the one
516  /// of @p r.
517  bool
519  const type_or_decl_base_sptr &r) const
520  {return operator()(l.get(), r.get());}
521 }; // end type_or_decl_equal
522 
523 /// The hashing functor for using instances of @ref type_or_decl_base
524 /// as values in a hash map or set.
526 {
527 
528  /// Function-call Operator to hash the string representation of an
529  /// ABI artifact.
530  ///
531  /// @param artifact the ABI artifact to hash.
532  ///
533  /// @return the hash value of the string representation of @p
534  /// artifact.
535  size_t
536  operator()(const type_or_decl_base *artifact) const
537  {
538  string repr = get_pretty_representation(artifact);
539  std::hash<string> do_hash;
540  return do_hash(repr);
541  }
542 
543  /// Function-call Operator to hash the string representation of an
544  /// ABI artifact.
545  ///
546  /// @param artifact the ABI artifact to hash.
547  ///
548  /// @return the hash value of the string representation of @p
549  /// artifact.
550  size_t
551  operator()(const type_or_decl_base_sptr& artifact) const
552  {return operator()(artifact.get());}
553 }; // end struct type_or_decl_hash
554 
555 
556 /// A convenience typedef for a hash set of type_or_decl_base_sptr
557 typedef unordered_set<type_or_decl_base_sptr,
560 
561 /// A convenience typedef for a hash set of const type_or_decl_base*
562 typedef unordered_set<const type_or_decl_base*,
563  type_or_decl_hash,
565 
566 /// A convenience typedef for a map which key is a string and which
567 /// value is a @ref type_base_wptr.
568 typedef unordered_map<string, type_base_wptr> string_type_base_wptr_map_type;
569 
570 /// A convenience typedef for a map which key is a string and which
571 /// value is a @ref type_base_sptr.
572 typedef unordered_map<string, type_base_sptr> string_type_base_sptr_map_type;
573 
574 /// A convenience typedef for a map which key is an @ref
575 /// interned_string and which value is a @ref type_base_wptr.
576 typedef unordered_map<interned_string, type_base_wptr, hash_interned_string>
578 
579 /// A convenience typedef for a map which key is an @ref
580 /// interned_string and which value is a @ref type_base_wptr.
581 typedef unordered_map<interned_string,
585 
586 typedef unordered_map<interned_string,
587  const function_decl*,
588  hash_interned_string> istring_function_decl_ptr_map_type;
589 
590 typedef unordered_map<interned_string,
592  hash_interned_string> istring_var_decl_ptr_map_type;
593 
594 /// This is a type that aggregates maps of all the kinds of types that
595 /// are supported by libabigail.
596 ///
597 /// For instance, the type_maps contains a map of string to basic
598 /// type, a map of string to class type, a map of string to union
599 /// types, etc. The key of a map entry is the pretty representation
600 /// of the type, and the value of the map entry is the type.
602 {
603  struct priv;
604  std::unique_ptr<priv> priv_;
605 
606 public:
607 
608  type_maps();
609 
610  ~type_maps();
611 
612  bool
613  empty() const;
614 
616  basic_types() const;
617 
619  basic_types();
620 
622  class_types() const;
623 
625  class_types();
626 
628  union_types();
629 
631  union_types() const;
632 
634  enum_types();
635 
637  enum_types() const;
638 
640  typedef_types();
641 
643  typedef_types() const;
644 
646  qualified_types();
647 
649  qualified_types() const;
650 
652  pointer_types();
653 
655  pointer_types() const;
656 
659 
661  ptr_to_mbr_types() const;
662 
664  reference_types();
665 
667  reference_types() const;
668 
670  array_types();
671 
673  array_types() const;
674 
676  subrange_types() const;
677 
679  subrange_types();
680 
682  function_types();
683 
685  function_types() const;
686 
687  const vector<type_base_wptr>&
688  get_types_sorted_by_name() const;
689 }; // end class type_maps;
690 
691 /// This is the abstraction of the set of relevant artefacts (types,
692 /// variable declarations, functions, templates, etc) bundled together
693 /// into a translation unit.
695 {
696  struct priv;
697  std::unique_ptr<priv> priv_;
698 
699  // Forbidden
700  translation_unit() = delete;
701 
702 public:
703  /// Convenience typedef for a shared pointer on a @ref global_scope.
704  typedef shared_ptr<scope_decl> global_scope_sptr;
705 
706  /// The language of the translation unit.
707  enum language
708  {
709  LANG_UNKNOWN = 0,
710  LANG_Cobol74,
711  LANG_Cobol85,
712  LANG_C89,
713  LANG_C99,
714  LANG_C11,
715  LANG_C17,
716  LANG_C23,
717  LANG_C,
718  LANG_C_plus_plus_03,
719  LANG_C_plus_plus_11,
720  LANG_C_plus_plus_14,
721  LANG_C_plus_plus_17,
722  LANG_C_plus_plus_20,
723  LANG_C_plus_plus_23,
724  LANG_C_plus_plus,
725  LANG_ObjC,
726  LANG_ObjC_plus_plus,
727  LANG_OCaml,
728  LANG_D,
729  LANG_Go,
730  LANG_Rust,
731  LANG_Zig,
732  LANG_Metal,
733  LANG_Fortran77,
734  LANG_Fortran90,
735  LANG_Fortran95,
736  LANG_Fortran18,
737  LANG_Fortran23,
738  LANG_Ada83,
739  LANG_Ada95,
740  LANG_Ada2005,
741  LANG_Ada2012,
742  LANG_Pascal83,
743  LANG_Modula2,
744  LANG_Java,
745  LANG_Kotlin,
746  LANG_C_sharp,
747  LANG_Python,
748  LANG_Ruby,
749  LANG_PLI,
750  LANG_UPC,
751  LANG_Mips_Assembler,
752  LANG_Assembly,
753  LANG_Crystal,
754  LANG_HIP,
755  LANG_Mojo,
756  LANG_GLSL,
757  LANG_GLSL_ES,
758  LANG_HLSL,
759  LANG_OpenCL_CPP,
760  LANG_CPP_for_OpenCL,
761  LANG_SYCL,
762  LANG_Odin,
763  LANG_P4,
764  LANG_Move,
765  LANG_Hylo
766  };
767 
768 public:
770  const std::string& path,
771  char address_size = 0);
772 
773  virtual ~translation_unit();
774 
775  const environment&
776  get_environment() const;
777 
778  language
779  get_language() const;
780 
781  void
783 
784  const std::string&
785  get_path() const;
786 
787  void
788  set_path(const string&);
789 
790  const std::string&
791  get_compilation_dir_path() const;
792 
793  void
794  set_compilation_dir_path(const std::string&);
795 
796  const std::string&
797  get_absolute_path() const;
798 
799  void
800  set_corpus(corpus*);
801 
802  const corpus*
803  get_corpus() const;
804 
805  corpus*
806  get_corpus();
807 
808  const scope_decl_sptr&
809  get_global_scope() const;
810 
813 
814  const type_maps&
815  get_types() const;
816 
817  type_maps&
818  get_types();
819 
820  const vector<function_type_sptr>&
821  get_live_fn_types() const;
822 
824  get_loc_mgr();
825 
826  const location_manager&
827  get_loc_mgr() const;
828 
829  bool
830  is_empty() const;
831 
832  char
833  get_address_size() const;
834 
835  void
836  set_address_size(char);
837 
838  bool
839  is_constructed() const;
840 
841  void
842  set_is_constructed(bool);
843 
844  bool
845  operator==(const translation_unit&) const;
846 
847  bool
848  operator!=(const translation_unit&) const;
849 
850  void
852 
853  virtual bool
855 
856  friend function_type_sptr
857  lookup_function_type_in_translation_unit(const function_type& t,
858  const translation_unit& tu);
859 
860  friend function_type_sptr
862  translation_unit& tu);
863 
864  friend type_base_sptr
865  synthesize_type_from_translation_unit(const type_base_sptr& type,
866  translation_unit& tu);
867 };//end class translation_unit
868 
869 /// A comparison functor to compare translation units based on their
870 /// absolute paths.
872 {
873  /// Compare two translations units based on their absolute paths.
874  ///
875  /// @param lhs the first translation unit to consider for the
876  /// comparison.
877  ///
878  /// @param rhs the second translatin unit to consider for the
879  /// comparison.
880  bool
882  const translation_unit_sptr& rhs) const
883  {return lhs->get_absolute_path() < rhs->get_absolute_path();}
884 }; // end struct shared_translation_unit_comp
885 
886 /// Convenience typedef for an ordered set of @ref
887 /// translation_unit_sptr.
888 typedef std::set<translation_unit_sptr,
890 
891 string
893 
896 
897 bool
899 
900 bool
902 
903 bool
905 
906 bool
908 
909 bool
910 operator==(const translation_unit_sptr&, const translation_unit_sptr&);
911 
912 bool
913 operator!=(const translation_unit_sptr&, const translation_unit_sptr&);
914 
915 /// Access specifier for class members.
917 {
918  no_access,
919  public_access,
920  protected_access,
921  private_access,
922 };
923 
925 /// A convenience typedef for a shared pointer to elf_symbol.
926 typedef shared_ptr<elf_symbol> elf_symbol_sptr;
927 
928 /// A convenience typedef for a weak pointer to elf_symbol.
929 typedef weak_ptr<elf_symbol> elf_symbol_wptr;
930 
931 /// Convenience typedef for a map which key is a string and which
932 /// value if the elf symbol of the same name.
933 typedef std::unordered_map<string, elf_symbol_sptr>
935 
936 /// Convenience typedef for a shared pointer to an
937 /// string_elf_symbol_sptr_map_type.
938 typedef shared_ptr<string_elf_symbol_sptr_map_type>
940 
941 /// Convenience typedef for a vector of elf_symbol
942 typedef std::vector<elf_symbol_sptr> elf_symbols;
943 
944 /// Convenience typedef for a map which key is a string and which
945 /// value is a vector of elf_symbol.
946 typedef std::unordered_map<string, elf_symbols>
948 
949 /// Convenience typedef for a shared pointer to
950 /// string_elf_symbols_map_type.
951 typedef shared_ptr<string_elf_symbols_map_type> string_elf_symbols_map_sptr;
952 
953 /// Abstraction of an elf symbol.
954 ///
955 /// This is useful when a given corpus has been read from an ELF file.
956 /// In that case, a given decl might be associated to its underlying
957 /// ELF symbol, if that decl is publicly exported in the ELF file. In
958 /// that case, comparing decls might involve comparing their
959 /// underlying symbols as well.
961 {
962 public:
963  /// The type of a symbol.
964  enum type
965  {
966  NOTYPE_TYPE = 0,
967  OBJECT_TYPE,
968  FUNC_TYPE,
969  SECTION_TYPE,
970  FILE_TYPE,
971  COMMON_TYPE,
972  TLS_TYPE,
973  GNU_IFUNC_TYPE
974  };
975 
976  /// The binding of a symbol.
977  enum binding
978  {
979  LOCAL_BINDING = 0,
980  GLOBAL_BINDING,
981  WEAK_BINDING,
982  GNU_UNIQUE_BINDING
983  };
984 
985  /// The visibility of the symbol.
987  {
988  DEFAULT_VISIBILITY,
989  PROTECTED_VISIBILITY,
990  HIDDEN_VISIBILITY,
991  INTERNAL_VISIBILITY,
992  };
993 
994  /// Inject the elf_symbol::version here.
995  class version;
996 
997 private:
998  struct priv;
999  std::unique_ptr<priv> priv_;
1000 
1001  elf_symbol();
1002 
1003  elf_symbol(const environment& e,
1004  size_t i,
1005  size_t s,
1006  const string& n,
1007  type t,
1008  binding b,
1009  bool d,
1010  bool c,
1011  const version& ve,
1012  visibility vi,
1013  bool is_in_ksymtab = false,
1014  const abg_compat::optional<uint32_t>& crc = {},
1015  const abg_compat::optional<std::string>& ns = {},
1016  bool is_suppressed = false);
1017 
1018  elf_symbol(const elf_symbol&);
1019 
1020  elf_symbol&
1021  operator=(const elf_symbol& s);
1022 
1023 public:
1024 
1025  static elf_symbol_sptr
1026  create(const environment& e,
1027  size_t i,
1028  size_t s,
1029  const string& n,
1030  type t,
1031  binding b,
1032  bool d,
1033  bool c,
1034  const version& ve,
1035  visibility vi,
1036  bool is_in_ksymtab = false,
1037  const abg_compat::optional<uint32_t>& crc = {},
1038  const abg_compat::optional<std::string>& ns = {},
1039  bool is_suppressed = false);
1040 
1041  const environment&
1042  get_environment() const;
1043 
1044  size_t
1045  get_index() const;
1046 
1047  void
1048  set_index(size_t);
1049 
1050  const string&
1051  get_name() const;
1052 
1053  void
1054  set_name(const string& n);
1055 
1056  type
1057  get_type() const;
1058 
1059  void
1060  set_type(type t);
1061 
1062  size_t
1063  get_size() const;
1064 
1065  void
1066  set_size(size_t);
1067 
1068  binding
1069  get_binding() const;
1070 
1071  void
1072  set_binding(binding b);
1073 
1074  version&
1075  get_version() const;
1076 
1077  void
1078  set_version(const version& v);
1079 
1080  void
1082 
1083  visibility
1084  get_visibility() const;
1085 
1086  bool
1087  is_defined() const;
1088 
1089  void
1090  is_defined(bool d);
1091 
1092  bool
1093  is_public() const;
1094 
1095  bool
1096  is_function() const;
1097 
1098  bool
1099  is_variable() const;
1100 
1101  bool
1102  is_in_ksymtab() const;
1103 
1104  void
1106 
1108  get_crc() const;
1109 
1110  void
1112 
1114  get_namespace() const;
1115 
1116  void
1118 
1119  bool
1120  is_suppressed() const;
1121 
1122  void
1123  set_is_suppressed(bool is_suppressed);
1124 
1125  const elf_symbol_sptr
1126  get_main_symbol() const;
1127 
1128  elf_symbol_sptr
1129  get_main_symbol();
1130 
1131  bool
1132  is_main_symbol() const;
1133 
1134  elf_symbol_sptr
1135  update_main_symbol(const std::string&);
1136 
1137  elf_symbol_sptr
1138  get_next_alias() const;
1139 
1140  bool
1141  has_aliases() const;
1142 
1143  int
1144  get_number_of_aliases() const;
1145 
1146  void
1147  add_alias(const elf_symbol_sptr&);
1148 
1149  bool
1150  is_common_symbol() const;
1151 
1152  bool
1154 
1155  elf_symbol_sptr
1156  get_next_common_instance() const;
1157 
1158  void
1159  add_common_instance(const elf_symbol_sptr&);
1160 
1161  const string&
1162  get_id_string() const;
1163 
1164  elf_symbol_sptr
1165  get_alias_from_name(const string& name) const;
1166 
1167  elf_symbol_sptr
1168  get_alias_which_equals(const elf_symbol& other) const;
1169 
1170  elf_symbol_sptr
1171  get_alias_with_default_symbol_version() const;
1172 
1173  string
1175  bool include_symbol_itself = true) const;
1176 
1177  string
1178  get_aliases_id_string(bool include_symbol_itself = true) const;
1179 
1180  static bool
1181  get_name_and_version_from_id(const string& id,
1182  string& name,
1183  string& ver);
1184 
1185  bool
1186  operator==(const elf_symbol&) const;
1187 
1188  bool
1189  does_alias(const elf_symbol&) const;
1190 }; // end class elf_symbol.
1191 
1192 std::ostream&
1193 operator<<(std::ostream& o, elf_symbol::type t);
1194 
1195 std::ostream&
1196 operator<<(std::ostream& o, elf_symbol::binding t);
1197 
1198 std::ostream&
1199 operator<<(std::ostream& o, elf_symbol::visibility t);
1200 
1201 bool
1203 
1204 bool
1206 
1207 bool
1209 
1210 bool
1212 
1213 bool
1215 
1216 bool
1217 operator==(const elf_symbol_sptr& lhs, const elf_symbol_sptr& rhs);
1218 
1219 bool
1220 operator!=(const elf_symbol_sptr& lhs, const elf_symbol_sptr& rhs);
1221 
1222 bool
1223 elf_symbols_alias(const elf_symbol& s1, const elf_symbol& s2);
1224 
1225 void
1226 compute_aliases_for_elf_symbol(const elf_symbol& symbol,
1227  const string_elf_symbols_map_type& symtab,
1228  vector<elf_symbol_sptr>& alias_set);
1229 
1230 /// The abstraction of the version of an ELF symbol.
1232 {
1233  struct priv;
1234  std::unique_ptr<priv> priv_;
1235 
1236 public:
1237  version();
1238 
1239  version(const string& v,
1240  bool is_default);
1241 
1242  version(const version& v);
1243 
1244  ~version();
1245 
1246  operator const string&() const;
1247 
1248  const string&
1249  str() const;
1250 
1251  void
1252  str(const string& s);
1253 
1254  bool
1255  is_default() const;
1256 
1257  void
1258  is_default(bool f);
1259 
1260  bool
1261  is_empty() const;
1262 
1263  bool
1264  operator==(const version& o) const;
1265 
1266  bool
1267  operator!=(const version& o) const;
1268 
1269  version&
1270  operator=(const version& o);
1271 };// end class elf_symbol::version
1272 
1274 /// A convenience typedef for shared pointers to @ref context_rel
1275 typedef shared_ptr<context_rel> context_rel_sptr;
1276 
1277 /// The abstraction of the relationship between an entity and its
1278 /// containing scope (its context). That relationship can carry
1279 /// properties like access rights (if the parent is a class_decl),
1280 /// etc.
1281 ///
1282 /// But importantly, this relationship carries a pointer to the
1283 /// actualy parent.
1285 {
1286 protected:
1287  scope_decl* scope_;
1288  enum access_specifier access_;
1289  bool is_static_;
1290 
1291 public:
1292  context_rel()
1293  : scope_(0),
1294  access_(no_access),
1295  is_static_(false)
1296  {}
1297 
1299  : scope_(s),
1300  access_(no_access),
1301  is_static_(false)
1302  {}
1303 
1305  access_specifier a,
1306  bool f)
1307  : scope_(s),
1308  access_(a),
1309  is_static_(f)
1310  {}
1311 
1312  scope_decl*
1313  get_scope() const
1314  {return scope_;}
1315 
1317  get_access_specifier() const
1318  {return access_;}
1319 
1320  void
1321  set_access_specifier(access_specifier a)
1322  {access_ = a;}
1323 
1324  bool
1325  get_is_static() const
1326  {return is_static_;}
1327 
1328  void
1329  set_is_static(bool s)
1330  {is_static_ = s;}
1331 
1332  void
1333  set_scope(scope_decl* s)
1334  {scope_ = s;}
1335 
1336  bool
1337  operator==(const context_rel& o)const
1338  {
1339  return (access_ == o.access_
1340  && is_static_ == o.is_static_);
1341  }
1342 
1343  /// Inequality operator.
1344  ///
1345  /// @param o the other instance of @ref context_rel to compare the
1346  /// current instance against.
1347  ///
1348  /// @return true iff the current instance of @ref context_rel is
1349  /// different from @p o.
1350  bool
1351  operator!=(const context_rel& o) const
1352  {return !operator==(o);}
1353 
1354  virtual ~context_rel();
1355 };// end class context_rel
1356 
1357 /// A bitfield that gives callers of abigail::ir::equals() some
1358 /// insight about how different two internal representation artifacts
1359 /// are.
1361 {
1362  NO_CHANGE_KIND = 0,
1363 
1364  /// This means that a given IR artifact has a local type change.
1366 
1367  /// This means that a given IR artifact has a local non-type change.
1368  /// That is a change that is carried by the artifact itself, not by
1369  /// its type.
1371 
1372  /// Testing (anding) against this mask means that a given IR artifact has
1373  /// local differences, with respect to the other artifact it was compared
1374  /// against. A local change is a change that is carried by the artifact
1375  /// itself (or its type), rather than by one off its sub-types.
1377 
1378  /// This means that a given IR artifact has changes in some of its
1379  /// sub-types, with respect to the other artifact it was compared
1380  /// against.
1382 };// end enum change_kind
1383 
1386 
1389 
1390 change_kind&
1392 
1393 change_kind&
1395 
1396 bool
1398  const decl_base& r,
1399  change_kind* k);
1400 
1401 bool
1402 equals(const decl_base&, const decl_base&, change_kind*);
1403 
1404 /// The base class of both types and declarations.
1405 class type_or_decl_base : public ir_traversable_base
1406 {
1407  struct priv;
1408  type_or_decl_base();
1409  type_or_decl_base(const type_or_decl_base&);
1410 
1411 public:
1412 
1413  /// This is a bitmap type which instance is meant to contain the
1414  /// runtime type of a given ABI artifact. Bits of the identifiers
1415  /// of the type of a given artifact as well as the types it inherits
1416  /// from are to be set to 1.
1418  {
1419  ABSTRACT_TYPE_OR_DECL,
1420  ABSTRACT_DECL_BASE = 1,
1421  ABSTRACT_SCOPE_DECL = 1 << 1,
1422  GLOBAL_SCOPE_DECL = 1 << 2,
1423  NAMESPACE_DECL = 1 << 3,
1424  VAR_DECL = 1 << 4,
1425  FUNCTION_DECL = 1 << 5,
1426  FUNCTION_PARAMETER_DECL = 1 << 6,
1427  METHOD_DECL = 1 << 7,
1428  TEMPLATE_DECL = 1 << 8,
1429  ABSTRACT_TYPE_BASE = 1 << 9,
1430  ABSTRACT_SCOPE_TYPE_DECL = 1 << 10,
1431  BASIC_TYPE = 1 << 11,
1432  SUBRANGE_TYPE = 1 << 12,
1433  QUALIFIED_TYPE = 1 << 13,
1434  POINTER_TYPE = 1 << 14,
1435  REFERENCE_TYPE = 1 << 15,
1436  POINTER_TO_MEMBER_TYPE = 1 << 16,
1437  ARRAY_TYPE = 1 << 17,
1438  ENUM_TYPE = 1 << 18,
1439  TYPEDEF_TYPE = 1 << 19,
1440  CLASS_TYPE = 1 << 20,
1441  UNION_TYPE = 1 << 21,
1442  FUNCTION_TYPE = 1 << 22,
1443  METHOD_TYPE = 1 << 23,
1444  }; // end enum type_or_decl_kind
1445 
1446  enum type_or_decl_kind
1447  kind() const;
1448 
1449 protected:
1450  void
1451  kind(enum type_or_decl_kind);
1452 
1453  const void*
1454  runtime_type_instance() const;
1455 
1456  void*
1458 
1459  void
1460  runtime_type_instance(void*);
1461 
1462  const void*
1463  type_or_decl_base_pointer() const;
1464 
1465  void*
1467 
1468  virtual hash_t
1469  hash_value() const;
1470 
1471  void
1472  set_hash_value(hash_t) const;
1473 
1474  type_or_decl_base&
1475  operator=(const type_or_decl_base&);
1476 
1477 public:
1478  mutable std::unique_ptr<priv> priv_;
1479 
1480  type_or_decl_base(const environment&,
1481  enum type_or_decl_kind k = ABSTRACT_TYPE_OR_DECL);
1482 
1483  virtual ~type_or_decl_base();
1484 
1485  bool
1486  get_is_artificial() const;
1487 
1488  void
1489  set_is_artificial(bool);
1490 
1491  const environment&
1492  get_environment() const;
1493 
1494  void
1496 
1497  location&
1498  get_artificial_location() const;
1499 
1500  bool
1501  has_artificial_location() const;
1502 
1503  const corpus*
1504  get_corpus() const;
1505 
1506  corpus*
1507  get_corpus();
1508 
1509  void
1511 
1512  const translation_unit*
1513  get_translation_unit() const;
1514 
1517 
1518  virtual bool
1520 
1521  virtual string
1522  get_pretty_representation(bool internal = false,
1523  bool qualified_name = true) const = 0;
1524 
1528 
1532 
1536 
1540 
1541  friend class_decl*
1542  is_class_type(const type_or_decl_base*);
1543 
1544  friend type_base*
1545  is_type(const type_or_decl_base*);
1546 
1547  friend decl_base*
1548  is_decl(const type_or_decl_base* d);
1549 
1550  friend hash_t
1551  peek_hash_value(const type_or_decl_base&);
1552 
1553  template<typename T>
1554  friend hash_t
1555  set_or_get_cached_hash_value(const T& type_or_decl);
1556 }; // end class type_or_decl_base
1557 
1561 
1565 
1569 
1573 
1574 bool
1575 operator==(const type_or_decl_base&, const type_or_decl_base&);
1576 
1577 bool
1578 operator==(const type_or_decl_base_sptr&, const type_or_decl_base_sptr&);
1579 
1580 bool
1581 operator!=(const type_or_decl_base_sptr&, const type_or_decl_base_sptr&);
1582 
1583 /// The base type of all declarations.
1584 class decl_base : public virtual type_or_decl_base
1585 {
1586  // Forbidden
1587  decl_base();
1588 
1589  struct priv;
1590 
1591 protected:
1592 
1593  const interned_string&
1594  peek_qualified_name() const;
1595 
1596  void
1598 
1599  void
1600  set_qualified_name(const interned_string&) const;
1601 
1602  const interned_string&
1604 
1605  void
1606  set_temporary_qualified_name(const interned_string&) const;
1607 
1608 public:
1609  // This is public because some internals of the library need to
1610  // update it. But it's opaque to client code anyway, so no big
1611  // deal. Also, it's not handled by a shared_ptr because accessing
1612  // the data members of the priv struct for this decl_base shows up
1613  // on performance profiles when dealing with big binaries with a lot
1614  // of types; dereferencing the shared_ptr involves locking of some
1615  // sort and that is slower than just dereferencing a pointer likere
1616  // here. There are other types for which the priv pointer is
1617  // managed using shared_ptr just fine, because those didn't show up
1618  // during our performance profiling.
1619  priv* priv_;
1620 
1621  /// Facility to hash instances of decl_base.
1622  struct hash;
1623 
1624  /// ELF visibility
1626  {
1627  VISIBILITY_NONE,
1628  VISIBILITY_DEFAULT,
1629  VISIBILITY_PROTECTED,
1630  VISIBILITY_HIDDEN,
1631  VISIBILITY_INTERNAL
1632  };
1633 
1634  /// ELF binding
1635  enum binding
1636  {
1637  BINDING_NONE,
1638  BINDING_LOCAL,
1639  BINDING_GLOBAL,
1640  BINDING_WEAK
1641  };
1642 
1643  virtual void
1645 
1646 protected:
1647  void
1648  set_context_rel(context_rel *c);
1649  decl_base(const decl_base&);
1650 
1651 public:
1652  decl_base(const environment& e,
1653  const string& name,
1654  const location& locus,
1655  const string& mangled_name = "",
1656  visibility vis = VISIBILITY_DEFAULT);
1657 
1658  decl_base(const environment& e,
1659  const interned_string& name,
1660  const location& locus,
1661  const interned_string& mangled_name = interned_string(),
1662  visibility vis = VISIBILITY_DEFAULT);
1663 
1664  decl_base(const environment&, const location&);
1665 
1666  const context_rel*
1667  get_context_rel() const;
1668 
1669  context_rel*
1670  get_context_rel();
1671 
1672  const interned_string&
1673  get_cached_pretty_representation(bool internal = false) const;
1674 
1675  virtual bool
1676  operator==(const decl_base&) const;
1677 
1678  virtual bool
1679  operator!=(const decl_base&) const;
1680 
1681  virtual bool
1683 
1684  virtual ~decl_base();
1685 
1686  virtual string
1687  get_pretty_representation(bool internal = false,
1688  bool qualified_name = true) const;
1689 
1690  virtual void
1691  get_qualified_name(interned_string& qualified_name,
1692  bool internal = false) const;
1693 
1694  virtual const interned_string&
1695  get_qualified_name(bool internal = false) const;
1696 
1697  virtual const interned_string&
1698  get_scoped_name() const;
1699 
1700  bool
1702 
1703  void
1705 
1706  const location&
1707  get_location() const;
1708 
1709  void
1710  set_location(const location& l);
1711 
1712  virtual const interned_string&
1713  get_name() const;
1714 
1715  const interned_string&
1716  get_qualified_parent_name() const;
1717 
1718  virtual void
1719  set_name(const string& n);
1720 
1721  bool
1722  get_is_anonymous() const;
1723 
1724  void
1725  set_is_anonymous(bool);
1726 
1727  bool
1728  get_has_anonymous_parent() const;
1729 
1730  bool
1732 
1734  get_naming_typedef() const;
1735 
1736  void
1738 
1739  const interned_string&
1740  get_linkage_name() const;
1741 
1742  virtual void
1743  set_linkage_name(const string& m);
1744 
1745  scope_decl*
1746  get_scope() const;
1747 
1748  visibility
1749  get_visibility() const;
1750 
1751  void
1753 
1754  const decl_base_sptr
1755  get_earlier_declaration() const;
1756 
1757  void
1758  set_earlier_declaration(const decl_base_sptr&);
1759 
1760  const decl_base_sptr
1762 
1763  void
1764  set_definition_of_declaration(const decl_base_sptr&);
1765 
1766  const decl_base*
1768 
1769  bool
1770  get_is_declaration_only() const;
1771 
1772  void
1773  set_is_declaration_only(bool f);
1774 
1775  friend bool
1776  equals(const decl_base&, const decl_base&, change_kind*);
1777 
1778  friend bool
1779  equals(const var_decl&, const var_decl&, change_kind*);
1780 
1781  friend bool
1783 
1784  friend bool
1786  const decl_base& r,
1787  change_kind* k);
1788 
1789  friend decl_base_sptr
1790  add_decl_to_scope(decl_base_sptr decl, scope_decl* scpe);
1791 
1792  friend void
1793  remove_decl_from_scope(decl_base_sptr);
1794 
1795  friend decl_base_sptr
1796  insert_decl_into_scope(decl_base_sptr,
1797  vector<shared_ptr<decl_base> >::iterator,
1798  scope_decl*);
1799 
1800  friend enum access_specifier
1802 
1803  friend enum access_specifier
1804  get_member_access_specifier(const decl_base_sptr& d);
1805 
1806  friend void
1808  access_specifier a);
1809 
1810  friend bool
1811  get_member_is_static(const decl_base& d);
1812 
1813  friend bool
1814  get_member_is_static(const decl_base_sptr& d);
1815 
1816  friend void
1817  set_member_is_static(const decl_base_sptr& d, bool s);
1818 
1819  friend void
1820  set_member_is_static(decl_base& d, bool s);
1821 
1822  friend bool
1823  get_member_function_is_virtual(const function_decl& f);
1824 
1825  friend class class_or_union;
1826  friend class class_decl;
1827  friend class scope_decl;
1828 };// end class decl_base
1829 
1830 bool
1831 operator==(const decl_base_sptr&, const decl_base_sptr&);
1832 
1833 bool
1834 operator!=(const decl_base_sptr&, const decl_base_sptr&);
1835 
1836 bool
1837 operator==(const type_base_sptr&, const type_base_sptr&);
1838 
1839 bool
1840 operator!=(const type_base_sptr&, const type_base_sptr&);
1841 
1842 std::ostream&
1843 operator<<(std::ostream&, decl_base::visibility);
1844 
1845 std::ostream&
1846 operator<<(std::ostream&, decl_base::binding);
1847 
1848 bool
1849 equals(const scope_decl&, const scope_decl&, change_kind*);
1850 
1851 /// A declaration that introduces a scope.
1852 class scope_decl : public virtual decl_base
1853 {
1854  struct priv;
1855  std::unique_ptr<priv> priv_;
1856 
1857 public:
1858 
1859  /// Convenience typedef for a vector of @ref decl_base_sptr.
1860  typedef std::vector<decl_base_sptr > declarations;
1861  /// Convenience typedef for a vector of @ref function_type_sptr.
1862  typedef std::vector<function_type_sptr > function_types;
1863  /// Convenience typedef for a vector of @ref scope_decl_sptr.
1864  typedef std::vector<scope_decl_sptr> scopes;
1865 
1866  scope_decl();
1867 
1868 protected:
1869  virtual decl_base_sptr
1870  add_member_decl(const decl_base_sptr& member);
1871 
1872  decl_base_sptr
1873  insert_member_decl(decl_base_sptr member, declarations::iterator before);
1874 
1875  virtual void
1876  remove_member_decl(decl_base_sptr member);
1877 
1878 public:
1879 
1880  scope_decl(const environment& env,
1881  const string& name, const location& locus,
1882  visibility vis = VISIBILITY_DEFAULT);
1883 
1884  scope_decl(const environment& env, location& l);
1885 
1886  virtual bool
1887  operator==(const decl_base&) const;
1888 
1889  const canonical_type_sptr_set_type&
1890  get_canonical_types() const;
1891 
1892  canonical_type_sptr_set_type&
1894 
1895  const type_base_sptrs_type&
1897 
1898  const declarations&
1899  get_member_decls() const;
1900 
1901  declarations&
1902  get_member_decls();
1903 
1904  const declarations&
1905  get_sorted_member_decls() const;
1906 
1907  virtual size_t
1909 
1910  virtual size_t
1912 
1913  virtual size_t
1915 
1916  scopes&
1918 
1919  const scopes&
1920  get_member_scopes() const;
1921 
1922  bool
1923  is_empty() const;
1924 
1925  bool
1926  find_iterator_for_member(const decl_base*, declarations::iterator&);
1927 
1928  bool
1929  find_iterator_for_member(const decl_base_sptr, declarations::iterator&);
1930 
1931  void
1932  insert_member_type(type_base_sptr t,
1933  declarations::iterator before);
1934 
1935  void
1936  add_member_type(type_base_sptr t);
1937 
1938  type_base_sptr
1939  add_member_type(type_base_sptr t, access_specifier a);
1940 
1941  void
1942  remove_member_type(type_base_sptr t);
1943 
1944  const type_base_sptrs_type&
1945  get_member_types() const;
1946 
1947  const type_base_sptrs_type&
1948  get_sorted_member_types() const;
1949 
1950  type_base_sptr
1951  find_member_type(const string& name) const;
1952 
1953  virtual bool
1955 
1956  virtual ~scope_decl();
1957 
1958  friend decl_base_sptr
1959  add_decl_to_scope(decl_base_sptr decl, scope_decl* scope);
1960 
1961  friend decl_base_sptr
1962  insert_decl_into_scope(decl_base_sptr decl,
1963  scope_decl::declarations::iterator before,
1964  scope_decl* scope);
1965 
1966  friend void
1967  remove_decl_from_scope(decl_base_sptr decl);
1968 };//end class scope_decl
1969 
1970 bool
1972 
1973 bool
1975 
1976 /// This abstracts the global scope of a given translation unit.
1977 ///
1978 /// Only one instance of this class must be present in a given
1979 /// translation_unit. That instance is implicitely created the first
1980 /// time translatin_unit::get_global_scope is invoked.
1981 class global_scope : public scope_decl
1982 {
1983  translation_unit* translation_unit_;
1984 
1986 
1987 public:
1988 
1989  friend class translation_unit;
1990 
1992  get_translation_unit() const
1993  {return translation_unit_;}
1994 
1995  virtual ~global_scope();
1996 };
1997 
1998 bool
1999 equals(const type_base&, const type_base&, change_kind*);
2000 
2001 /// An abstraction helper for type declarations
2002 class type_base : public virtual type_or_decl_base
2003 {
2004  struct priv;
2005 
2006 public:
2007  // This priv pointer is not handled by a shared_ptr because
2008  // accessing the data members of the priv struct for this type_base
2009  // shows up on performance profiles when dealing with big binaries
2010  // with a lot of types; dereferencing the shared_ptr involves
2011  // locking of some sort and that is slower than just dereferencing a
2012  // pointer likere here. There are other types for which the priv
2013  // pointer is managed using shared_ptr just fine, because those
2014  // didn't show up during our performance profiling.
2015  priv* priv_;
2016 
2017 private:
2018  // Forbid this.
2019  type_base();
2020 
2021  static type_base_sptr
2022  get_canonical_type_for(type_base_sptr);
2023 
2024 protected:
2025  virtual void
2027 
2028 public:
2029 
2030  struct hash;
2031 
2032  type_base(const environment& e, size_t s, size_t a);
2033 
2034  virtual hash_t
2035  hash_value() const;
2036 
2037  friend type_base_sptr canonicalize(type_base_sptr, bool, bool);
2038 
2039  type_base_sptr
2040  get_canonical_type() const;
2041 
2042  type_base*
2043  get_naked_canonical_type() const;
2044 
2045  const interned_string&
2046  get_cached_pretty_representation(bool internal = false) const;
2047 
2048  virtual bool
2049  operator==(const type_base&) const;
2050 
2051  virtual bool
2052  operator!=(const type_base&) const;
2053 
2054  virtual bool
2056 
2057  virtual ~type_base();
2058 
2059  virtual void
2060  set_size_in_bits(size_t);
2061 
2062  virtual size_t
2063  get_size_in_bits() const;
2064 
2065  virtual void
2066  set_alignment_in_bits(size_t);
2067 
2068  virtual size_t
2069  get_alignment_in_bits() const;
2070 };//end class type_base
2071 
2072 
2073 /// A predicate for deep equality of instances of
2074 /// type_base*
2076 {
2077  bool
2078  operator()(const type_base* l, const type_base* r) const
2079  {
2080  if (!!l != !!r)
2081  return false;
2082 
2083  if (l == r)
2084  return true;
2085 
2086  if (l)
2087  return *l == *r;
2088 
2089  return true;
2090  }
2091 };
2092 
2093 /// A predicate for deep equality of instances of
2094 /// shared_ptr<type_base>
2096 {
2097  bool
2098  operator()(const type_base_sptr l, const type_base_sptr r) const
2099  {
2100  if (!!l != !!r)
2101  return false;
2102 
2103  if (l.get() == r.get())
2104  return true;
2105 
2106  if (l)
2107  return *l == *r;
2108 
2109  return true;
2110  }
2111 };
2112 
2113 bool
2114 equals(const type_decl&, const type_decl&, change_kind*);
2115 
2116 /// A basic type declaration that introduces no scope.
2117 class type_decl : public virtual decl_base, public virtual type_base
2118 {
2119  // Forbidden.
2120  type_decl();
2121 
2122 public:
2123 
2124  /// Facility to hash instance of type_decl
2125  struct hash;
2126 
2127  type_decl(const environment& env,
2128  const string& name,
2129  size_t size_in_bits,
2130  size_t alignment_in_bits,
2131  const location& locus,
2132  const string& mangled_name = "",
2133  visibility vis = VISIBILITY_DEFAULT);
2134 
2135  virtual hash_t
2136  hash_value() const;
2137 
2138  virtual bool
2139  operator==(const type_base&) const;
2140 
2141  virtual bool
2142  operator==(const decl_base&) const;
2143 
2144  virtual bool
2145  operator==(const type_decl&) const;
2146 
2147  virtual bool
2148  operator!=(const type_base&)const;
2149 
2150  virtual bool
2151  operator!=(const decl_base&)const;
2152 
2153  virtual bool
2154  operator!=(const type_decl&)const;
2155 
2156  virtual void
2157  get_qualified_name(interned_string& qualified_name,
2158  bool internal = false) const;
2159 
2160  virtual const interned_string&
2161  get_qualified_name(bool internal = false) const;
2162 
2163  virtual string
2164  get_pretty_representation(bool internal = false,
2165  bool qualified_name = true) const;
2166 
2167  virtual bool
2169 
2170  virtual ~type_decl();
2171 };// end class type_decl.
2172 
2173 bool
2175 
2176 bool
2177 operator==(const type_decl_sptr&, const type_decl_sptr&);
2178 
2179 bool
2180 operator!=(const type_decl_sptr&, const type_decl_sptr&);
2181 
2182 /// A type that introduces a scope.
2183 class scope_type_decl : public scope_decl, public virtual type_base
2184 {
2185  scope_type_decl();
2186 
2187 public:
2188 
2189  scope_type_decl(const environment& env, const string& name,
2190  size_t size_in_bits, size_t alignment_in_bits,
2191  const location& locus, visibility vis = VISIBILITY_DEFAULT);
2192 
2193  virtual bool
2194  operator==(const decl_base&) const;
2195 
2196  virtual bool
2197  operator==(const type_base&) const;
2198 
2199  virtual bool
2201 
2202  virtual ~scope_type_decl();
2203 };
2204 
2205 /// The abstraction of a namespace declaration
2207 {
2208 public:
2209 
2210  namespace_decl(const environment& env, const string& name,
2211  const location& locus, visibility vis = VISIBILITY_DEFAULT);
2212 
2213  virtual string
2214  get_pretty_representation(bool internal = false,
2215  bool qualified_name = true) const;
2216 
2217  virtual bool
2218  operator==(const decl_base&) const;
2219 
2220  virtual bool
2222 
2223  virtual ~namespace_decl();
2224 
2226 };// end class namespace_decl
2227 
2228 /// A convenience typedef for vectors of @ref namespace_decl_sptr
2229 typedef vector<namespace_decl_sptr> namespaces_type;
2230 
2231 bool
2233 
2234 /// The abstraction of a qualified type.
2235 class qualified_type_def : public virtual type_base, public virtual decl_base
2236 {
2237  class priv;
2238  std::unique_ptr<priv> priv_;
2239 
2240  // Forbidden.
2242 
2243 protected:
2244  string build_name(bool, bool internal = false) const;
2245  virtual void on_canonical_type_set();
2246 
2247 public:
2248 
2249  /// A Hasher for instances of qualified_type_def
2250  struct hash;
2251 
2252  /// Bit field values representing the cv qualifiers of the
2253  /// underlying type.
2254  enum CV
2255  {
2256  CV_NONE = 0,
2257  CV_CONST = 1,
2258  CV_VOLATILE = 1 << 1,
2259  CV_RESTRICT = 1 << 2
2260  };
2261 
2262  qualified_type_def(type_base_sptr type, CV quals, const location& locus);
2263 
2264  qualified_type_def(const environment& env, CV quals, const location& locus);
2265 
2266  virtual hash_t
2267  hash_value() const;
2268 
2269  virtual size_t
2270  get_size_in_bits() const;
2271 
2272  virtual bool
2273  operator==(const decl_base&) const;
2274 
2275  virtual bool
2276  operator==(const type_base&) const;
2277 
2278  virtual bool
2279  operator==(const qualified_type_def&) const;
2280 
2281  CV
2282  get_cv_quals() const;
2283 
2284  void
2285  set_cv_quals(CV cv_quals);
2286 
2287  string
2289 
2290  type_base_sptr
2291  get_underlying_type() const;
2292 
2293  void
2294  set_underlying_type(const type_base_sptr&);
2295 
2296  virtual void
2297  get_qualified_name(interned_string& qualified_name,
2298  bool internal = false) const;
2299 
2300  virtual const interned_string&
2301  get_qualified_name(bool internal = false) const;
2302 
2303  virtual bool
2305 
2306  virtual ~qualified_type_def();
2307 }; // end class qualified_type_def.
2308 
2309 bool
2310 operator==(const qualified_type_def_sptr&, const qualified_type_def_sptr&);
2311 
2312 bool
2313 operator!=(const qualified_type_def_sptr&, const qualified_type_def_sptr&);
2314 
2317 
2320 
2323 
2326 
2329 
2330 std::ostream&
2331 operator<<(std::ostream&, qualified_type_def::CV);
2332 
2333 string
2335 
2336 interned_string
2337 get_name_of_qualified_type(const type_base_sptr& underlying_type,
2338  qualified_type_def::CV quals,
2339  bool qualified = true, bool internal = false);
2340 
2341 qualified_type_def_sptr
2342 lookup_qualified_type(const type_base_sptr&,
2344  const translation_unit&);
2345 bool
2347 
2348 /// The abstraction of a pointer type.
2349 class pointer_type_def : public virtual type_base, public virtual decl_base
2350 {
2351  struct priv;
2352  std::unique_ptr<priv> priv_;
2353 
2354  // Forbidden.
2355  pointer_type_def();
2356 
2357 protected:
2358  virtual void on_canonical_type_set();
2359 
2360 public:
2361 
2362  /// A hasher for instances of pointer_type_def
2363  struct hash;
2364 
2365  pointer_type_def(const type_base_sptr& pointed_to_type, size_t size_in_bits,
2366  size_t alignment_in_bits, const location& locus);
2367 
2368  pointer_type_def(const environment& env, size_t size_in_bits,
2369  size_t alignment_in_bits, const location& locus);
2370 
2371  virtual hash_t
2372  hash_value() const;
2373 
2374  void
2375  set_pointed_to_type(const type_base_sptr&);
2376 
2377  virtual bool
2378  operator==(const decl_base&) const;
2379 
2380  virtual bool
2381  operator==(const type_base&) const;
2382 
2383  bool
2384  operator==(const pointer_type_def&) const;
2385 
2386  const type_base_sptr
2387  get_pointed_to_type() const;
2388 
2389  type_base*
2390  get_naked_pointed_to_type() const;
2391 
2392  virtual void
2393  get_qualified_name(interned_string&, bool internal = false) const;
2394 
2395  virtual const interned_string&
2396  get_qualified_name(bool internal = false) const;
2397 
2398  virtual bool
2400 
2401  virtual ~pointer_type_def();
2402 }; // end class pointer_type_def
2403 
2404 bool
2406 
2407 bool
2409 
2410 bool
2412 
2413 
2414 /// Abstracts a reference type.
2415 class reference_type_def : public virtual type_base, public virtual decl_base
2416 {
2417  struct priv;
2418  std::unique_ptr<priv> priv_;
2419 
2420  // Forbidden.
2422 
2423 protected:
2424  virtual void on_canonical_type_set();
2425 
2426 public:
2427 
2428  /// Hasher for intances of reference_type_def.
2429  struct hash;
2430 
2431  reference_type_def(const type_base_sptr pointed_to_type,
2432  bool lvalue, size_t size_in_bits,
2433  size_t alignment_in_bits, const location& locus);
2434 
2435  reference_type_def(const environment& env, bool lvalue, size_t size_in_bits,
2436  size_t alignment_in_bits, const location& locus);
2437 
2438  virtual hash_t
2439  hash_value() const;
2440 
2441  void
2442  set_pointed_to_type(type_base_sptr& pointed_to_type);
2443 
2444  virtual bool
2445  operator==(const decl_base&) const;
2446 
2447  virtual bool
2448  operator==(const type_base&) const;
2449 
2450  bool
2451  operator==(const reference_type_def&) const;
2452 
2453  type_base_sptr
2454  get_pointed_to_type() const;
2455 
2456  bool
2457  is_lvalue() const;
2458 
2459  virtual void
2460  get_qualified_name(interned_string& qualified_name,
2461  bool internal = false) const;
2462 
2463  virtual const interned_string&
2464  get_qualified_name(bool internal = false) const;
2465 
2466  virtual string
2467  get_pretty_representation(bool internal = false,
2468  bool qualified_name = true) const;
2469 
2470  virtual bool
2472 
2473  virtual ~reference_type_def();
2474 }; // end class reference_type_def
2475 
2476 bool
2478 
2479 bool
2481 
2482 /// The abstraction of a pointer-to-member type.
2483 class ptr_to_mbr_type : public virtual type_base,
2484  public virtual decl_base
2485 {
2486  struct priv;
2487  std::unique_ptr<priv> priv_;
2488 
2489  // Forbidden
2490  ptr_to_mbr_type() = delete;
2491 
2492  public:
2493 
2494  /// Hasher for instances of @ref ptr_to_mbr_type;
2495  struct hash;
2496 
2497  ptr_to_mbr_type(const environment& env,
2498  const type_base_sptr& member_type,
2499  const type_base_sptr& containing_type,
2500  size_t size_in_bits,
2501  size_t alignment_in_bits,
2502  const location& locus);
2503 
2504  virtual const interned_string&
2505  get_name() const;
2506 
2507  virtual hash_t
2508  hash_value() const;
2509 
2510  const type_base_sptr&
2511  get_member_type() const;
2512 
2513  const type_base_sptr&
2514  get_containing_type() const;
2515 
2516  bool
2517  operator==(const ptr_to_mbr_type&) const;
2518 
2519  virtual bool
2520  operator==(const type_base&) const;
2521 
2522  virtual bool
2523  operator==(const decl_base&) const;
2524 
2525  virtual void
2526  get_qualified_name(interned_string& qualified_name,
2527  bool internal = false) const;
2528 
2529  virtual const interned_string&
2530  get_qualified_name(bool internal = false) const;
2531 
2532  virtual bool
2534 
2535  virtual ~ptr_to_mbr_type();
2536 }; // end class ptr_to_mbr_type
2537 
2538 bool
2539 equals(const ptr_to_mbr_type&,
2540  const ptr_to_mbr_type&,
2541  change_kind*);
2542 
2543 bool
2545 
2546 /// The abstraction of an array type.
2547 class array_type_def : public virtual type_base, public virtual decl_base
2548 {
2549  struct priv;
2550  std::unique_ptr<priv> priv_;
2551 
2552  // Forbidden.
2553  array_type_def();
2554 
2555  void update_size();
2556 
2557 public:
2558 
2559  /// Hasher for intances of array_type_def.
2560  struct hash;
2561 
2563 
2564  /// Convenience typedef for a shared pointer on a @ref
2565  /// function_decl::subrange
2566  typedef shared_ptr<subrange_type> subrange_sptr;
2567 
2568  /// Convenience typedef for a vector of @ref subrange_sptr
2569  typedef std::vector<subrange_sptr> subranges_type;
2570 
2571  /// Abstraction for an array range type, like in Ada, or just for an
2572  /// array dimension like in C or C++.
2573  class subrange_type : public virtual type_base, public virtual decl_base
2574  {
2575  struct priv;
2576  std::unique_ptr<priv> priv_;
2577 
2578  // Forbidden.
2579  subrange_type();
2580  public:
2581 
2582  virtual ~subrange_type();
2583  /// This class is to hold the value of the bound of a subrange.
2584  /// The value can be either signed or unsigned, at least when it
2585  /// comes from DWARF. The class keeps the sign information, but
2586  /// allows users to access the value as signed or unsigned as they
2587  /// see fit.
2589  {
2590  public:
2591  enum signedness
2592  {
2593  UNSIGNED_SIGNEDNESS,
2594  SIGNED_SIGNEDNESS
2595  };
2596 
2597  private:
2598  signedness s_;
2599 
2600  public:
2601  union
2602  {
2603  uint64_t unsigned_;
2604  int64_t signed_;
2605  } v_;
2606  bound_value();
2607  bound_value(uint64_t);
2608  bound_value(int64_t);
2609  enum signedness get_signedness() const;
2610  void set_signedness(enum signedness s);
2611  int64_t get_signed_value() const;
2612  uint64_t get_unsigned_value();
2613  void set_unsigned(uint64_t v);
2614  void set_signed(int64_t v);
2615  bool operator==(const bound_value&) const;
2616  }; //end class bound_value
2617 
2618  /// Hasher for an instance of array::subrange
2619  struct hash;
2620 
2621  subrange_type(const environment& env,
2622  const string& name,
2623  bound_value lower_bound,
2624  bound_value upper_bound,
2625  const type_base_sptr& underlying_type,
2626  const location& loc,
2627  translation_unit::language l = translation_unit::LANG_C11);
2628 
2629  subrange_type(const environment& env,
2630  const string& name,
2631  bound_value lower_bound,
2632  bound_value upper_bound,
2633  const location& loc,
2634  translation_unit::language l = translation_unit::LANG_C11);
2635 
2636  subrange_type(const environment& env,
2637  const string& name,
2638  bound_value upper_bound,
2639  const location& loc,
2640  translation_unit::language l = translation_unit::LANG_C11);
2641 
2642  virtual hash_t
2643  hash_value() const;
2644 
2645  type_base_sptr
2646  get_underlying_type() const;
2647 
2648  void
2649  set_underlying_type(const type_base_sptr &);
2650 
2651  int64_t
2652  get_upper_bound() const;
2653 
2654  int64_t
2655  get_lower_bound() const;
2656 
2657  void
2658  set_upper_bound(int64_t ub);
2659 
2660  void
2661  set_lower_bound(int64_t lb);
2662 
2663  uint64_t
2664  get_length() const;
2665 
2666  bool
2667  is_non_finite() const;
2668 
2669  void
2670  is_non_finite(bool);
2671 
2673  get_language() const;
2674 
2675  virtual bool
2676  operator==(const decl_base&) const;
2677 
2678  virtual bool
2679  operator==(const type_base&) const;
2680 
2681  bool
2682  operator==(const subrange_type& o) const;
2683 
2684  bool
2685  operator!=(const decl_base& o) const;
2686 
2687  bool
2688  operator!=(const type_base& o) const;
2689 
2690  bool
2691  operator!=(const subrange_type& o) const;
2692 
2693  string
2694  as_string() const;
2695 
2696  static string
2697  vector_as_string(const vector<subrange_sptr>&);
2698 
2699  virtual string
2700  get_pretty_representation(bool internal = false,
2701  bool qualified_name = true) const;
2702 
2703  virtual bool
2705  }; // end class subrange_type
2706 
2707  array_type_def(const type_base_sptr type,
2708  const std::vector<subrange_sptr>& subs,
2709  const location& locus);
2710 
2711  array_type_def(const environment& env,
2712  const std::vector<subrange_sptr>& subs,
2713  const location& locus);
2714 
2715  virtual hash_t
2716  hash_value() const;
2717 
2719  get_language() const;
2720 
2721  virtual bool
2722  operator==(const decl_base&) const;
2723 
2724  virtual bool
2725  operator==(const type_base&) const;
2726 
2727  virtual void
2728  get_qualified_name(interned_string& qualified_name,
2729  bool internal = false) const;
2730 
2731  virtual const interned_string&
2732  get_qualified_name(bool internal = false) const;
2733 
2734  const type_base_sptr
2735  get_element_type() const;
2736 
2737  void
2738  set_element_type(const type_base_sptr& element_type);
2739 
2740  virtual void
2741  append_subranges(const std::vector<subrange_sptr>& subs);
2742 
2743  virtual int
2744  get_dimension_count() const;
2745 
2746  virtual bool
2747  is_non_finite() const;
2748 
2749  virtual string
2750  get_pretty_representation(bool internal = false,
2751  bool qualified_name = true) const;
2752 
2753  virtual string
2754  get_subrange_representation() const;
2755 
2756  virtual bool
2758 
2759  const location&
2760  get_location() const;
2761 
2762  const std::vector<subrange_sptr>&
2763  get_subranges() const;
2764 
2765  virtual ~array_type_def();
2766 
2767 }; // end class array_type_def
2768 
2770 is_subrange_type(const type_or_decl_base *type);
2771 
2773 is_subrange_type(const type_or_decl_base_sptr &type);
2774 
2775 bool
2778  change_kind*);
2779 
2780 bool
2782 
2783 /// Abstracts a declaration for an enum type.
2784 class enum_type_decl : public virtual type_base, public virtual decl_base
2785 {
2786  class priv;
2787  std::unique_ptr<priv> priv_;
2788 
2789  // Forbidden
2790  enum_type_decl();
2791 
2792 public:
2793 
2794  /// A hasher for an enum_type_decl.
2795  struct hash;
2796 
2797  /// Enumerator Datum.
2798  class enumerator;
2799 
2800  /// Convenience typedef for a list of @ref enumerator.
2801  typedef std::vector<enumerator> enumerators;
2802 
2803  /// Constructor of an enum type declaration.
2804  ///
2805  /// @param name the name of the enum
2806  ///
2807  /// @param locus the locus at which the enum appears in the source
2808  /// code.
2809  ///
2810  /// @param underlying_type the underlying type of the enum
2811  ///
2812  /// @param enms a list of enumerators for this enum.
2813  ///
2814  /// @param mangled_name the mangled name of the enum type.
2815  ///
2816  /// @param vis the visibility of instances of this type.
2817  enum_type_decl(const string& name,
2818  const location& locus,
2819  type_base_sptr underlying_type,
2820  enumerators& enms,
2821  const string& mangled_name = "",
2822  visibility vis = VISIBILITY_DEFAULT);
2823 
2824  virtual hash_t
2825  hash_value() const;
2826 
2827  type_base_sptr
2828  get_underlying_type() const;
2829 
2830  const enumerators&
2831  get_enumerators() const;
2832 
2833  const enumerators&
2834  get_sorted_enumerators() const;
2835 
2836  enumerators&
2837  get_enumerators();
2838 
2839  bool
2840  find_enumerator_by_value(int64_t value,
2841  enum_type_decl::enumerator& result);
2842 
2843  bool
2844  find_enumerator_by_name(const string& name,
2845  enum_type_decl::enumerator& result);
2846 
2847  virtual string
2848  get_pretty_representation(bool internal = false,
2849  bool qualified_name = true) const;
2850 
2851  virtual bool
2852  operator==(const decl_base&) const;
2853 
2854  virtual bool
2855  operator==(const type_base&) const;
2856 
2857  virtual bool
2859 
2860  virtual ~enum_type_decl();
2861 
2862  friend bool
2864  const enum_type_decl& r,
2865  change_kind* k);
2866 }; // end class enum_type_decl
2867 
2868 bool
2870 
2871 bool
2873 
2874 bool
2876  const enum_type_decl& r,
2877  change_kind* k);
2878 
2879 /// The abstraction of an enumerator
2881 {
2882  class priv;
2883  std::unique_ptr<priv> priv_;
2884 
2885 public:
2886 
2887  enumerator();
2888 
2889  ~enumerator();
2890 
2891  enumerator(const string& name, int64_t value);
2892 
2893  enumerator(const enumerator&);
2894 
2895  enumerator&
2896  operator=(const enumerator&);
2897 
2898  bool
2899  operator==(const enumerator& other) const;
2900 
2901  bool
2902  operator!=(const enumerator& other) const;
2903 
2904  const string&
2905  get_name() const;
2906 
2907  const string&
2908  get_qualified_name(bool internal = false) const;
2909 
2910  void
2911  set_name(const string& n);
2912 
2913  int64_t
2914  get_value() const;
2915 
2916  void
2917  set_value(int64_t v);
2918 
2920  get_enum_type() const;
2921 
2922  void
2924 }; // end class enum_type_def::enumerator
2925 
2926 bool
2928  const enum_type_decl &enom);
2929 
2930 bool
2931 equals(const typedef_decl&, const typedef_decl&, change_kind*);
2932 
2933 /// The abstraction of a typedef declaration.
2934 class typedef_decl : public virtual type_base, public virtual decl_base
2935 {
2936  struct priv;
2937  std::unique_ptr<priv> priv_;
2938 
2939  // Forbidden
2940  typedef_decl();
2941 
2942 public:
2943 
2944  /// Hasher for the typedef_decl type.
2945  struct hash;
2946 
2947  typedef_decl(const string& name,
2948  const type_base_sptr underlying_type,
2949  const location& locus,
2950  const string& mangled_name = "",
2951  visibility vis = VISIBILITY_DEFAULT);
2952 
2953  typedef_decl(const string& name,
2954  const environment& env,
2955  const location& locus,
2956  const string& mangled_name = "",
2957  visibility vis = VISIBILITY_DEFAULT);
2958 
2959  virtual hash_t
2960  hash_value() const;
2961 
2962  virtual size_t
2963  get_size_in_bits() const;
2964 
2965  virtual size_t
2966  get_alignment_in_bits() const;
2967 
2968  virtual bool
2969  operator==(const decl_base&) const;
2970 
2971  virtual bool
2972  operator==(const type_base&) const;
2973 
2974  virtual string
2975  get_pretty_representation(bool internal = false,
2976  bool qualified_name = true) const;
2977 
2978  type_base_sptr
2979  get_underlying_type() const;
2980 
2981  void
2982  set_underlying_type(const type_base_sptr&);
2983 
2984  virtual void
2985  get_qualified_name(interned_string& qualified_name,
2986  bool internal = false) const;
2987 
2988  virtual const interned_string&
2989  get_qualified_name(bool internal = false) const;
2990 
2991  virtual bool
2993 
2994  virtual ~typedef_decl();
2995 };// end class typedef_decl
2996 
2997 /// The abstraction for a data member context relationship. This
2998 /// relates a data member to its parent class.
2999 ///
3000 /// The relationship carries properties like the offset of the data
3001 /// member, if applicable.
3003 {
3004 protected:
3005  struct priv;
3006  std::unique_ptr<priv> priv_;
3007 
3008 public:
3009  dm_context_rel();
3010 
3012  bool is_laid_out,
3013  size_t offset_in_bits,
3014  access_specifier a,
3015  bool is_static);
3016 
3018 
3019  bool
3020  get_is_laid_out() const;
3021 
3022  void
3023  set_is_laid_out(bool f);
3024 
3025  size_t
3026  get_offset_in_bits() const;
3027 
3028  void
3029  set_offset_in_bits(size_t o);
3030 
3031  const var_decl*
3032  get_anonymous_data_member() const;
3033 
3034  void
3036 
3037  bool
3038  operator==(const dm_context_rel& o) const;
3039 
3040  bool
3041  operator!=(const dm_context_rel& o) const;
3042 
3043  virtual ~dm_context_rel();
3044 };// end class class_decl::dm_context_rel
3045 
3046 bool
3047 equals(const var_decl&, const var_decl&, change_kind*);
3048 
3049 bool
3051 
3052 bool
3054 
3055 bool
3057  const array_type_def_sptr& r);
3058 
3059 bool
3061 
3062 bool
3064  const pointer_type_def_sptr&);
3065 
3066 /// Abstracts a variable declaration.
3067 class var_decl : public virtual decl_base
3068 {
3069  struct priv;
3070  std::unique_ptr<priv> priv_;
3071 
3072  // Forbidden
3073  var_decl();
3074 
3075  virtual void
3076  set_scope(scope_decl*);
3077 
3078 public:
3079 
3080  /// Equality functor to compare pointers to variable_decl.
3081  struct ptr_equal;
3082 
3083  var_decl(const string& name,
3084  type_base_sptr type,
3085  const location& locus,
3086  const string& mangled_name,
3087  visibility vis = VISIBILITY_DEFAULT,
3088  binding bind = BINDING_NONE);
3089 
3090  virtual bool
3091  operator==(const decl_base&) const;
3092 
3093  const type_base_sptr
3094  get_type() const;
3095 
3096  void
3097  set_type(type_base_sptr&);
3098 
3099  const type_base*
3100  get_naked_type() const;
3101 
3102  binding
3103  get_binding() const;
3104 
3105  void
3106  set_binding(binding b);
3107 
3108  void
3109  set_symbol(const elf_symbol_sptr& sym);
3110 
3111  const elf_symbol_sptr&
3112  get_symbol() const;
3113 
3114  var_decl_sptr
3115  clone() const;
3116 
3117  interned_string
3118  get_id() const;
3119 
3120  virtual const interned_string&
3121  get_qualified_name(bool internal = false) const;
3122 
3123  virtual string
3124  get_pretty_representation(bool internal = false,
3125  bool qualified_name = true) const;
3126 
3127  string
3128  get_anon_dm_reliable_name(bool qualified = true) const;
3129 
3130  virtual bool
3132 
3133  virtual ~var_decl();
3134 
3135  friend void
3136  set_data_member_offset(var_decl_sptr m, uint64_t o);
3137 
3138  friend uint64_t
3139  get_data_member_offset(const var_decl_sptr m);
3140 
3141  friend uint64_t
3142  get_data_member_offset(const var_decl& m);
3143 
3144  friend uint64_t
3146 
3147  friend uint64_t
3148  get_absolute_data_member_offset(const var_decl_sptr& m);
3149 
3150  friend void
3151  set_data_member_is_laid_out(var_decl_sptr m, bool l);
3152 
3153  friend bool
3155 
3156  friend bool
3157  get_data_member_is_laid_out(const var_decl_sptr m);
3158 }; // end class var_decl
3159 
3160 bool
3161 equals(const function_decl&, const function_decl&, change_kind*);
3162 
3163 /// Abstraction for a function declaration.
3164 class function_decl : public virtual decl_base
3165 {
3166  struct priv;
3167  // This priv pointer is not handled by a shared_ptr because
3168  // accessing the data members of the priv struct for this
3169  // function_decl shows up on performance profiles when dealing with
3170  // big binaries with a lot of types; dereferencing the shared_ptr
3171  // involves locking of some sort and that is slower than just
3172  // dereferencing a pointer likere here. There are other types for
3173  // which the priv pointer is managed using shared_ptr just fine,
3174  // because those didn't show up during our performance profiling.
3175  priv* priv_;
3176 
3177 public:
3178 
3179  /// Equality functor to compare pointers to function_decl
3180  struct ptr_equal;
3181 
3182  /// Abstraction for the parameter of a function.
3183  class parameter;
3184 
3185  /// Convenience typedef for a shared pointer on a @ref
3186  /// function_decl::parameter
3187  typedef shared_ptr<parameter> parameter_sptr;
3188 
3189  /// Convenience typedef for a vector of @ref parameter_sptr
3190  typedef std::vector<parameter_sptr> parameters;
3191 
3192  function_decl(const string& name,
3194  bool declared_inline,
3195  const location& locus,
3196  const string& mangled_name,
3197  visibility vis,
3198  binding bind);
3199 
3200  function_decl(const string& name,
3201  type_base_sptr fn_type,
3202  bool declared_inline,
3203  const location& locus,
3204  const string& mangled_name = "",
3205  visibility vis = VISIBILITY_DEFAULT,
3206  binding bind = BINDING_GLOBAL);
3207 
3208  virtual string
3209  get_pretty_representation(bool internal = false,
3210  bool qualified_name = true) const;
3211 
3212  string
3213  get_pretty_representation_of_declarator (bool internal = false) const;
3214 
3215  const std::vector<parameter_sptr >&
3216  get_parameters() const;
3217 
3218  void
3219  append_parameter(parameter_sptr parm);
3220 
3221  void
3222  append_parameters(std::vector<parameter_sptr >& parms);
3223 
3224  parameters::const_iterator
3226 
3227  const function_type_sptr
3228  get_type() const;
3229 
3230  const function_type*
3231  get_naked_type() const;
3232 
3233  const type_base_sptr
3234  get_return_type() const;
3235 
3236  void
3237  set_type(const function_type_sptr& fn_type);
3238 
3239  void
3240  set_symbol(const elf_symbol_sptr& sym);
3241 
3242  const elf_symbol_sptr&
3243  get_symbol() const;
3244 
3245  bool
3246  is_declared_inline() const;
3247 
3248  void
3249  is_declared_inline(bool);
3250 
3251  binding
3252  get_binding() const;
3253 
3255  clone() const;
3256 
3257  virtual bool
3258  operator==(const decl_base& o) const;
3259 
3260  /// Return true iff the function takes a variable number of
3261  /// parameters.
3262  ///
3263  /// @return true if the function taks a variable number
3264  /// of parameters.
3265  bool
3266  is_variadic() const;
3267 
3268  interned_string
3269  get_id() const;
3270 
3271  virtual bool
3273 
3274  virtual ~function_decl();
3275 }; // end class function_decl
3276 
3277 bool
3279 
3280 bool
3282 
3283 bool
3284 function_decls_alias(const function_decl& f1, const function_decl& f2);
3285 
3286 bool
3288  const function_decl::parameter&,
3289  change_kind*);
3290 
3291 /// A comparison functor to compare pointer to instances of @ref
3292 /// type_or_decl_base.
3294 {
3295  /// Comparison operator for ABI artifacts.
3296  ///
3297  /// @param f the first ABI artifact to consider for the comparison.
3298  ///
3299  /// @param s the second ABI artifact to consider for the comparison.
3300  ///
3301  /// @return true iff @p f is lexicographically less than than @p s.
3302  bool
3303  operator()(const type_or_decl_base *f,
3304  const type_or_decl_base *s)
3305  {
3306  function_decl *f_fn = is_function_decl(f), *s_fn = is_function_decl(s);
3307  if (f_fn && s_fn)
3308  return function_decl_is_less_than(*f_fn, *s_fn);
3309 
3310  var_decl *f_var = is_var_decl(f), *s_var = is_var_decl(s);
3311  if (f_var && s_var)
3312  return get_name(f_var) < get_name(s_var);
3313 
3314  string l_repr = get_pretty_representation(f),
3315  r_repr = get_pretty_representation(s);
3316 
3317  return l_repr < r_repr;
3318  }
3319 
3320  /// Comparison operator for ABI artifacts.
3321  ///
3322  /// @param f the first ABI artifact to consider for the comparison.
3323  ///
3324  /// @param s the second ABI artifact to consider for the comparison.
3325  ///
3326  /// @return true iff @p f is lexicographically less than than @p s.
3327  bool
3328  operator()(const type_or_decl_base_sptr& f,
3329  const type_or_decl_base_sptr& s)
3330  {return operator()(f.get(), s.get());}
3331 }; // end struct type_or_decl_base_comp
3332 
3333 /// Abstraction of a function parameter.
3335 {
3336  struct priv;
3337  std::unique_ptr<priv> priv_;
3338 
3339 public:
3340 
3341  parameter(const type_base_sptr type,
3342  unsigned index,
3343  const string& name,
3344  const location& loc,
3345  bool variadic_marker = false);
3346 
3347  parameter(const type_base_sptr type,
3348  unsigned index,
3349  const string& name,
3350  const location& loc,
3351  bool variadic_marker,
3352  bool is_artificial);
3353 
3354  parameter(const type_base_sptr type,
3355  const string& name,
3356  const location& loc,
3357  bool variadic_marker = false,
3358  bool is_artificial = false);
3359 
3360  parameter(const type_base_sptr type,
3361  unsigned index = 0,
3362  bool variadic_marker = false);
3363 
3364  virtual ~parameter();
3365 
3366  const type_base_sptr
3367  get_type()const;
3368 
3369  interned_string
3370  get_type_name() const;
3371 
3372  const string
3374 
3375  interned_string
3376  get_name_id() const;
3377 
3378  unsigned
3379  get_index() const;
3380 
3381  void
3382  set_index(unsigned i);
3383 
3384  bool
3385  get_variadic_marker() const;
3386 
3387  bool
3388  operator==(const parameter& o) const;
3389 
3390  virtual bool
3391  operator==(const decl_base&) const;
3392 
3393  virtual bool
3395 
3396  virtual void
3397  get_qualified_name(interned_string& qualified_name,
3398  bool internal = false) const;
3399 
3400  virtual string
3401  get_pretty_representation(bool internal = false,
3402  bool qualified_name = true) const;
3403 }; // end class function_decl::parameter
3404 
3405 bool
3408 
3410 is_function_parameter(const type_or_decl_base*);
3411 
3413 is_function_parameter(const type_or_decl_base_sptr tod);
3414 
3415 bool
3416 equals(const function_type&, const function_type&, change_kind*);
3417 
3418 /// Abstraction of a function type.
3419 class function_type : public virtual type_base
3420 {
3421 protected:
3422  virtual void on_canonical_type_set();
3423 
3424 public:
3425  /// Hasher for an instance of function_type
3426  struct hash;
3427 
3428  /// Convenience typedef for a shared pointer on a @ref
3429  /// function_decl::parameter
3430  typedef shared_ptr<function_decl::parameter> parameter_sptr;
3431  /// Convenience typedef for a vector of @ref parameter_sptr
3432  typedef std::vector<parameter_sptr> parameters;
3433 
3434  struct priv;
3435  std::unique_ptr<priv> priv_;
3436 
3437 private:
3438  function_type();
3439 
3440 public:
3441 
3442  function_type(type_base_sptr return_type,
3443  const parameters& parms,
3444  size_t size_in_bits,
3445  size_t alignment_in_bits);
3446 
3447  function_type(type_base_sptr return_type,
3448  size_t size_in_bits,
3449  size_t alignment_in_bits);
3450 
3451  function_type(const environment& env,
3452  size_t size_in_bits,
3453  size_t alignment_in_bits);
3454 
3455  virtual hash_t
3456  hash_value() const;
3457 
3458  type_base_sptr
3459  get_return_type() const;
3460 
3461  void
3462  set_return_type(type_base_sptr t);
3463 
3464  const parameters&
3465  get_parameters() const;
3466 
3467  const parameter_sptr
3469 
3470  void
3471  set_parameters(const parameters &p);
3472 
3473  void
3474  append_parameter(parameter_sptr parm);
3475 
3476  bool
3477  is_variadic() const;
3478 
3479  parameters::const_iterator
3481 
3482  parameters::const_iterator
3483  get_first_parm() const;
3484 
3485  const interned_string&
3486  get_cached_name(bool internal = false) const;
3487 
3488  virtual bool
3489  operator==(const type_base&) const;
3490 
3491  virtual string
3492  get_pretty_representation(bool internal = false,
3493  bool qualified_name = true) const;
3494 
3495  virtual bool
3497 
3498  virtual ~function_type();
3499 
3500  friend bool
3501  equals(const function_type&, const function_type&, change_kind*);
3502 };//end class function_type
3503 
3504 /// Abstracts the type of a class member function.
3506 {
3507  struct priv;
3508  std::unique_ptr<priv> priv_;
3509 
3510  method_type();
3511 
3512 public:
3513 
3514  /// Hasher for intances of method_type
3515  struct hash;
3516 
3517  method_type(type_base_sptr return_type,
3518  class_or_union_sptr class_type,
3519  const std::vector<function_decl::parameter_sptr>& parms,
3520  bool is_const,
3521  size_t size_in_bits,
3522  size_t alignment_in_bits);
3523 
3524  method_type(type_base_sptr return_type,
3525  type_base_sptr class_type,
3526  const std::vector<function_decl::parameter_sptr>& parms,
3527  bool is_const,
3528  size_t size_in_bits,
3529  size_t alignment_in_bits);
3530 
3531  method_type(class_or_union_sptr class_type,
3532  bool is_const,
3533  size_t size_in_bits,
3534  size_t alignment_in_bits);
3535 
3536  method_type(const environment& env,
3537  size_t size_in_bits,
3538  size_t alignment_in_bits);
3539 
3540  virtual hash_t
3541  hash_value() const;
3542 
3543  class_or_union_sptr
3544  get_class_type() const;
3545 
3546  void
3547  set_class_type(const class_or_union_sptr& t);
3548 
3549  void set_is_const(bool);
3550 
3551  bool get_is_const() const;
3552 
3553  bool get_is_for_static_method() const;
3554 
3555  virtual ~method_type();
3556 
3557  virtual string
3558  get_pretty_representation(bool internal = false,
3559  bool qualified_name = true) const;
3560 
3561  friend interned_string
3562  get_method_type_name(const method_type& fn_type, bool internal);
3563 };// end class method_type.
3564 
3565 /// The base class of templates.
3566 class template_decl : public virtual decl_base
3567 {
3568  class priv;
3569  std::unique_ptr<priv> priv_;
3570 
3571  template_decl();
3572 
3573 public:
3574 
3575  template_decl(const environment& env,
3576  const string& name,
3577  const location& locus,
3578  visibility vis = VISIBILITY_DEFAULT);
3579 
3580  void
3582 
3583  const std::list<template_parameter_sptr>&
3584  get_template_parameters() const;
3585 
3586  virtual bool
3587  operator==(const decl_base& o) const;
3588 
3589  virtual bool
3590  operator==(const template_decl& o) const;
3591 
3592  virtual ~template_decl();
3593 };//end class template_decl
3594 
3595 /// Base class for a template parameter. Client code should use the
3596 /// more specialized type_template_parameter,
3597 /// non_type_template_parameter and template_template_parameter below.
3599 {
3600  class priv;
3601  std::unique_ptr<priv> priv_;
3602 
3603  // Forbidden
3605 
3606  public:
3607 
3608  template_parameter(unsigned index,
3609  template_decl_sptr enclosing_tdecl);
3610 
3611  virtual bool
3612  operator==(const template_parameter&) const;
3613 
3614  bool
3615  operator!=(const template_parameter&) const;
3616 
3617  unsigned
3618  get_index() const;
3619 
3620  const template_decl_sptr
3621  get_enclosing_template_decl() const;
3622 
3623  virtual ~template_parameter();
3624 };//end class template_parameter
3625 
3626 /// Abstracts a type template parameter.
3627 class type_tparameter : public template_parameter, public virtual type_decl
3628 {
3629  class priv;
3630  std::unique_ptr<priv> priv_;
3631 
3632  // Forbidden
3633  type_tparameter();
3634 
3635 public:
3636 
3637  type_tparameter(unsigned index,
3638  template_decl_sptr enclosing_tdecl,
3639  const string& name,
3640  const location& locus);
3641 
3642  virtual bool
3643  operator==(const type_base&) const;
3644 
3645  virtual bool
3646  operator==(const type_decl&) const;
3647 
3648  virtual bool
3649  operator==(const decl_base&) const;
3650 
3651  virtual bool
3652  operator==(const template_parameter&) const;
3653 
3654  virtual bool
3655  operator==(const type_tparameter&) const;
3656 
3657  virtual ~type_tparameter();
3658 };// end class type_tparameter.
3659 
3660 /// Abstracts non type template parameters.
3661 class non_type_tparameter : public template_parameter, public virtual decl_base
3662 {
3663  class priv;
3664  std::unique_ptr<priv> priv_;
3665 
3666  type_base_wptr type_;
3667 
3668  // Forbidden
3670 
3671 public:
3672 
3673  non_type_tparameter(unsigned index,
3674  template_decl_sptr enclosing_tdecl,
3675  const string& name,
3676  type_base_sptr type,
3677  const location& locus);
3678  virtual bool
3679  operator==(const decl_base&) const;
3680 
3681  virtual bool
3682  operator==(const template_parameter&) const;
3683 
3684  const type_base_sptr
3685  get_type() const;
3686 
3687  virtual ~non_type_tparameter();
3688 };// end class non_type_tparameter
3689 
3690 
3691 class template_tparameter;
3692 
3693 /// Abstracts a template template parameter.
3695 {
3696  class priv;
3697  std::unique_ptr<priv> priv_;
3698 
3699  // Forbidden
3701 
3702 public:
3703 
3704  template_tparameter(unsigned index,
3705  template_decl_sptr enclosing_tdecl,
3706  const string& name,
3707  const location& locus);
3708 
3709  virtual bool
3710  operator==(const type_base&) const;
3711 
3712  virtual bool
3713  operator==(const decl_base&) const;
3714 
3715  virtual bool
3716  operator==(const template_parameter&) const;
3717 
3718  virtual bool
3719  operator==(const template_decl&) const;
3720 
3721  virtual ~template_tparameter();
3722 };
3723 
3724 /// This abstracts a composition of types based on template type
3725 /// parameters. The result of the composition is a type that can be
3726 /// referred to by a template non-type parameter. Instances of this
3727 /// type can appear at the same level as template parameters, in the
3728 /// scope of a template_decl.
3729 class type_composition : public template_parameter, public virtual decl_base
3730 {
3731  class priv;
3732  std::unique_ptr<priv> priv_;
3733 
3734  type_composition();
3735 
3736 public:
3737  type_composition(unsigned index,
3738  template_decl_sptr tdecl,
3739  type_base_sptr composed_type);
3740 
3741  const type_base_sptr
3742  get_composed_type() const;
3743 
3744  void
3745  set_composed_type(type_base_sptr t);
3746 
3747  virtual ~type_composition();
3748 };
3749 
3750 /// Abstract a function template declaration.
3752 {
3753  class priv;
3754  std::unique_ptr<priv> priv_;
3755 
3756  // Forbidden
3757  function_tdecl();
3758 
3759 public:
3760 
3761  function_tdecl(const environment& env,
3762  const location& locus,
3763  visibility vis = VISIBILITY_DEFAULT,
3764  binding bind = BINDING_NONE);
3765 
3767  const location& locus,
3768  visibility vis = VISIBILITY_DEFAULT,
3769  binding bind = BINDING_NONE);
3770 
3771  virtual bool
3772  operator==(const decl_base&) const;
3773 
3774  virtual bool
3775  operator==(const template_decl&) const;
3776 
3777  virtual bool
3778  operator==(const function_tdecl&) const;
3779 
3780  void
3781  set_pattern(shared_ptr<function_decl> p);
3782 
3783  shared_ptr<function_decl>
3784  get_pattern() const;
3785 
3786  binding
3787  get_binding() const;
3788 
3789  virtual bool
3791 
3792  virtual ~function_tdecl();
3793 }; // end class function_tdecl.
3794 
3795 /// Abstract a class template.
3796 class class_tdecl : public template_decl, public scope_decl
3797 {
3798  class priv;
3799  std::unique_ptr<priv> priv_;
3800 
3801  // Forbidden
3802  class_tdecl();
3803 
3804 public:
3805 
3806  class_tdecl(const environment& env, const location& locus,
3807  visibility vis = VISIBILITY_DEFAULT);
3808 
3809  class_tdecl(class_decl_sptr pattern,
3810  const location& locus,
3811  visibility vis = VISIBILITY_DEFAULT);
3812 
3813  virtual bool
3814  operator==(const decl_base&) const;
3815 
3816  virtual bool
3817  operator==(const template_decl&) const;
3818 
3819  virtual bool
3820  operator==(const class_tdecl&) const;
3821 
3822  void
3824 
3825  shared_ptr<class_decl>
3826  get_pattern() const;
3827 
3828  virtual bool
3830 
3831  virtual ~class_tdecl();
3832 };// end class class_tdecl
3833 
3834 /// The base class for member types, data members and member
3835 /// functions. Its purpose is mainly to carry the access specifier
3836 /// (and possibly other properties that might be shared by all class
3837 /// members) for the member.
3839 {
3840 protected:
3841  enum access_specifier access_;
3842  bool is_static_;
3843 
3844 private:
3845  // Forbidden
3846  member_base();
3847 
3848 public:
3849  struct hash;
3850 
3851  member_base(access_specifier a, bool is_static = false)
3852  : access_(a), is_static_(is_static)
3853  {}
3854 
3855  /// Getter for the access specifier of this member.
3856  ///
3857  /// @return the access specifier for this member.
3860  {return access_;}
3861 
3862  /// Setter for the access specifier of this member.
3863  ///
3864  /// @param a the new access specifier.
3865  void
3867  {access_ = a;}
3868 
3869  /// @return true if the member is static, false otherwise.
3870  bool
3872  {return is_static_;}
3873 
3874  /// Set a flag saying if the parameter is static or not.
3875  ///
3876  /// @param f set to true if the member is static, false otherwise.
3877  void
3879  {is_static_ = f;}
3880 
3881  virtual bool
3882  operator==(const member_base& o) const;
3883 };// end class member_base
3884 
3885 /// Abstraction of the declaration of a method.
3886 class method_decl : public function_decl
3887 {
3888  method_decl();
3889 
3890  virtual void
3891  set_scope(scope_decl*);
3892 
3893 public:
3894 
3895  method_decl(const string& name, method_type_sptr type,
3896  bool declared_inline, const location& locus,
3897  const string& mangled_name = "",
3898  visibility vis = VISIBILITY_DEFAULT,
3899  binding bind = BINDING_GLOBAL);
3900 
3901  method_decl(const string& name,
3902  function_type_sptr type,
3903  bool declared_inline,
3904  const location& locus,
3905  const string& mangled_name = "",
3906  visibility vis = VISIBILITY_DEFAULT,
3907  binding bind = BINDING_GLOBAL);
3908 
3909  method_decl(const string& name, type_base_sptr type,
3910  bool declared_inline, const location& locus,
3911  const string& mangled_name = "",
3912  visibility vis = VISIBILITY_DEFAULT,
3913  binding bind = BINDING_GLOBAL);
3914 
3915  virtual void
3916  set_linkage_name(const string&);
3917 
3918  /// @return the type of the current instance of the
3919  /// method_decl.
3920  const method_type_sptr
3921  get_type() const;
3922 
3923  void
3924  set_type(const method_type_sptr fn_type)
3925  {function_decl::set_type(fn_type);}
3926 
3927  friend bool
3928  get_member_function_is_ctor(const function_decl&);
3929 
3930  friend void
3931  set_member_function_is_ctor(function_decl&, bool);
3932 
3933  friend void
3935 
3936  friend bool
3937  get_member_function_is_dtor(const function_decl&);
3938 
3939  friend void
3940  set_member_function_is_dtor(function_decl&, bool);
3941 
3942  friend void
3944 
3945  friend bool
3946  get_member_function_is_static(const function_decl&);
3947 
3948  friend void
3949  set_member_function_is_static(const function_decl&, bool);
3950 
3951  friend bool
3952  get_member_function_is_const(const function_decl&);
3953 
3954  friend void
3955  set_member_function_is_const(function_decl&, bool);
3956 
3957  friend void
3959 
3960  friend bool
3961  member_function_has_vtable_offset(const function_decl&);
3962 
3963  friend ssize_t
3964  get_member_function_vtable_offset(const function_decl&);
3965 
3966  virtual ~method_decl();
3967 };// end class method_decl
3968 
3969 bool
3970 operator==(const method_decl_sptr& l, const method_decl_sptr& r);
3971 
3972 bool
3973 operator!=(const method_decl_sptr& l, const method_decl_sptr& r);
3974 
3975 /// The base type of @ref class_decl and @ref union_decl
3977 {
3978 public:
3979  struct priv;
3980  priv *priv_;
3981 
3982 private:
3983  // Forbidden
3984  class_or_union();
3985 
3986 protected:
3987 
3988  virtual decl_base_sptr
3989  add_member_decl(const decl_base_sptr&);
3990 
3991  decl_base_sptr
3992  insert_member_decl(decl_base_sptr member);
3993 
3994  virtual void
3995  remove_member_decl(decl_base_sptr);
3996 
3997  void
3998  maybe_fixup_members_of_anon_data_member(var_decl_sptr& anon_dm);
3999 
4000 public:
4001  /// Hasher.
4002  struct hash;
4003 
4004  /// Convenience typedef
4005  /// @{
4006  typedef vector<type_base_sptr> member_types;
4007  typedef vector<var_decl_sptr> data_members;
4008  typedef vector<method_decl_sptr> member_functions;
4009  typedef unordered_map<ssize_t, member_functions> virtual_mem_fn_map_type;
4010  typedef unordered_map<string, method_decl*> string_mem_fn_ptr_map_type;
4011  typedef unordered_map<string, method_decl_sptr> string_mem_fn_sptr_map_type;
4012  /// @}
4013 
4014  class_or_union(const environment& env, const string& name,
4015  size_t size_in_bits, size_t align_in_bits,
4016  const location& locus, visibility vis,
4017  member_types& mbrs, data_members& data_mbrs,
4018  member_functions& member_fns);
4019 
4020  class_or_union(const environment& env, const string& name,
4021  size_t size_in_bits, size_t align_in_bits,
4022  const location& locus, visibility vis);
4023 
4024  class_or_union(const environment& env, const string& name,
4025  bool is_declaration_only = true);
4026 
4027  virtual hash_t
4028  hash_value() const;
4029 
4030  virtual void
4031  set_size_in_bits(size_t);
4032 
4033  virtual size_t
4034  get_size_in_bits() const;
4035 
4036  virtual size_t
4037  get_alignment_in_bits() const;
4038 
4039  virtual void
4040  set_alignment_in_bits(size_t);
4041 
4042  virtual size_t
4044 
4045  virtual size_t
4047 
4048  virtual size_t
4050 
4051  void
4052  add_data_member(var_decl_sptr v, access_specifier a,
4053  bool is_laid_out, bool is_static,
4054  size_t offset_in_bits);
4055 
4056  const data_members&
4057  get_data_members() const;
4058 
4059  const var_decl_sptr
4060  find_data_member(const string&) const;
4061 
4062  const var_decl_sptr
4063  find_data_member(const var_decl_sptr&) const;
4064 
4065  const var_decl_sptr
4066  find_anonymous_data_member(const var_decl_sptr&) const;
4067 
4068  const data_members&
4070 
4071  const data_members&
4072  get_static_data_members() const;
4073 
4074  void
4075  add_member_function(method_decl_sptr f,
4076  access_specifier a,
4077  bool is_static, bool is_ctor,
4078  bool is_dtor, bool is_const);
4079 
4080  void
4081  add_member_function(method_decl_sptr f,
4082  access_specifier a,
4083  bool is_virtual,
4084  size_t vtable_offset,
4085  bool is_static, bool is_ctor,
4086  bool is_dtor, bool is_const);
4087 
4088  const member_functions&
4089  get_member_functions() const;
4090 
4091  const method_decl*
4092  find_member_function(const string& mangled_name) const;
4093 
4094  method_decl*
4095  find_member_function(const string& mangled_name);
4096 
4097  method_decl_sptr
4098  find_member_function_sptr(const string& mangled_name);
4099 
4100  const method_decl*
4101  find_member_function_from_signature(const string& s) const;
4102 
4103  method_decl*
4104  find_member_function_from_signature(const string& s);
4105 
4106  void
4107  add_member_function_template(member_function_template_sptr);
4108 
4109  const member_function_templates&
4111 
4112  void
4113  add_member_class_template(member_class_template_sptr m);
4114 
4115  const member_class_templates&
4117 
4118  bool
4119  has_no_member() const;
4120 
4121  virtual bool
4122  operator==(const decl_base&) const;
4123 
4124  virtual bool
4125  operator==(const type_base&) const;
4126 
4127  virtual bool
4128  operator==(const class_or_union&) const;
4129 
4130  virtual bool
4132 
4133  virtual ~class_or_union();
4134 
4135  friend method_decl_sptr
4136  copy_member_function(class_or_union_sptr t,
4137  const method_decl*m);
4138 
4139  friend method_decl_sptr
4140  copy_member_function(class_or_union_sptr t,
4141  const method_decl_sptr& m);
4142 
4143  friend var_decl_sptr
4144  copy_member_variable(class_or_union_sptr t,
4145  const var_decl* variable);
4146 
4147  friend var_decl_sptr
4148  copy_member_variable(class_or_union_sptr t, const var_decl_sptr& variable);
4149 
4150  friend void
4151  fixup_virtual_member_function(method_decl_sptr method);
4152 
4153  friend void
4154  set_member_is_static(decl_base& d, bool s);
4155 
4156  friend bool
4157  equals(const class_or_union&, const class_or_union&, change_kind*);
4158 
4159  friend bool
4160  equals(const class_decl&, const class_decl&, change_kind*);
4161 
4162  friend class method_decl;
4163  friend class class_decl;
4164 }; // end class class_or_union
4165 
4166 bool
4167 operator==(const class_or_union_sptr& l, const class_or_union_sptr& r);
4168 
4169 bool
4170 operator!=(const class_or_union_sptr& l, const class_or_union_sptr& r);
4171 
4172 /// Abstracts a class declaration.
4174 {
4175  // Forbidden
4176  class_decl();
4177 
4178 protected:
4179 
4180  decl_base_sptr
4181  insert_member_decl(decl_base_sptr member);
4182 
4183 public:
4184  /// Hasher.
4185  struct hash;
4186 
4187  /// Forward declarations.
4188  class base_spec;
4189 
4190  /// Convenience typedef
4191  /// @{
4192  typedef shared_ptr<base_spec> base_spec_sptr;
4193  typedef vector<base_spec_sptr> base_specs;
4194 
4195  /// @}
4196 
4197 protected:
4198  virtual void
4200 
4201 private:
4202  struct priv;
4203  // This priv it's not handled by a shared_ptr because accessing the
4204  // data members of the priv struct for this class_decl shows up on
4205  // performance profiles when dealing with big binaries with a lot of
4206  // types; dereferencing the shared_ptr involves locking of some sort
4207  // and that is slower than just dereferencing a pointer likere here.
4208  // There are other types for which the priv pointer is managed using
4209  // shared_ptr just fine, because those didn't show up during our
4210  // performance profiling.
4211  priv * priv_;
4212 
4213 public:
4214 
4215  class_decl(const environment& env, const string& name,
4216  size_t size_in_bits, size_t align_in_bits,
4217  bool is_struct, const location& locus,
4218  visibility vis, base_specs& bases,
4219  member_types& mbrs, data_members& data_mbrs,
4220  member_functions& member_fns);
4221 
4222  class_decl(const environment& env, const string& name,
4223  size_t size_in_bits, size_t align_in_bits,
4224  bool is_struct, const location& locus,
4225  visibility vis, base_specs& bases,
4226  member_types& mbrs, data_members& data_mbrs,
4227  member_functions& member_fns, bool is_anonymous);
4228 
4229  class_decl(const environment& env, const string& name,
4230  size_t size_in_bits, size_t align_in_bits,
4231  bool is_struct, const location& locus, visibility vis);
4232 
4233  class_decl(const environment& env, const string& name,
4234  size_t size_in_bits, size_t align_in_bits,
4235  bool is_struct, const location& locus,
4236  visibility vis, bool is_anonymous);
4237 
4238  class_decl(const environment& env, const string& name, bool is_struct,
4239  bool is_declaration_only = true);
4240 
4241  virtual hash_t
4242  hash_value() const;
4243 
4244  virtual string
4245  get_pretty_representation(bool internal = false,
4246  bool qualified_name = true) const;
4247 
4248  void
4249  is_struct(bool f);
4250 
4251  bool
4252  is_struct() const;
4253 
4254  void
4255  add_base_specifier(shared_ptr<base_spec> b);
4256 
4257  const base_specs&
4258  get_base_specifiers() const;
4259 
4261  find_base_class(const string& qualified_name) const;
4262 
4263  const member_functions&
4264  get_virtual_mem_fns() const;
4265 
4267  get_virtual_mem_fns_map() const;
4268 
4269  void
4271 
4272  bool
4273  has_no_base_nor_member() const;
4274 
4275  bool
4277 
4278  bool
4279  has_virtual_bases() const;
4280 
4281  bool
4282  has_vtable() const;
4283 
4284  ssize_t
4285  get_biggest_vtable_offset() const;
4286 
4287  virtual bool
4288  operator==(const decl_base&) const;
4289 
4290  virtual bool
4291  operator==(const type_base&) const;
4292 
4293  virtual bool
4294  operator==(const class_or_union&) const;
4295 
4296  virtual bool
4297  operator==(const class_decl&) const;
4298 
4299  virtual bool
4301 
4302  virtual ~class_decl();
4303 
4304  friend var_decl_sptr
4305  copy_member_variable(class_decl_sptr t, const var_decl_sptr& variable);
4306 
4307  friend void
4308  fixup_virtual_member_function(method_decl_sptr method);
4309 
4310  friend void
4311  set_member_is_static(decl_base& d, bool s);
4312 
4313  friend bool
4314  equals(const class_decl&, const class_decl&, change_kind*);
4315 
4316  friend class method_decl;
4317  friend class class_or_union;
4318 };// end class class_decl
4319 
4320 bool
4321 equals(const class_decl&, const class_decl&, change_kind*);
4322 
4323 method_decl_sptr
4325  const method_decl_sptr& f);
4326 
4327 method_decl_sptr
4329  const method_decl* f);
4330 void
4331 fixup_virtual_member_function(method_decl_sptr method);
4332 
4333 enum access_specifier
4335 
4336 enum access_specifier
4337 get_member_access_specifier(const decl_base_sptr&);
4338 
4339 void
4342 
4343 void
4344 set_member_access_specifier(const decl_base_sptr&,
4346 
4347 std::ostream&
4348 operator<<(std::ostream&, access_specifier);
4349 
4350 bool
4351 operator==(const class_decl_sptr& l, const class_decl_sptr& r);
4352 
4353 bool
4354 operator!=(const class_decl_sptr& l, const class_decl_sptr& r);
4355 
4356 bool
4358  const class_decl::base_spec&,
4359  change_kind*);
4360 
4361 /// Abstraction of a base specifier in a class declaration.
4363  public virtual decl_base
4364 {
4365  struct priv;
4366  std::unique_ptr<priv> priv_;
4367 
4368  // Forbidden
4369  base_spec();
4370 
4371 public:
4372 
4373  /// Hasher.
4374  struct hash;
4375 
4377  long offset_in_bits = -1, bool is_virtual = false);
4378 
4379  base_spec(const type_base_sptr& base, access_specifier a,
4380  long offset_in_bits = -1, bool is_virtual = false);
4381 
4382  virtual hash_t
4383  hash_value() const;
4384 
4385  virtual ~base_spec();
4386 
4388  get_base_class() const;
4389 
4390  bool
4391  get_is_virtual() const;
4392 
4393  long
4394  get_offset_in_bits() const;
4395 
4396  virtual bool
4397  operator==(const decl_base&) const;
4398 
4399  virtual bool
4400  operator==(const member_base&) const;
4401 
4402  virtual bool
4404 };// end class class_decl::base_spec
4405 
4406 bool
4408  const class_decl::base_spec_sptr& r);
4409 
4410 bool
4412  const class_decl::base_spec_sptr& r);
4413 
4415 is_class_base_spec(type_or_decl_base*);
4416 
4418 is_class_base_spec(type_or_decl_base_sptr);
4419 
4420 /// Abstracts a union type declaration.
4422 {
4423  // Forbid
4424  union_decl();
4425 
4426 public:
4427 
4428  struct hash;
4429 
4430  union_decl(const environment& env, const string& name,
4431  size_t size_in_bits, const location& locus,
4432  visibility vis, member_types& mbrs,
4433  data_members& data_mbrs, member_functions& member_fns);
4434 
4435  union_decl(const environment& env, const string& name,
4436  size_t size_in_bits, const location& locus,
4437  visibility vis, member_types& mbrs,
4438  data_members& data_mbrs, member_functions& member_fns,
4439  bool is_anonymous);
4440 
4441  union_decl(const environment& env, const string& name,
4442  size_t size_in_bits, const location& locus,
4443  visibility vis);
4444 
4445  union_decl(const environment& env, const string& name,
4446  size_t size_in_bits, const location& locus,
4447  visibility vis, bool is_anonymous);
4448 
4449  union_decl(const environment& env, const string& name,
4450  bool is_declaration_only = true);
4451 
4452  virtual hash_t
4453  hash_value() const;
4454 
4455  virtual string
4456  get_pretty_representation(bool internal = false,
4457  bool qualified_name = true) const;
4458 
4459  virtual bool
4460  operator==(const decl_base&) const;
4461 
4462  virtual bool
4463  operator==(const type_base&) const;
4464 
4465  virtual bool
4466  operator==(const class_or_union&) const;
4467 
4468  virtual bool
4469  operator==(const union_decl&) const;
4470 
4471  virtual bool
4473 
4474  virtual ~union_decl();
4475 }; // union_decl
4476 
4477 bool
4478 equals(const union_decl&, const union_decl&, change_kind*);
4479 
4480 method_decl_sptr
4481 copy_member_function(union_decl_sptr union_type,
4482  const method_decl_sptr& f);
4483 
4484 method_decl_sptr
4485 copy_member_function(union_decl_sptr union_type,
4486  const method_decl* f);
4487 
4488 bool
4489 operator==(const union_decl_sptr& l, const union_decl_sptr& r);
4490 
4491 bool
4492 operator!=(const union_decl_sptr& l, const union_decl_sptr& r);
4493 
4494 /// Abstraction of a member function context relationship. This
4495 /// relates a member function to its parent class.
4497 {
4498 protected:
4499  bool is_virtual_;
4500  ssize_t vtable_offset_in_bits_;
4501  bool is_constructor_;
4502  bool is_destructor_;
4503  bool is_const_;
4504 
4505 public:
4507  : context_rel(),
4508  is_virtual_(false),
4509  vtable_offset_in_bits_(-1),
4510  is_constructor_(false),
4511  is_destructor_(false),
4512  is_const_(false)
4513  {}
4514 
4516  : context_rel(s),
4517  is_virtual_(false),
4518  vtable_offset_in_bits_(-1),
4519  is_constructor_(false),
4520  is_destructor_(false),
4521  is_const_(false)
4522  {}
4523 
4525  bool is_constructor,
4526  bool is_destructor,
4527  bool is_const,
4528  bool is_virtual,
4529  size_t vtable_offset_in_bits,
4530  access_specifier access,
4531  bool is_static)
4532  : context_rel(s, access, is_static),
4533  is_virtual_(is_virtual),
4534  vtable_offset_in_bits_(vtable_offset_in_bits),
4535  is_constructor_(is_constructor),
4536  is_destructor_(is_destructor),
4537  is_const_(is_const)
4538  {}
4539 
4540  bool
4541  is_virtual() const
4542  {return is_virtual_;}
4543 
4544  void
4545  is_virtual(bool is_virtual)
4546  {is_virtual_ = is_virtual;}
4547 
4548  /// Getter for the vtable offset property.
4549  ///
4550  /// This is the vtable offset of the member function of this
4551  /// relation.
4552  ///
4553  /// @return the vtable offset property of the relation.
4554  size_t
4556  {return vtable_offset_in_bits_;}
4557 
4558  /// Setter for the vtable offset property.
4559  ///
4560  /// This is the vtable offset of the member function of this
4561  /// relation.
4562  ///
4563  /// @partam s the new vtable offset.
4564  void
4565  vtable_offset(size_t s)
4566  {vtable_offset_in_bits_ = s;}
4567 
4568  /// Getter for the 'is-constructor' property.
4569  ///
4570  /// This tells if the member function of this relation is a
4571  /// constructor.
4572  ///
4573  /// @return the is-constructor property of the relation.
4574  bool
4576  {return is_constructor_;}
4577 
4578  /// Setter for the 'is-constructor' property.
4579  ///
4580  /// @param f the new value of the the property. Is true if this is
4581  /// for a constructor, false otherwise.
4582  void
4584  {is_constructor_ = f;}
4585 
4586  /// Getter for the 'is-destructor' property.
4587  ///
4588  /// Tells if the member function of this relation is a destructor.
4589  ///
4590  /// @return the is-destructor property of the relation;
4591  bool
4593  {return is_destructor_;}
4594 
4595  /// Setter for the 'is-destructor' property.
4596  ///
4597  /// @param f the new value of the property. Is true if this is for
4598  /// a destructor, false otherwise.
4599  void
4601  {is_destructor_ = f;}
4602 
4603  /// Getter for the 'is-const' property.
4604  ///
4605  /// Tells if the member function of this relation is a const member
4606  /// function.
4607  ///
4608  /// @return the 'is-const' property of the relation.
4609  bool
4610  is_const() const
4611  {return is_const_;}
4612 
4613  /// Setter for the 'is-const' property.
4614  ///
4615  /// @param f the new value of the property. Is true if this is for
4616  /// a const entity, false otherwise.
4617  void
4618  is_const(bool f)
4619  {is_const_ = f;}
4620 
4621  virtual ~mem_fn_context_rel();
4622 }; // end class mem_fn_context_rel
4623 
4624 method_decl*
4625 is_method_decl(const type_or_decl_base*);
4626 
4627 method_decl*
4628 is_method_decl(const type_or_decl_base&);
4629 
4630 method_decl_sptr
4631 is_method_decl(const type_or_decl_base_sptr&);
4632 
4633 const var_decl*
4634 lookup_data_member(const type_base* type,
4635  const char* dm_name);
4636 
4637 const var_decl_sptr
4638 lookup_data_member(const type_base_sptr& type,
4639  const var_decl_sptr& dm);
4640 
4643  unsigned parm_num);
4644 
4645 /// Abstract a member function template.
4646 class member_function_template : public member_base, public virtual decl_base
4647 {
4648  bool is_constructor_;
4649  bool is_const_;
4650  shared_ptr<function_tdecl> fn_tmpl_;
4651 
4652  // Forbiden
4654 
4655 public:
4656  /// Hasher.
4657  struct hash;
4658 
4660  access_specifier access, bool is_static,
4661  bool is_constructor, bool is_const)
4662  : type_or_decl_base(f->get_environment()),
4663  decl_base(f->get_environment(), f->get_name(), location()),
4664  member_base(access, is_static), is_constructor_(is_constructor),
4665  is_const_(is_const), fn_tmpl_(f)
4666  {}
4667 
4668  bool
4669  is_constructor() const
4670  {return is_constructor_;}
4671 
4672  bool
4673  is_const() const
4674  {return is_const_;}
4675 
4676  operator const function_tdecl& () const
4677  {return *fn_tmpl_;}
4678 
4680  as_function_tdecl() const
4681  {return fn_tmpl_;}
4682 
4683  virtual bool
4684  operator==(const member_base& o) const;
4685 
4686  virtual bool
4688 };// end class member_function_template
4689 
4690 bool
4691 operator==(const member_function_template_sptr& l,
4692  const member_function_template_sptr& r);
4693 
4694 bool
4695 operator!=(const member_function_template_sptr& l,
4696  const member_function_template_sptr& r);
4697 
4698 /// Abstracts a member class template template
4700  : public member_base,
4701  public virtual decl_base
4702 {
4703  shared_ptr<class_tdecl> class_tmpl_;
4704 
4705  // Forbidden
4707 
4708 public:
4709 
4710  /// Hasher.
4711  struct hash;
4712 
4714  access_specifier access, bool is_static)
4715  : type_or_decl_base(c->get_environment()),
4716  decl_base(c->get_environment(), c->get_name(), location()),
4717  member_base(access, is_static),
4718  class_tmpl_(c)
4719  {}
4720 
4721  operator const class_tdecl& () const
4722  { return *class_tmpl_; }
4723 
4725  as_class_tdecl() const
4726  {return class_tmpl_;}
4727 
4728  virtual bool
4729  operator==(const member_base& o) const;
4730 
4731  virtual bool
4732  operator==(const decl_base&) const;
4733 
4734  virtual bool
4735  operator==(const member_class_template&) const;
4736 
4737  virtual bool
4739 };// end class member_class_template
4740 
4741 bool
4742 operator==(const member_class_template_sptr& l,
4743  const member_class_template_sptr& r);
4744 
4745 bool
4746 operator!=(const member_class_template_sptr& l,
4747  const member_class_template_sptr& r);
4748 
4749 /// A comparison functor for pointers to @ref var_decl.
4751 {
4752  /// Return true if the two instances of @ref var_decl are equal.
4753  ///
4754  /// @param l the first variable to compare.
4755  ///
4756  /// @param r the second variable to compare.
4757  ///
4758  /// @return true if @p l equals @p r.
4759  bool
4760  operator()(const var_decl* l, const var_decl* r) const
4761  {
4762  if (l == r)
4763  return true;
4764  if (!!l != !!r)
4765  return false;
4766  return (*l == *r);
4767  }
4768 };// end struct var_decl::ptr_equal
4769 
4770 /// Equality functor for instances of @ref function_decl
4772 {
4773  /// Tests if two pointers to @ref function_decl are equal.
4774  ///
4775  /// @param l the first pointer to @ref function_decl to consider in
4776  /// the comparison.
4777  ///
4778  /// @param r the second pointer to @ref function_decl to consider in
4779  /// the comparison.
4780  ///
4781  /// @return true if the two functions @p l and @p r are equal, false
4782  /// otherwise.
4783  bool
4784  operator()(const function_decl* l, const function_decl* r) const
4785  {
4786  if (l == r)
4787  return true;
4788  if (!!l != !!r)
4789  return false;
4790  return (*l == *r);
4791  }
4792 };// function_decl::ptr_equal
4793 
4794 /// The base class for the visitor type hierarchy used for traversing
4795 /// a translation unit.
4796 ///
4797 /// Client code willing to get notified for a certain kind of node
4798 /// during the IR traversal might want to define a visitor class that
4799 /// inherit ir_node_visitor, overload the ir_node_visitor::visit_begin()
4800 /// or ir_node_visitor::visit_end() method of its choice, and provide
4801 /// and implementation for it. If either
4802 /// ir_node_visitor::visit_begin() or ir_node_visitor::visit_end()
4803 /// return false, it means the traversal has to stop immediately after
4804 /// the methods' return. If the methods return true, it means the
4805 /// traversal keeps going.
4806 ///
4807 /// That new visitor class would then be passed to e.g,
4808 /// translation_unit::traverse or to the traverse method of any type
4809 /// where the traversal is supposed to start from.
4811 {
4812  struct priv;
4813  std::unique_ptr<priv> priv_;
4814 
4815 public:
4816 
4817  ir_node_visitor();
4818 
4819  virtual ~ir_node_visitor();
4820 
4826 
4827  virtual bool visit_begin(decl_base*);
4828  virtual bool visit_end(decl_base*);
4829 
4830  virtual bool visit_begin(scope_decl*);
4831  virtual bool visit_end(scope_decl*);
4832 
4833  virtual bool visit_begin(type_base*);
4834  virtual bool visit_end(type_base*);
4835 
4836  virtual bool visit_begin(scope_type_decl*);
4837  virtual bool visit_end(scope_type_decl*);
4838 
4839  virtual bool visit_begin(type_decl*);
4840  virtual bool visit_end(type_decl*);
4841 
4842  virtual bool visit_begin(namespace_decl*);
4843  virtual bool visit_end(namespace_decl*);
4844 
4845  virtual bool visit_begin(qualified_type_def*);
4846  virtual bool visit_end(qualified_type_def*);
4847 
4848  virtual bool visit_begin(pointer_type_def*);
4849  virtual bool visit_end(pointer_type_def*);
4850 
4851  virtual bool visit_begin(reference_type_def*);
4852  virtual bool visit_end(reference_type_def*);
4853 
4854  virtual bool visit_begin(ptr_to_mbr_type*);
4855  virtual bool visit_end(ptr_to_mbr_type*);
4856 
4857  virtual bool visit_begin(array_type_def*);
4858  virtual bool visit_end(array_type_def*);
4859 
4860  virtual bool visit_begin(array_type_def::subrange_type*);
4861  virtual bool visit_end(array_type_def::subrange_type*);
4862 
4863  virtual bool visit_begin(enum_type_decl*);
4864  virtual bool visit_end(enum_type_decl*);
4865 
4866  virtual bool visit_begin(typedef_decl*);
4867  virtual bool visit_end(typedef_decl*);
4868 
4869  virtual bool visit_begin(function_type*);
4870  virtual bool visit_end(function_type*);
4871 
4872  virtual bool visit_begin(var_decl*);
4873  virtual bool visit_end(var_decl*);
4874 
4875  virtual bool visit_begin(function_decl*);
4876  virtual bool visit_end(function_decl*);
4877 
4878  virtual bool visit_begin(function_decl::parameter*);
4879  virtual bool visit_end(function_decl::parameter*);
4880 
4881  virtual bool visit_begin(function_tdecl*);
4882  virtual bool visit_end(function_tdecl*);
4883 
4884  virtual bool visit_begin(class_tdecl*);
4885  virtual bool visit_end(class_tdecl*);
4886 
4887  virtual bool visit_begin(class_or_union *);
4888  virtual bool visit_end(class_or_union *);
4889 
4890  virtual bool visit_begin(class_decl*);
4891  virtual bool visit_end(class_decl*);
4892 
4893  virtual bool visit_begin(union_decl*);
4894  virtual bool visit_end(union_decl*);
4895 
4896  virtual bool visit_begin(class_decl::base_spec*);
4897  virtual bool visit_end(class_decl::base_spec*);
4898 
4899  virtual bool visit_begin(member_function_template*);
4900  virtual bool visit_end(member_function_template*);
4901 
4902  virtual bool visit_begin(member_class_template*);
4903  virtual bool visit_end(member_class_template*);
4904 }; // end struct ir_node_visitor
4905 
4906 // Debugging facility
4907 void
4908 fns_to_str(vector<function_decl*>::const_iterator a_begin,
4909  vector<function_decl*>::const_iterator a_end,
4910  vector<function_decl*>::const_iterator b_begin,
4911  vector<function_decl*>::const_iterator b_end,
4912  std::ostream& o);
4913 
4914 }// end namespace ir
4915 } // end namespace abigail
4916 #endif // __ABG_IR_H__
Testing (anding) against this mask means that a given IR artifact has local differences, with respect to the other artifact it was compared against. A local change is a change that is carried by the artifact itself (or its type), rather than by one off its sub-types.
Definition: abg-ir.h:1376
elf_symbol_sptr get_next_common_instance() const
Get the next common instance of the current common symbol.
Definition: abg-ir.cc:2560
virtual bool operator==(const member_base &o) const
Equality operator of the the member_class_template class.
Definition: abg-ir.cc:26753
const enumerators & get_sorted_enumerators() const
Get the lexicographically sorted vector of enumerators.
Definition: abg-ir.cc:20327
const string & get_name() const
Getter for the name of the current instance of enum_type_decl::enumerator.
Definition: abg-ir.cc:20981
void set_pattern(shared_ptr< function_decl > p)
Set a new pattern to the function template.
Definition: abg-ir.cc:28104
void set_is_declaration_only(bool f)
Set a flag saying if the enum_type_decl is a declaration-only enum_type_decl.
Definition: abg-ir.cc:5005
const vector< function_type_sptr > & get_live_fn_types() const
Get the vector of function types that are used in the current translation unit.
Definition: abg-ir.cc:1264
bool operator==(const std::string &l, const interned_string &r)
Equality operator.
Definition: abg-ir.cc:151
virtual ~class_or_union()
Destrcutor of the class_or_union type.
Definition: abg-ir.cc:23973
The type of the private data of the function_type type.
Definition: abg-ir-priv.h:1803
const std::vector< parameter_sptr > & get_parameters() const
Definition: abg-ir.cc:23055
bool string_to_elf_symbol_binding(const string &s, elf_symbol::binding &b)
Convert a string representing a an elf symbol binding into an elf_symbol::binding.
Definition: abg-ir.cc:3097
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:18134
location_manager & get_loc_mgr()
Getter of the location manager for the current translation unit.
Definition: abg-ir.cc:1392
const canonical_type_sptr_set_type & get_canonical_types() const
the set of canonical types of the the current scope.
Definition: abg-ir.cc:7845
const member_class_templates & get_member_class_templates() const
Get the member class templates of this class.
Definition: abg-ir.cc:24460
The abstraction of an array type.
Definition: abg-ir.h:2547
friend decl_base_sptr add_decl_to_scope(decl_base_sptr decl, scope_decl *scpe)
Appends a declaration to a given scope, if the declaration doesn't already belong to one and if the d...
Definition: abg-ir.cc:8450
method_decl_sptr copy_member_function(class_or_union_sptr t, const method_decl_sptr &method)
Copy a method of a class_or_union into a new class_or_union.
Definition: abg-ir.cc:24842
The abstraction of an enumerator.
Definition: abg-ir.h:2880
The base type of all declarations.
Definition: abg-ir.h:1584
bool is_declared_inline() const
Test if the function was declared inline.
Definition: abg-ir.cc:23034
friend bool enum_has_non_name_change(const enum_type_decl &l, const enum_type_decl &r, change_kind *k)
Test if two enums differ, but not by a name change.
Definition: abg-ir.cc:20475
friend var_decl_sptr copy_member_variable(class_or_union_sptr t, const var_decl *variable)
Copy a data member of a class_or_union into a new class_or_union.
Definition: abg-ir.cc:24910
A predicate for deep equality of instances of type_base*.
Definition: abg-ir.h:2075
bool find_enumerator_by_value(int64_t value, enum_type_decl::enumerator &result)
Find an enumerator by its value.
Definition: abg-ir.cc:20361
friend bool get_member_is_static(const decl_base &d)
Gets a flag saying if a class member is static or not.
Definition: abg-ir.cc:5575
scopes & get_member_scopes()
Getter for the scopes carried by the current scope.
Definition: abg-ir.cc:7974
std::vector< function_type_sptr > function_types
Convenience typedef for a vector of function_type_sptr.
Definition: abg-ir.h:1862
enumerator & operator=(const enumerator &)
Assignment operator of the enum_type_decl::enumerator type.
Definition: abg-ir.cc:20943
virtual size_t get_num_anonymous_member_unions() const
Getter for the number of anonymous unions contained in this scope.
Definition: abg-ir.cc:7939
virtual void on_canonical_type_set()
This method is invoked automatically right after the current instance of class_decl has been canonica...
Definition: abg-ir.cc:25215
visibility get_visibility() const
Getter of the visibility of the current instance of elf_symbol.
Definition: abg-ir.cc:2244
Hash functor for instances of enum_type_decl.
Definition: abg-hash.h:196
const member_function_templates & get_member_function_templates() const
Get the member function templates of this class.
Definition: abg-ir.cc:24453
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:28182
const method_decl * find_member_function_from_signature(const string &s) const
Find a method (member function) using its signature (pretty representation) as a key.
Definition: abg-ir.cc:24428
uint64_t get_unsigned_value()
Getter of the bound value as an unsigned value.
Definition: abg-ir.cc:19235
bool is_common_symbol() const
Return true if the symbol is a common one.
Definition: abg-ir.cc:2529
friend function_type_sptr synthesize_function_type_from_translation_unit(const function_type &fn_type, translation_unit &tu)
In a translation unit, lookup the sub-types that make up a given function type and if the sub-types a...
Definition: abg-ir.cc:15354
translation_unit::language get_language() const
Getter of the language that generated this type.
Definition: abg-ir.cc:19485
visibility
The visibility of the symbol.
Definition: abg-ir.h:986
const void * runtime_type_instance() const
Getter of the pointer to the runtime type sub-object of the current instance.
Definition: abg-ir.cc:4134
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:16978
size_t operator()(const type_base_sptr &l) const
Hash a type by returning the pointer value of its canonical type.
Definition: abg-ir.cc:7783
void add_template_parameter(const template_parameter_sptr p)
Add a new template parameter to the current instance of template_decl.
Definition: abg-ir.cc:27487
istring_type_base_wptrs_map_type & pointer_types()
Getter for the map that associates the name of a pointer type to the vector of instances of pointer_t...
Definition: abg-ir.cc:677
This means that a given IR artifact has changes in some of its sub-types, with respect to the other a...
Definition: abg-ir.h:1381
int64_t get_value() const
Getter for the value of enum_type_decl::enumerator.
Definition: abg-ir.cc:21022
bool has_no_base_nor_member() const
Return true iff the class has no entity in its scope.
Definition: abg-ir.cc:26004
parameters::const_iterator get_first_parm() const
Get the first parameter of the function.
Definition: abg-ir.cc:22339
friend void set_member_function_is_const(function_decl &, bool)
set the const-ness property of a member function.
Definition: abg-ir.cc:6538
bool has_no_member() const
Definition: abg-ir.cc:24494
virtual bool operator==(const type_base &) const
Equality operator.
Definition: abg-ir.cc:27898
friend void keep_type_alive(type_base_sptr)
Make sure that the life time of a given (smart pointer to a) type is the same as the life time of the...
Definition: abg-ir.cc:28473
friend bool member_function_has_vtable_offset(const function_decl &)
Test if a virtual member function has a vtable offset set.
Definition: abg-ir.cc:6567
const string & str() const
Getter for the version name.
Definition: abg-ir.cc:3205
location create_new_location(const std::string &fle, size_t lne, size_t col)
Insert the triplet representing a source locus into our internal vector of location triplet...
Definition: abg-ir.cc:507
friend void set_member_is_static(decl_base &d, bool s)
Sets the static-ness property of a class member.
Definition: abg-ir.cc:26893
bool canonicalization_is_done() const
Test if the canonicalization of types created out of the current environment is done.
Definition: abg-ir.cc:3531
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function for ptr_to_mbr_type.
Definition: abg-ir.cc:19085
void set_qualified_name(const interned_string &) const
Setter for the qualified name.
Definition: abg-ir.cc:4523
bool is_variable() const
Test if the current instance of elf_symbol is a variable symbol or not.
Definition: abg-ir.cc:2299
bool is_constructed() const
Getter of the 'is_constructed" flag. It says if the translation unit is fully constructed or not...
Definition: abg-ir.cc:1442
Abstracts a member class template template.
Definition: abg-ir.h:4699
decl_base_sptr insert_decl_into_scope(decl_base_sptr decl, scope_decl::declarations::iterator before, scope_decl *scope)
Inserts a declaration into a given scope, before a given IR child node of the scope.
Definition: abg-ir.cc:8494
bool get_is_anonymous_or_has_anonymous_parent() const
Definition: abg-ir.cc:4701
friend interned_string get_method_type_name(const method_type &fn_type, bool internal)
Get the name of a given method type and return a copy of it.
Definition: abg-ir.cc:9243
bool is_c_language(translation_unit::language l)
Test if a language enumerator designates the C language.
Definition: abg-ir.cc:1792
virtual void set_alignment_in_bits(size_t)
Setter for the alignment of the type.
Definition: abg-ir.cc:16499
A type that introduces a scope.
Definition: abg-ir.h:2183
typedef_decl_sptr get_naming_typedef() const
Getter for the naming typedef of the current decl.
Definition: abg-ir.cc:4715
bool operator()(const type_or_decl_base *f, const type_or_decl_base *s)
Comparison operator for ABI artifacts.
Definition: abg-ir.h:3303
virtual void set_linkage_name(const string &m)
Setter for the linkage name.
Definition: abg-ir.cc:4767
void add_member_class_template(member_class_template_sptr m)
Append a member class template to the class_or_union.
Definition: abg-ir.cc:24481
static elf_symbol_sptr create(const environment &e, size_t i, size_t s, const string &n, type t, binding b, bool d, bool c, const version &ve, visibility vi, bool is_in_ksymtab=false, const abg_compat::optional< uint32_t > &crc={}, const abg_compat::optional< std::string > &ns={}, bool is_suppressed=false)
Factory of instances of elf_symbol.
Definition: abg-ir.cc:2063
bool is_void_pointer_type(const type_base_sptr &) const
Test if a given type is the same as the void pointer type of the environment.
Definition: abg-ir.cc:3658
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Get the pretty representatin of the current declaration.
Definition: abg-ir.cc:4846
friend type_or_decl_base::type_or_decl_kind & operator&=(type_or_decl_base::type_or_decl_kind &, type_or_decl_base::type_or_decl_kind)
bitwise "A&=" operator for the type_or_decl_base::type_or_decl_kind bitmap type.
Definition: abg-ir.cc:4061
bool get_is_for_static_method() const
Test if the current method type is for a static method or not.
Definition: abg-ir.cc:22690
virtual bool traverse(ir_node_visitor &)
Traverses an instance of class_decl::base_spec, visiting all the sub-types and decls that it might co...
Definition: abg-ir.cc:25463
interned_string get_id() const
Return an ID that tries to uniquely identify the function inside a program or a library.
Definition: abg-ir.cc:23310
shared_ptr< function_type > function_type_sptr
Convenience typedef for a shared pointer on a function_type.
Definition: abg-fwd.h:208
const environment & get_environment() const
Getter of the environment used by the current instance of elf_symbol.
Definition: abg-ir.cc:2138
const interned_string & get_cached_name(bool internal=false) const
Get the name of the current function_type.
Definition: abg-ir.cc:22359
shared_ptr< string_elf_symbol_sptr_map_type > string_elf_symbol_sptr_map_sptr
Convenience typedef for a shared pointer to an string_elf_symbol_sptr_map_type.
Definition: abg-ir.h:939
virtual size_t get_alignment_in_bits() const
Getter of the alignment of the class_or_union type.
Definition: abg-ir.cc:24045
virtual void on_canonical_type_set()
This function is automatically invoked whenever an instance of this type is canonicalized.
Definition: abg-ir.cc:18458
virtual ~function_decl()
Destructor of the function_decl type.
Definition: abg-ir.cc:23395
const vector< type_base_wptr > & get_types_sorted_by_name() const
Getter of all types types sorted by their pretty representation.
Definition: abg-ir.cc:1157
An abstraction helper for type declarations.
Definition: abg-ir.h:2002
shared_ptr< method_type > method_type_sptr
Convenience typedef for shared pointer to method_type.
Definition: abg-fwd.h:218
void add_member_type(type_base_sptr t)
Add a member type to the current instance of class_or_union.
Definition: abg-ir.cc:8105
void set_composed_type(type_base_sptr t)
Setter for the resulting composed type.
Definition: abg-ir.cc:28011
void add_data_member(var_decl_sptr v, access_specifier a, bool is_laid_out, bool is_static, size_t offset_in_bits)
Add a data member to the current instance of class_or_union.
Definition: abg-ir.cc:24175
vector< namespace_decl_sptr > namespaces_type
A convenience typedef for vectors of namespace_decl_sptr.
Definition: abg-ir.h:2229
A comparison functor for pointers to var_decl.
Definition: abg-ir.h:4750
unordered_map< string, type_base_sptr > string_type_base_sptr_map_type
A convenience typedef for a map which key is a string and which value is a type_base_sptr.
Definition: abg-ir.h:572
void set_cv_quals(CV cv_quals)
Setter of the const/value qualifiers bit field.
Definition: abg-ir.cc:17891
This is the abstraction of a set of translation units (themselves seen as bundles of unitary abi arte...
Definition: abg-corpus.h:24
friend bool get_member_function_is_const(const function_decl &)
Test whether a member function is const.
Definition: abg-ir.cc:6510
translation_unit * get_translation_unit(const type_or_decl_base &t)
Return the translation unit a declaration belongs to.
Definition: abg-ir.cc:10503
const function_type_sptr get_type() const
Return the type of the current instance of function_decl.
Definition: abg-ir.cc:22974
void set_path(const string &)
Set the path associated to the current instance of translation_unit.
Definition: abg-ir.cc:1309
The base class of both types and declarations.
Definition: abg-ir.h:1405
virtual ~union_decl()
Destructor of the union_decl type.
Definition: abg-ir.cc:27362
const location & get_location() const
Get the location of a given declaration.
Definition: abg-ir.cc:4605
friend type_or_decl_base::type_or_decl_kind operator&(type_or_decl_base::type_or_decl_kind, type_or_decl_base::type_or_decl_kind)
bitwise "AND" operator for the type_or_decl_base::type_or_decl_kind bitmap type.
Definition: abg-ir.cc:4051
A declaration that introduces a scope.
Definition: abg-ir.h:1852
Definition of the private data of type_base.
Definition: abg-ir-priv.h:462
Hasher for the class_or_union type.
Definition: abg-hash.h:249
const environment & get_environment() const
Getter of the environment of the current translation_unit.
Definition: abg-ir.cc:1271
Abstracts a reference type.
Definition: abg-ir.h:2415
bool operator<(const location &other) const
"Less than" operator of the location type.
Definition: abg-ir.h:421
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:21902
void set_temporary_qualified_name(const interned_string &) const
Setter for the temporary qualified name of the current declaration.
Definition: abg-ir.cc:4550
unordered_set< type_base_sptr, canonical_type_hash > canonical_type_sptr_set_type
Helper typedef for an unordered set of type_base_sptr which uses pointer value to tell its members ap...
Definition: abg-ir.h:121
virtual size_t get_num_anonymous_member_enums() const
Get the number of anonymous member enums contained in this class.
Definition: abg-ir.cc:24144
void set_visibility(visibility v)
Setter for the visibility of the decl.
Definition: abg-ir.cc:4784
bool string_to_elf_symbol_visibility(const string &s, elf_symbol::visibility &v)
Convert a string representing a an elf symbol visibility into an elf_symbol::visibility.
Definition: abg-ir.cc:3122
The abstraction of a qualified type.
Definition: abg-ir.h:2235
string get_pretty_representation_of_declarator(bool internal=false) const
Compute and return the pretty representation for the part of the function declaration that starts at ...
Definition: abg-ir.cc:22918
access_specifier get_member_access_specifier(const decl_base &d)
Gets the access specifier for a class member.
Definition: abg-ir.cc:5515
bool maybe_compare_as_member_decls(const decl_base &l, const decl_base &r, change_kind *k)
Compare the properties that belong to the "is-a-member-relation" of a decl.
Definition: abg-ir.cc:5069
bool get_is_artificial() const
Test if the location is artificial.
Definition: abg-ir.h:348
Abstraction of a base specifier in a class declaration.
Definition: abg-ir.h:4362
const elf_symbol_sptr & get_symbol() const
Gets the the underlying ELF symbol for the current variable, that was set using function_decl::set_sy...
Definition: abg-ir.cc:23027
friend decl_base * is_decl(const type_or_decl_base *d)
Test if an ABI artifact is a declaration.
Definition: abg-ir.cc:10747
bool get_is_virtual() const
Getter of the "is-virtual" proprerty of the base class specifier.
Definition: abg-ir.cc:25440
friend void remove_decl_from_scope(decl_base_sptr decl)
Remove a given decl from its scope.
Definition: abg-ir.cc:8475
friend void set_member_function_is_ctor(function_decl &, bool)
Setter for the is_ctor property of the member function.
Definition: abg-ir.cc:6425
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:26732
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:19391
bool operator!=(const decl_base &o) const
Equality operator.
Definition: abg-ir.cc:19631
The base class of templates.
Definition: abg-ir.h:3566
This is the abstraction of the set of relevant artefacts (types, variable declarations, functions, templates, etc) bundled together into a translation unit.
Definition: abg-ir.h:694
void sort_types(const canonical_type_sptr_set_type &types, vector< type_base_sptr > &result)
Sort types in a hopefully stable manner.
Definition: abg-ir.cc:3448
virtual ~class_decl()
Destructor of the class_decl type.
Definition: abg-ir.cc:26590
virtual ~enum_type_decl()
Destructor for the enum type declaration.
Definition: abg-ir.cc:20463
bool user_set_analyze_exported_interfaces_only() const
Getter for a property that says if the user actually did set the analyze_exported_interfaces_only() p...
Definition: abg-ir.cc:3738
void set_translation_unit(translation_unit *)
Set the translation_unit this ABI artifact belongs to.
Definition: abg-ir.cc:4278
virtual bool traverse(ir_node_visitor &v)
Traverse a given IR node and its children, calling an visitor on each node.
Definition: abg-ir.cc:30150
enumerator()
Default constructor of the enum_type_decl::enumerator type.
Definition: abg-ir.cc:20912
const istring_type_base_wptrs_map_type & class_types() const
Getter for the map that associates the name of a class type to the vector of instances of class_decl_...
Definition: abg-ir.cc:609
method_decl * is_method_decl(const type_or_decl_base *d)
Test if a function_decl is actually a method_decl.
Definition: abg-ir.cc:25793
shared_ptr< function_decl > get_pattern() const
Get the pattern of the function template.
Definition: abg-ir.cc:28115
virtual ~environment()
Destructor for the environment type.
Definition: abg-ir.cc:3374
friend type_base * is_type(const type_or_decl_base *)
Test whether a declaration is a type.
Definition: abg-ir.cc:10820
virtual ~method_type()
The destructor of method_type.
Definition: abg-ir.cc:22723
bool has_other_common_instances() const
Return true if this common common symbol has other common instances.
Definition: abg-ir.cc:2545
std::set< translation_unit_sptr, shared_translation_unit_comp > translation_units
Convenience typedef for an ordered set of translation_unit_sptr.
Definition: abg-ir.h:889
const type_base_sptr get_composed_type() const
Getter for the resulting composed type.
Definition: abg-ir.cc:28004
virtual bool operator==(const decl_base &) const
Equality operator of the reference_type_def type.
Definition: abg-ir.cc:18635
string as_string() const
Return a string representation of the sub range.
Definition: abg-ir.cc:19492
friend bool get_data_member_is_laid_out(const var_decl &m)
Test whether a data member is laid out.
Definition: abg-ir.cc:6344
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:17639
A functor to hash instances of interned_string.
const type_base_sptrs_type & get_member_types() const
Get the member types of this scope_decl.
Definition: abg-ir.cc:8063
bool type_node_has_been_visited(type_base *) const
Test if a given type node has been marked as visited.
Definition: abg-ir.cc:30237
void bind_function_type_life_time(function_type_sptr) const
Ensure that the life time of a function type is bound to the life time of the current translation uni...
Definition: abg-ir.cc:1494
parameters::const_iterator get_first_non_implicit_parm() const
Get the first parameter of the function.
Definition: abg-ir.cc:22317
const string get_type_pretty_representation() const
Definition: abg-ir.cc:23536
bool operator()(const function_decl *l, const function_decl *r) const
Tests if two pointers to function_decl are equal.
Definition: abg-ir.h:4784
shared_ptr< scope_decl > global_scope_sptr
Convenience typedef for a shared pointer on a global_scope.
Definition: abg-ir.h:704
shared_ptr< context_rel > context_rel_sptr
A convenience typedef for shared pointers to context_rel.
Definition: abg-ir.h:1273
Abstracts the type of a class member function.
Definition: abg-ir.h:3505
shared_ptr< var_decl > var_decl_sptr
Convenience typedef for a shared pointer on a var_decl.
Definition: abg-fwd.h:253
const interned_string & get_qualified_parent_name() const
Return a copy of the qualified name of the parent of the current decl.
Definition: abg-ir.cc:4804
bool operator!=(const translation_unit_sptr &l, const translation_unit_sptr &r)
A deep inequality operator for pointers to translation units.
Definition: abg-ir.cc:1868
int get_number_of_aliases() const
Get the number of aliases to this elf symbol.
Definition: abg-ir.cc:2433
void set_type(type t)
Setter for the type of the current instance of elf_symbol.
Definition: abg-ir.cc:2183
string get_cv_quals_string_prefix() const
Compute and return the string prefix or suffix representing the qualifiers hold by the current instan...
Definition: abg-ir.cc:17900
virtual bool operator==(const decl_base &) const
Return true iff the two decls have the same name.
Definition: abg-ir.cc:20048
Abstraction of the declaration of a method.
Definition: abg-ir.h:3886
const type_base_sptr & get_containing_type() const
Getter of the type containing the member pointed-to by the current ptr_to_mbr_type.
Definition: abg-ir.cc:18977
const type_base_sptr get_type() const
Getter for the type of the template parameter.
Definition: abg-ir.cc:27820
bool decl_only_class_equals_definition() const
Getter of the "decl-only-class-equals-definition" flag.
Definition: abg-ir.cc:3591
bool enum_has_non_name_change(const enum_type_decl &l, const enum_type_decl &r, change_kind *k)
Test if two enums differ, but not by a name change.
Definition: abg-ir.cc:20475
The interface for types which are feeling social and want to be visited during the traversal of a hie...
Definition: abg-traverse.h:38
std::vector< decl_base_sptr > declarations
Convenience typedef for a vector of decl_base_sptr.
Definition: abg-ir.h:1860
void set_compilation_dir_path(const std::string &)
Set the path of the directory that was 'current' when the translation unit was compiled.
Definition: abg-ir.cc:1333
const declarations & get_member_decls() const
Getter for the member declarations carried by the current scope_decl.
Definition: abg-ir.cc:7881
shared_ptr< translation_unit > translation_unit_sptr
Convenience typedef for a shared pointer on a translation_unit type.
Definition: abg-fwd.h:133
Abstracts a class declaration.
Definition: abg-ir.h:4173
const data_members & get_static_data_members() const
Get the static data memebers of this class_or_union.
Definition: abg-ir.cc:24332
virtual const interned_string & get_name() const
Getter for the name of the current decl.
Definition: abg-ir.cc:4811
const corpus * get_corpus() const
Get the corpus this translation unit is a member of.
Definition: abg-ir.cc:1384
shared_ptr< typedef_decl > typedef_decl_sptr
Convenience typedef for a shared pointer on a typedef_decl.
Definition: abg-fwd.h:164
type_base_sptr get_underlying_type() const
Getter of the underlying type.
Definition: abg-ir.cc:17905
const string & get_name() const
Getter for the name of the elf_symbol.
Definition: abg-ir.cc:2159
The base class for the visitor type hierarchy used for traversing a hierarchy of nodes.
Definition: abg-traverse.h:27
change_kind
A bitfield that gives callers of abigail::ir::equals() some insight about how different two internal ...
Definition: abg-ir.h:1360
Hash functor for instances of pointer_type_def.
Definition: abg-hash.h:143
virtual bool operator!=(const type_base &) const
Return true if both types equals.
Definition: abg-ir.cc:17076
The abstraction of the relationship between an entity and its containing scope (its context)...
Definition: abg-ir.h:1284
unordered_set< uintptr_t > pointer_set
A convenience typedef for an unordered set of pointer values.
Definition: abg-ir.h:99
const member_functions & get_virtual_mem_fns() const
Get the virtual member functions of this class.
Definition: abg-ir.cc:25280
bool is_empty_or_has_empty_sub_namespaces() const
Test if the current namespace_decl is empty or contains empty namespaces itself.
Definition: abg-ir.cc:17451
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:20302
CV get_cv_quals() const
Getter of the const/volatile qualifier bit field.
Definition: abg-ir.cc:17886
void expand_location(const location &location, std::string &path, unsigned &line, unsigned &column) const
Given an instance of location type, return the triplet {path,line,column} that represents the source ...
Definition: abg-ir.cc:530
istring_type_base_wptrs_map_type & typedef_types()
Getter for the map that associates the name of a typedef to the vector of instances of typedef_decl_s...
Definition: abg-ir.cc:651
bool is_variadic() const
Test if the current instance of function_type is for a variadic function.
Definition: abg-ir.cc:22130
decl_base_sptr insert_member_decl(decl_base_sptr member, declarations::iterator before)
Insert a member decl to this scope, right before an element pointed to by a given iterator...
Definition: abg-ir.cc:8198
std::unordered_map< string, elf_symbol_sptr > string_elf_symbol_sptr_map_type
Convenience typedef for a map which key is a string and which value if the elf symbol of the same nam...
Definition: abg-ir.h:934
bool is_suppressed() const
Getter for the 'is-suppressed' property.
Definition: abg-ir.cc:2358
var_decl_sptr clone() const
Create a new var_decl that is a clone of the current one.
Definition: abg-ir.cc:21489
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Return a copy of the pretty representation of the current function_type.
Definition: abg-ir.cc:22425
Abstraction of a member function context relationship. This relates a member function to its parent c...
Definition: abg-ir.h:4496
const context_rel * get_context_rel() const
Getter for the context relationship.
Definition: abg-ir.cc:4557
const elf_symbol_sptr & get_symbol() const
Gets the the underlying ELF symbol for the current variable, that was set using var_decl::set_symbol(...
Definition: abg-ir.cc:21482
Hash functor for instances of union_decl type.
Definition: abg-hash.h:279
virtual bool operator==(const type_base &) const
Return true if both types equals.
Definition: abg-ir.cc:17032
void vtable_offset(size_t s)
Setter for the vtable offset property.
Definition: abg-ir.h:4565
canonical_types_map_type & get_canonical_types_map()
Getter the map of canonical types.
Definition: abg-ir.cc:3382
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Get the pretty representation of the current instance of function_decl.
Definition: abg-ir.cc:22850
void set_is_suppressed(bool is_suppressed)
Setter for the 'is-suppressed' property.
Definition: abg-ir.cc:2367
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Getter of the pretty representation of the current instance of class_decl.
Definition: abg-ir.cc:25325
bool operator!=(const enumerator &other) const
Inequality operator.
Definition: abg-ir.cc:20972
virtual bool operator==(const decl_base &) const
Equality operator between two scope_type_decl.
Definition: abg-ir.cc:17306
std::ostream & operator<<(std::ostream &o, elf_symbol::type t)
Serialize an instance of symbol_type and stream it to a given output stream.
Definition: abg-ir.cc:2936
const std::string & get_absolute_path() const
Get the concatenation of the build directory and the relative path of the translation unit...
Definition: abg-ir.cc:1341
class_or_union_sptr get_class_type() const
Get the class type this method belongs to.
Definition: abg-ir.cc:22634
The comparison functor for using instances of type_or_decl_base as values in a hash map or set...
Definition: abg-ir.h:483
unordered_map< string, method_decl_sptr > string_mem_fn_sptr_map_type
Convenience typedef.
Definition: abg-ir.h:4011
function_decl::parameter * is_function_parameter(const type_or_decl_base *tod)
Test whether a declaration is a function_decl.
Definition: abg-ir.cc:10724
friend void set_data_member_is_laid_out(var_decl_sptr m, bool l)
Set a flag saying if a data member is laid out.
Definition: abg-ir.cc:6330
Abstracts a variable declaration.
Definition: abg-ir.h:3067
virtual void remove_member_decl(decl_base_sptr)
Remove a given decl from the current class_or_union scope.
Definition: abg-ir.cc:23994
Hash functor for instances of type_decl.
Definition: abg-hash.h:123
vector< type_base_sptr > member_types
Convenience typedef.
Definition: abg-ir.h:4002
bool string_to_elf_symbol_type(const string &s, elf_symbol::type &t)
Convert a string representing a symbol type into an elf_symbol::type.
Definition: abg-ir.cc:3064
virtual void set_size_in_bits(size_t)
Setter of the size of the class_or_union type.
Definition: abg-ir.cc:24077
void set_index(size_t)
Setter for the index.
Definition: abg-ir.cc:2152
virtual void get_qualified_name(interned_string &, bool internal=false) const
Build and return the qualified name of the current instance of pointer_type_def.
Definition: abg-ir.cc:18270
virtual bool operator==(const decl_base &) const
Comparison operator for class_decl.
Definition: abg-ir.cc:26354
virtual size_t get_num_anonymous_member_unions() const
Get the number of anonymous member unions contained in this class.
Definition: abg-ir.cc:24126
Abstract a class template.
Definition: abg-ir.h:3796
Abstraction of a function parameter.
Definition: abg-ir.h:3334
virtual bool operator==(const decl_base &) const
Return true iff both namespaces and their members are equal.
Definition: abg-ir.cc:17437
friend uint64_t get_data_member_offset(const var_decl_sptr m)
Get the offset of a data member.
Definition: abg-ir.cc:6199
virtual void set_name(const string &n)
Setter for the name of the decl.
Definition: abg-ir.cc:4655
void remove_member_type(type_base_sptr t)
Remove a member type from the current class_or_union scope.
Definition: abg-ir.cc:8130
void set_class_type(const class_or_union_sptr &t)
Sets the class type of the current instance of method_type.
Definition: abg-ir.cc:22643
const type_base_sptr & get_member_type() const
Getter of the member type of the current ptr_to_mbr_type.
Definition: abg-ir.cc:18968
size_t operator()(const type_or_decl_base *artifact) const
Function-call Operator to hash the string representation of an ABI artifact.
Definition: abg-ir.h:536
The private data of the environment type.
Definition: abg-ir-priv.h:539
friend type_base_sptr canonicalize(type_base_sptr, bool, bool)
Compute the canonical type of a given type.
Definition: abg-ir.cc:16251
Abstract a member function template.
Definition: abg-ir.h:4646
interned_string get_name_id() const
Get a name uniquely identifying the parameter in the function.
Definition: abg-ir.cc:23555
language get_language() const
Getter of the language of the source code of the translation unit.
Definition: abg-ir.cc:1278
binding get_binding() const
Getter of the binding of the variable.
Definition: abg-ir.cc:21444
std::vector< elf_symbol_sptr > elf_symbols
Convenience typedef for a vector of elf_symbol.
Definition: abg-ir.h:942
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Get the pretty representation of the current instance of reference_type_def.
Definition: abg-ir.cc:18794
access_specifier get_access_specifier() const
Getter for the access specifier of this member.
Definition: abg-ir.h:3859
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Build a pretty representation for an array_type_def::subrange_type.
Definition: abg-ir.cc:19670
bool operator!=(const template_parameter &) const
Inequality operator.
Definition: abg-ir.cc:27645
real_type::modifiers_type operator~(real_type::modifiers_type l)
Bitwise one's complement operator for real_type::modifiers_type.
Definition: abg-ir.cc:16575
The private data of type_or_decl_base.
Definition: abg-ir-priv.h:187
static string vector_as_string(const vector< subrange_sptr > &)
Return a string representation of a vector of subranges.
Definition: abg-ir.cc:19515
bool get_is_static() const
Definition: abg-ir.h:3871
Abstracts a type template parameter.
Definition: abg-ir.h:3627
bool elf_symbol_is_function(elf_symbol::type t)
Test if the type of an ELF symbol denotes a function symbol.
Definition: abg-ir.cc:3145
interned_string get_id() const
Return an ID that tries to uniquely identify the variable inside a program or a library.
Definition: abg-ir.cc:21694
shared_ptr< class_decl > get_pattern() const
Getter of the pattern of the template.
Definition: abg-ir.cc:28285
var_decl * is_var_decl(const type_or_decl_base *tod)
Tests if a declaration is a variable declaration.
Definition: abg-ir.cc:12059
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:28334
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Implementation for the virtual qualified name builder for qualified_type_def.
Definition: abg-ir.cc:17787
corpus::origin operator&=(corpus::origin &l, corpus::origin r)
Bitwise &= operator for the corpus::origin type.
Definition: abg-corpus.cc:1816
const decl_base_sptr get_earlier_declaration() const
If this decl_base is a definition, get its earlier declaration.
Definition: abg-ir.cc:4953
std::vector< enumerator > enumerators
Convenience typedef for a list of enumerator.
Definition: abg-ir.h:2798
virtual void set_size_in_bits(size_t)
Setter for the size of the type.
Definition: abg-ir.cc:16485
string get_aliases_id_string(const string_elf_symbols_map_type &symtab, bool include_symbol_itself=true) const
Return a comma separated list of the id of the current symbol as well as the id string of its aliases...
Definition: abg-ir.cc:2686
class_decl::base_spec * is_class_base_spec(const type_or_decl_base *tod)
Test if an ABI artifact is a class base specifier.
Definition: abg-ir.cc:26647
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:26076
weak_ptr< type_base > type_base_wptr
Convenience typedef for a weak pointer on a type_base.
Definition: abg-fwd.h:128
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Build a pretty representation for a typedef_decl.
Definition: abg-ir.cc:21259
virtual bool operator==(const decl_base &) const
Comparison operator for class_decl::base_spec.
Definition: abg-ir.cc:25557
void set_anonymous_data_member(var_decl *)
Set the containing anonymous data member of this data member context relationship. That means that the data member this relation belongs to is part of an anonymous data member.
Definition: abg-ir.cc:3354
const environment & get_environment() const
Getter of the environment of the current ABI artifact.
Definition: abg-ir.cc:4202
void insert_member_type(type_base_sptr t, declarations::iterator before)
Insert a member type.
Definition: abg-ir.cc:8088
virtual size_t get_num_anonymous_member_enums() const
Getter for the number of anonymous enums contained in this scope.
Definition: abg-ir.cc:7957
friend decl_base_sptr insert_decl_into_scope(decl_base_sptr decl, scope_decl::declarations::iterator before, scope_decl *scope)
Inserts a declaration into a given scope, before a given IR child node of the scope.
Definition: abg-ir.cc:8494
const std::string & get_compilation_dir_path() const
Get the path of the directory that was 'current' when the translation unit was compiled.
Definition: abg-ir.cc:1322
function_decl(const string &name, function_type_sptr function_type, bool declared_inline, const location &locus, const string &mangled_name, visibility vis, binding bind)
Constructor of the function_decl.
Definition: abg-ir.cc:22781
vector< type_base_sptr > type_base_sptrs_type
Helper typedef for a vector of shared pointer to a type_base.
Definition: abg-ir.h:127
const data_members & get_non_static_data_members() const
Get the non-static data members of this class_or_union.
Definition: abg-ir.cc:24324
Private type to hold private members of translation_unit.
Definition: abg-ir-priv.h:151
virtual bool operator==(const type_base &) const
Equality operator.
Definition: abg-ir.cc:27691
Abstracts a declaration for an enum type.
Definition: abg-ir.h:2784
bool operator()(const translation_unit_sptr &lhs, const translation_unit_sptr &rhs) const
Compare two translations units based on their absolute paths.
Definition: abg-ir.h:881
virtual const interned_string & get_name() const
Getter of the name of the current ptr-to-mbr-type.
Definition: abg-ir.cc:18944
bool get_is_declaration_only() const
Test if a decl_base is a declaration-only decl.
Definition: abg-ir.cc:4996
const member_functions & get_member_functions() const
Get the member functions of this class_or_union.
Definition: abg-ir.cc:24377
bool allow_visiting_already_visited_type_node() const
Get if the walker using this visitor is allowed to re-visit a type node that was previously visited o...
Definition: abg-ir.cc:30188
This class is to hold the value of the bound of a subrange. The value can be either signed or unsigne...
Definition: abg-ir.h:2588
Toplevel namespace for libabigail.
const type_base_sptr & get_void_type() const
Get the unique type_decl that represents a "void" type for the current environment. This node must be the only one representing a void type in the system.
Definition: abg-ir.cc:3468
bool get_is_artificial() const
Getter of the flag that says if the artefact is artificial.
Definition: abg-ir.cc:4091
unordered_set< type_or_decl_base_sptr, type_or_decl_hash, type_or_decl_equal > artifact_sptr_set_type
A convenience typedef for a hash set of type_or_decl_base_sptr.
Definition: abg-ir.h:559
interned_string get_name_of_qualified_type(const type_base_sptr &underlying_type, qualified_type_def::CV quals, bool qualified, bool internal)
Get the name of a qualified type, given the underlying type and its qualifiers.
Definition: abg-ir.cc:9071
void add_member_function(method_decl_sptr f, access_specifier a, bool is_static, bool is_ctor, bool is_dtor, bool is_const)
Add a member function.
Definition: abg-ir.cc:24349
shared_ptr< scope_decl > scope_decl_sptr
Convenience typedef for a shared pointer on a scope_decl.
Definition: abg-fwd.h:261
bool is_main_symbol() const
Tests whether this symbol is the main symbol.
Definition: abg-ir.cc:2411
const type_base_sptrs_type & get_sorted_member_types() const
Get the sorted member types of this scope_decl.
Definition: abg-ir.cc:8149
void set_pointed_to_type(type_base_sptr &pointed_to_type)
Setter of the pointed_to type of the current reference type.
Definition: abg-ir.cc:18566
bool is_destructor() const
Getter for the 'is-destructor' property.
Definition: abg-ir.h:4592
bool analyze_exported_interfaces_only() const
Getter for the property that controls if we are to restrict the analysis to the types that are only r...
Definition: abg-ir.cc:3764
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:23379
istring_type_base_wptrs_map_type & qualified_types()
Getter for the map that associates the name of a qualified type to the vector of instances of qualifi...
Definition: abg-ir.cc:664
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Compute and return a copy of the pretty representation of the current function parameter.
Definition: abg-ir.cc:23738
void set_signedness(enum signedness s)
Setter of the signedness (unsigned VS signed) of the bound value.
Definition: abg-ir.cc:19220
shared_ptr< function_decl::parameter > parameter_sptr
Convenience typedef for a shared pointer on a function_decl::parameter.
Definition: abg-ir.h:3426
shared_ptr< function_decl > function_decl_sptr
Convenience typedef for a shared pointer on a function_decl.
Definition: abg-fwd.h:266
enum_type_decl * get_enum_type() const
Getter for the enum type that this enumerator is for.
Definition: abg-ir.cc:21036
bool elf_symbol_is_variable(elf_symbol::type t)
Test if the type of an ELF symbol denotes a function symbol.
Definition: abg-ir.cc:3155
virtual ~template_decl()
Destructor.
Definition: abg-ir.cc:27520
bool is_enumerator_present_in_enum(const enum_type_decl::enumerator &enr, const enum_type_decl &enom)
Test if a given enumerator is found present in an enum.
Definition: abg-ir.cc:20556
bool operator==(const translation_unit_sptr &l, const translation_unit_sptr &r)
A deep comparison operator for pointers to translation units.
Definition: abg-ir.cc:1849
std::vector< parameter_sptr > parameters
Convenience typedef for a vector of parameter_sptr.
Definition: abg-ir.h:3432
virtual bool operator==(const decl_base &) const
Return true iff both scopes have the same names and have the same member decls.
Definition: abg-ir.cc:28289
Hash functor for instances of reference_type_def.
Definition: abg-hash.h:153
virtual size_t get_alignment_in_bits() const
Return the alignment of the typedef.
Definition: abg-ir.cc:21155
virtual const interned_string & get_qualified_name(bool internal=false) const
Get the qualified name of a given variable or data member.
Definition: abg-ir.cc:21740
std::vector< parameter_sptr > parameters
Convenience typedef for a vector of parameter_sptr.
Definition: abg-ir.h:3190
const method_type_sptr get_type() const
Definition: abg-ir.cc:25731
std::unordered_map< string, elf_symbols > string_elf_symbols_map_type
Convenience typedef for a map which key is a string and which value is a vector of elf_symbol...
Definition: abg-ir.h:947
Abstracts a union type declaration.
Definition: abg-ir.h:4421
void set_definition_of_declaration(const decl_base_sptr &)
Set the definition of this declaration-only decl_base.
Definition: abg-ir.cc:16330
shared_ptr< parameter > parameter_sptr
Convenience typedef for a shared pointer on a function_decl::parameter.
Definition: abg-ir.h:3183
virtual size_t get_size_in_bits() const
Getter for the size of the type.
Definition: abg-ir.cc:16492
The abstraction of a pointer-to-member type.
Definition: abg-ir.h:2483
bool empty() const
Test if the type_maps is empty.
Definition: abg-ir.cc:577
class_decl_sptr get_base_class() const
Get the base class referred to by the current base class specifier.
Definition: abg-ir.cc:25433
enum signedness get_signedness() const
Getter of the signedness (unsigned VS signed) of the bound value.
Definition: abg-ir.cc:19213
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:22023
elf_symbol_sptr get_alias_from_name(const string &name) const
From the aliases of the current symbol, lookup one with a given name.
Definition: abg-ir.cc:2643
weak_ptr< elf_symbol > elf_symbol_wptr
A convenience typedef for a weak pointer to elf_symbol.
Definition: abg-ir.h:929
void clear_qualified_name()
Clear the qualified name of this decl.
Definition: abg-ir.cc:4516
unordered_set< const type_or_decl_base *, type_or_decl_hash, type_or_decl_equal > artifact_ptr_set_type
A convenience typedef for a hash set of const type_or_decl_base*.
Definition: abg-ir.h:564
void set_unsigned(uint64_t v)
Setter of the bound value as unsigned.
Definition: abg-ir.cc:19242
shared_ptr< function_tdecl > function_tdecl_sptr
Convenience typedef for a shared pointer on a function_tdecl.
Definition: abg-fwd.h:291
hash_t peek_hash_value(const type_or_decl_base &artefact)
Get the hash value associated to an IR node.
Definition: abg-ir.cc:28607
friend void set_member_function_is_dtor(function_decl &, bool)
Set the destructor-ness property of a member function.
Definition: abg-ir.cc:6482
scope_decl * get_scope() const
Return the type containing the current decl, if any.
Definition: abg-ir.cc:4792
shared_ptr< base_spec > base_spec_sptr
Convenience typedef.
Definition: abg-ir.h:4188
virtual void on_canonical_type_set()
This method is invoked automatically right after the current instance of class_decl has been canonica...
Definition: abg-ir.cc:16084
void set_corpus(corpus *)
Set the corpus this translation unit is a member of.
Definition: abg-ir.cc:1368
type_base_sptr get_return_type() const
Getter for the return type of the current instance of function_type.
Definition: abg-ir.cc:22034
void set_underlying_type(const type_base_sptr &)
Setter of the underlying type of the subrange, that is, the type that defines the range...
Definition: abg-ir.cc:19410
istring_type_base_wptrs_map_type & enum_types()
Getter for the map that associates the name of an enum type to the vector of instances of enum_type_d...
Definition: abg-ir.cc:637
const parameters & get_parameters() const
Getter for the set of parameters of the current intance of function_type.
Definition: abg-ir.cc:22051
void set_is_in_ksymtab(bool is_in_ksymtab)
Setter of the 'is-in-ksymtab' property.
Definition: abg-ir.cc:2321
Hash functor for instances of qualified_type_def.
Definition: abg-hash.h:133
friend bool equals(const decl_base &, const decl_base &, change_kind *)
Compares two instances of decl_base.
Definition: abg-ir.cc:5138
size_t get_index() const
Getter for the index.
Definition: abg-ir.cc:2145
virtual bool traverse(ir_node_visitor &)
Traverses an instance of scope_type_decl, visiting all the sub-types and decls that it might contain...
Definition: abg-ir.cc:17344
virtual bool operator==(const decl_base &o) const
Comparison operator for function_decl.
Definition: abg-ir.cc:23280
bool is_void_type(const type_base_sptr &) const
Test if a given type is a void type as defined in the current environment.
Definition: abg-ir.cc:3627
istring_type_base_wptrs_map_type & reference_types()
Getter for the map that associates the name of a reference type to the vector of instances of referen...
Definition: abg-ir.cc:705
void add_member_function_template(member_function_template_sptr)
Append a member function template to the class_or_union.
Definition: abg-ir.cc:24467
bool has_aliases() const
Check if the current elf_symbol has an alias.
Definition: abg-ir.cc:2426
Abstraction for a function declaration.
Definition: abg-ir.h:3164
bool is_constructor() const
Getter for the 'is-constructor' property.
Definition: abg-ir.h:4575
std::vector< scope_decl_sptr > scopes
Convenience typedef for a vector of scope_decl_sptr.
Definition: abg-ir.h:1864
void append_parameter(parameter_sptr parm)
Append a new parameter to the vector of parameters of the current instance of function_type.
Definition: abg-ir.cc:22115
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:16359
bool is_ada_language(translation_unit::language l)
Test if a language enumerator designates the Ada language.
Definition: abg-ir.cc:1833
virtual bool operator!=(const type_base &) const
Inequality operator.
Definition: abg-ir.cc:16478
bool is_struct() const
Test if the class is a struct.
Definition: abg-ir.cc:25237
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:19692
virtual size_t get_num_anonymous_member_classes() const
Getter for the number of anonymous classes contained in this scope.
Definition: abg-ir.cc:7921
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:21330
static bool get_name_and_version_from_id(const string &id, string &name, string &ver)
Given the ID of a symbol, get the name and the version of said symbol.
Definition: abg-ir.cc:2752
bool operator!=(const version &o) const
Inequality operator.
Definition: abg-ir.cc:3248
parameters::const_iterator get_first_non_implicit_parm() const
Getter for the first non-implicit parameter of a function decl.
Definition: abg-ir.cc:22955
const interned_string & get_cached_pretty_representation(bool internal=false) const
Get the pretty representation of the current type.
Definition: abg-ir.cc:16413
bool is_defined() const
Test if the current instance of elf_symbol is defined or not.
Definition: abg-ir.cc:2252
unordered_map< interned_string, type_base_wptr, hash_interned_string > istring_type_base_wptr_map_type
A convenience typedef for a map which key is an interned_string and which value is a type_base_wptr...
Definition: abg-ir.h:577
virtual bool operator==(const decl_base &) const
Equality operator for qualified types.
Definition: abg-ir.cc:17731
bool operator()(const type_or_decl_base_sptr &l, const type_or_decl_base_sptr &r) const
The function-call operator to compare the string representations of two ABI artifacts.
Definition: abg-ir.h:518
const var_decl_sptr find_anonymous_data_member(const var_decl_sptr &) const
Find an anonymous data member in the class.
Definition: abg-ir.cc:24274
const interned_string & get_linkage_name() const
Getter for the mangled name.
Definition: abg-ir.cc:4760
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Implementation of the virtual "get_qualified_name" method.
Definition: abg-ir.cc:21298
The base type of class_decl and union_decl.
Definition: abg-ir.h:3976
bool get_is_in_public_symbol_table() const
Test if the decl is defined in a ELF symbol table as a public symbol.
Definition: abg-ir.cc:4577
void set_is_anonymous(bool)
Set the "is_anonymous" flag of the current declaration.
Definition: abg-ir.cc:4678
type
The type of a symbol.
Definition: abg-ir.h:964
friend bool get_member_function_is_dtor(const function_decl &)
Test whether a member function is a destructor.
Definition: abg-ir.cc:6454
bool is_non_finite() const
Test if the length of the subrange type is infinite.
Definition: abg-ir.cc:19470
friend bool equals(const function_type &, const function_type &, change_kind *)
Compare two function types.
Definition: abg-ir.cc:22163
friend method_decl_sptr copy_member_function(class_or_union_sptr t, const method_decl *m)
Copy a method of a class_or_union into a new class_or_union.
Definition: abg-ir.cc:24856
The source location of a token.
Definition: abg-ir.h:306
void fixup_virtual_member_function(method_decl_sptr method)
When a virtual member function has seen its virtualness set by set_member_function_is_virtual(), this function ensures that the member function is added to the specific vectors and maps of virtual member function of its class.
Definition: abg-ir.cc:25960
friend hash_t peek_hash_value(const type_or_decl_base &)
Get the hash value associated to an IR node.
Definition: abg-ir.cc:28607
The base of an entity of the intermediate representation that is to be traversed. ...
Definition: abg-ir.h:469
virtual void on_canonical_type_set()
This function is automatically invoked whenever an instance of this type is canonicalized.
Definition: abg-ir.cc:17577
binding get_binding() const
Getter for the binding of the current instance of elf_symbol.
Definition: abg-ir.cc:2204
void set_location(const location &l)
Set the location for a given declaration.
Definition: abg-ir.cc:4643
unordered_map< ssize_t, member_functions > virtual_mem_fn_map_type
Convenience typedef.
Definition: abg-ir.h:4009
The hashing functor for function_type.
Definition: abg-hash.h:216
type_base_sptr find_member_type(const string &name) const
Find a member type of a given name, inside the current scope_decl.
Definition: abg-ir.cc:8074
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:18556
virtual bool operator==(const type_base &) const
Return true iff both type declarations are equal.
Definition: abg-ir.cc:16468
void set_upper_bound(int64_t ub)
Setter of the upper bound of the subrange type.
Definition: abg-ir.cc:19436
friend bool equals(const class_decl &, const class_decl &, change_kind *)
Compares two instances of class_decl.
Definition: abg-ir.cc:26174
bool var_equals_modulo_types(const var_decl &l, const var_decl &r, change_kind *k)
Compares two instances of var_decl without taking their type into account.
Definition: abg-ir.cc:21550
string translation_unit_language_to_string(translation_unit::language l)
Converts a translation_unit::language enumerator into a string.
Definition: abg-ir.cc:1540
shared_ptr< type_or_decl_base > type_or_decl_base_sptr
A convenience typedef for a shared_ptr to type_or_decl_base.
Definition: abg-fwd.h:118
shared_ptr< type_decl > type_decl_sptr
Convenience typedef for a shared pointer on a type_decl.
Definition: abg-fwd.h:159
Abstracts non type template parameters.
Definition: abg-ir.h:3661
location get_location(const type_base_sptr &type)
Get the location of the declaration of a given type.
Definition: abg-ir.cc:8766
unordered_map< interned_string, type_base_wptrs_type, hash_interned_string > istring_type_base_wptrs_map_type
A convenience typedef for a map which key is an interned_string and which value is a vector of type_b...
Definition: abg-fwd.h:148
bool function_decls_alias(const function_decl &f1, const function_decl &f2)
Test if two function declarations are aliases.
Definition: abg-ir.cc:23361
This is a type that aggregates maps of all the kinds of types that are supported by libabigail...
Definition: abg-ir.h:601
type_base_sptr get_underlying_type() const
Getter of the underlying type of the typedef.
Definition: abg-ir.cc:21276
bool is_variadic_parameter_type(const type_base *) const
Test if a type is a variadic parameter type as defined in the current environment.
Definition: abg-ir.cc:3690
bool is_public() const
Test if the current instance of elf_symbol is public or not.
Definition: abg-ir.cc:2274
friend void fixup_virtual_member_function(method_decl_sptr method)
When a virtual member function has seen its virtualness set by set_member_function_is_virtual(), this function ensures that the member function is added to the specific vectors and maps of virtual member function of its class.
Definition: abg-ir.cc:25960
bool get_is_const() const
Getter of the "is-const" property of method_type.
Definition: abg-ir.cc:22682
Abstraction of an elf symbol.
Definition: abg-ir.h:960
type_base * get_canonical_type(const char *name, unsigned index)
Get a given canonical type which has a given "string representation".
Definition: abg-ir.cc:3898
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:21125
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:19799
virtual void on_canonical_type_set()
This function is automatically invoked whenever an instance of this type is canonicalized.
Definition: abg-ir.cc:18061
This is an abstraction of the set of resources necessary to manage several aspects of the internal re...
Definition: abg-ir.h:147
qualified_type_def_sptr lookup_qualified_type(const interned_string &type_name, const translation_unit &tu)
Lookup a qualified type from a translation unit.
Definition: abg-ir.cc:12668
virtual bool operator==(const decl_base &) const
Equality operator.
Definition: abg-ir.cc:21218
Abstract a function template declaration.
Definition: abg-ir.h:3751
The abstraction for a data member context relationship. This relates a data member to its parent clas...
Definition: abg-ir.h:3002
type_base * get_naked_pointed_to_type() const
Getter of a naked pointer to the pointed-to type.
Definition: abg-ir.cc:18257
virtual void remove_member_decl(decl_base_sptr member)
Remove a declaration from the current scope.
Definition: abg-ir.cc:8223
vector< method_decl_sptr > member_functions
Convenience typedef.
Definition: abg-ir.h:4008
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:18815
void set_return_type(type_base_sptr t)
Setter of the return type of the current instance of function_type.
Definition: abg-ir.cc:22042
bool elf_symbols_alias(const elf_symbol &s1, const elf_symbol &s2)
Test if two symbols alias.
Definition: abg-ir.cc:2867
vector< type_base * > type_base_ptrs_type
Helper typedef for a vector of pointer to type_base.
Definition: abg-ir.h:124
void set_is_artificial(bool f)
Set the artificial-ness of the location.
Definition: abg-ir.h:364
bool operator==(const translation_unit &) const
Compare the current translation unit against another one.
Definition: abg-ir.cc:1468
void add_alias(const elf_symbol_sptr &)
Add an alias to the current elf symbol.
Definition: abg-ir.cc:2450
virtual ~decl_base()
Destructor of the decl_base type.
Definition: abg-ir.cc:5224
friend void set_data_member_offset(var_decl_sptr m, uint64_t o)
Set the offset of a data member into its containing class.
Definition: abg-ir.cc:6167
uint64_t get_length() const
Getter of the length of the subrange type.
Definition: abg-ir.cc:19453
shared_ptr< reference_type_def > reference_type_def_sptr
Convenience typedef for a shared pointer on a reference_type_def.
Definition: abg-fwd.h:232
type_base_sptr get_underlying_type() const
Getter of the underlying type of the subrange, that is, the type that defines the range...
Definition: abg-ir.cc:19402
virtual decl_base_sptr add_member_decl(const decl_base_sptr &member)
Add a member decl to this scope. Note that user code should not use this, but rather use add_decl_to_...
Definition: abg-ir.cc:8034
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:27289
void set_member_access_specifier(decl_base &d, access_specifier a)
Sets the access specifier for a class member.
Definition: abg-ir.cc:5544
Functor to hash a canonical type by using its pointer value.
Definition: abg-ir.h:111
shared_ptr< elf_symbol > elf_symbol_sptr
A convenience typedef for a shared pointer to elf_symbol.
Definition: abg-ir.h:924
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse virtual function.
Definition: abg-ir.cc:1528
virtual bool operator==(const decl_base &) const
Equality operator.
Definition: abg-ir.cc:24543
std::unordered_map< string, std::vector< type_base_sptr > > canonical_types_map_type
A convenience typedef for a map of canonical types. The key is the pretty representation string of a ...
Definition: abg-ir.h:158
interned_string intern(const string &) const
Do intern a string.
Definition: abg-ir.cc:3721
void mark_type_node_as_visited(type_base *)
Mark a given type node as having been visited.
Definition: abg-ir.cc:30198
virtual bool traverse(ir_node_visitor &)
Traverses an instance of function_type, visiting all the sub-types and decls that it might contain...
Definition: abg-ir.cc:22442
location(const location &l)
Copy constructor of the location.
Definition: abg-ir.h:370
void set_signed(int64_t v)
Setter of the bound value as signed.
Definition: abg-ir.cc:19252
translation_unit::language get_language() const
Get the language of the array.
Definition: abg-ir.cc:20037
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Get the qualified name for the current ptr_to_mbr_type.
Definition: abg-ir.cc:19034
string get_anon_dm_reliable_name(bool qualified=true) const
Get a name that is valid even for an anonymous data member.
Definition: abg-ir.cc:21879
bool operator!=(const translation_unit &) const
Inequality operator.
Definition: abg-ir.cc:1483
bool is_default() const
Getter for the 'is_default' property of the version.
Definition: abg-ir.cc:3219
Hash functor for instances of type_base.
Definition: abg-hash.h:110
location & operator=(const location &l)
Assignment operator of the location.
Definition: abg-ir.h:380
unordered_map< string, type_base_wptr > string_type_base_wptr_map_type
A convenience typedef for a map which key is a string and which value is a type_base_wptr.
Definition: abg-ir.h:568
function_decl_sptr clone() const
Create a new instance of function_decl that is a clone of the current one.
Definition: abg-ir.cc:23082
const std::vector< subrange_sptr > & get_subranges() const
Get the array's subranges.
Definition: abg-ir.cc:20229
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:22624
bool is_cplus_plus_language(translation_unit::language l)
Test if a language enumerator designates the C++ language.
Definition: abg-ir.cc:1808
virtual decl_base_sptr add_member_decl(const decl_base_sptr &)
Add a member declaration to the current instance of class_or_union. The member declaration can be eit...
Definition: abg-ir.cc:23982
int64_t get_upper_bound() const
Getter of the upper bound of the subrange type.
Definition: abg-ir.cc:19422
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:17482
void set_binding(binding b)
Setter for the binding of the current instance of elf_symbol.
Definition: abg-ir.cc:2211
virtual void set_alignment_in_bits(size_t)
Setter of the alignment of the class type.
Definition: abg-ir.cc:24061
virtual size_t get_size_in_bits() const
Return the size of the typedef.
Definition: abg-ir.cc:21138
virtual bool operator==(const decl_base &) const
Comparison operator for union_decl.
Definition: abg-ir.cc:27229
friend void fixup_virtual_member_function(method_decl_sptr method)
When a virtual member function has seen its virtualness set by set_member_function_is_virtual(), this function ensures that the member function is added to the specific vectors and maps of virtual member function of its class.
Definition: abg-ir.cc:25960
void sort_virtual_mem_fns()
Sort the virtual member functions by their virtual index.
Definition: abg-ir.cc:25304
void set_parameters(const parameters &p)
Setter for the parameters of the current instance of function_type.
Definition: abg-ir.cc:22092
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Build and return a copy of the pretty representation of the namespace.
Definition: abg-ir.cc:17423
function_decl * is_function_decl(const type_or_decl_base *d)
Test whether a declaration is a function_decl.
Definition: abg-ir.cc:10695
const type_base_sptr get_type() const
Getter of the type of the variable.
Definition: abg-ir.cc:21419
void set_symbol(const elf_symbol_sptr &sym)
This sets the underlying ELF symbol for the current function decl.
Definition: abg-ir.cc:23011
const elf_symbol_sptr get_main_symbol() const
Get the main symbol of an alias chain.
Definition: abg-ir.cc:2397
void fns_to_str(vector< function_decl * >::const_iterator a_begin, vector< function_decl * >::const_iterator a_end, vector< function_decl * >::const_iterator b_begin, vector< function_decl * >::const_iterator b_end, std::ostream &o)
For each sequence of functions given in argument, generate a sequence of string that matches a given ...
Definition: abg-ir.cc:30612
const declarations & get_sorted_member_decls() const
Getter for the sorted member declarations carried by the current scope_decl.
Definition: abg-ir.cc:7899
class_decl_sptr find_base_class(const string &qualified_name) const
Find a base class of a given qualified name for the current class.
Definition: abg-ir.cc:25264
bool has_vtable() const
Test if the current instance has a vtable.
Definition: abg-ir.cc:26041
virtual bool operator==(const decl_base &) const
Return true iff the two decls have the same name.
Definition: abg-ir.cc:5209
const abg_compat::optional< uint32_t > & get_crc() const
Getter of the 'crc' property.
Definition: abg-ir.cc:2328
friend type_or_decl_base::type_or_decl_kind operator|(type_or_decl_base::type_or_decl_kind, type_or_decl_base::type_or_decl_kind)
bitwise "OR" operator for the type_or_decl_base::type_or_decl_kind bitmap type.
Definition: abg-ir.cc:4031
const abg_compat::optional< std::string > & get_namespace() const
Getter of the 'namespace' property.
Definition: abg-ir.cc:2342
bool operator==(const elf_symbol &) const
Test if two main symbols are textually equal, or, if they have aliases that are textually equal...
Definition: abg-ir.cc:2797
abg_compat::optional< uint64_t > hash_t
The abstraction for an 8 bytes hash value.
Definition: abg-ir.h:105
bool operator==(const enumerator &other) const
Equality operator.
Definition: abg-ir.cc:20959
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Build and return the qualified name of the current instance of the array_type_def.
Definition: abg-ir.cc:20139
The abstraction of a pointer type.
Definition: abg-ir.h:2349
friend enum access_specifier get_member_access_specifier(const decl_base &d)
Gets the access specifier for a class member.
Definition: abg-ir.cc:5515
binding
The binding of a symbol.
Definition: abg-ir.h:977
void set_access_specifier(access_specifier a)
Setter for the access specifier of this member.
Definition: abg-ir.h:3866
shared_ptr< class_tdecl > class_tdecl_sptr
Convenience typedef for a shared pointer on a class_tdecl.
Definition: abg-fwd.h:286
void forget_visited_type_nodes()
Un-mark all visited type nodes.
Definition: abg-ir.cc:30227
type_or_decl_kind
This is a bitmap type which instance is meant to contain the runtime type of a given ABI artifact...
Definition: abg-ir.h:1417
Hash functor for instances of typedef_decl.
Definition: abg-hash.h:206
void set_underlying_type(const type_base_sptr &)
Setter of the underlying type.
Definition: abg-ir.cc:17912
void set_earlier_declaration(const decl_base_sptr &)
set the earlier declaration of this decl_base definition.
Definition: abg-ir.cc:4961
void is_const(bool f)
Setter for the 'is-const' property.
Definition: abg-ir.h:4618
friend type_base_sptr synthesize_type_from_translation_unit(const type_base_sptr &type, translation_unit &tu)
In a translation unit, lookup a given type or synthesize it if it's a qualified type.
Definition: abg-ir.cc:15271
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:23900
corpus::origin operator|(corpus::origin l, corpus::origin r)
Bitwise | operator for the corpus::origin type.
Definition: abg-corpus.cc:1774
visibility get_visibility() const
Getter for the visibility of the decl.
Definition: abg-ir.cc:4777
friend type_or_decl_base::type_or_decl_kind & operator|=(type_or_decl_base::type_or_decl_kind &, type_or_decl_base::type_or_decl_kind)
bitwise "|=" operator for the type_or_decl_base::type_or_decl_kind bitmap type.
Definition: abg-ir.cc:4041
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Build and return the pretty representation of this variable.
Definition: abg-ir.cc:21770
elf_symbol_sptr get_alias_which_equals(const elf_symbol &other) const
In the list of aliases of a given elf symbol, get the alias that equals this current symbol...
Definition: abg-ir.cc:2665
virtual bool operator==(const decl_base &) const
Return true iff the two decls have the same name.
Definition: abg-ir.cc:27825
bool is_function() const
Test if the current instance of elf_symbol is a function symbol or not.
Definition: abg-ir.cc:2290
long get_offset_in_bits() const
Getter of the offset of the base.
Definition: abg-ir.cc:25447
type_base_sptr get_canonical_type() const
Getter of the canonical type of the current instance of type_base.
Definition: abg-ir.cc:16373
virtual bool operator!=(const decl_base &) const
Inequality operator.
Definition: abg-ir.cc:5220
virtual size_t get_size_in_bits() const
Getter of the size of the class_or_union type.
Definition: abg-ir.cc:24093
void set_is_constructed(bool)
Setter of the 'is_constructed" flag. It says if the translation unit is fully constructed or not...
Definition: abg-ir.cc:1458
virtual void on_canonical_type_set()
This function is automatically invoked whenever an instance of this type is canonicalized.
Definition: abg-ir.cc:21930
The base class for the visitor type hierarchy used for traversing a translation unit.
Definition: abg-ir.h:4810
ssize_t get_biggest_vtable_offset() const
Get the highest vtable offset of all the virtual methods of the class.
Definition: abg-ir.cc:26055
bool operator==(const version &o) const
Compares the current version against another one.
Definition: abg-ir.cc:3239
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:26838
Equality functor for instances of function_decl.
Definition: abg-ir.h:4771
const interned_string & peek_qualified_name() const
Getter for the qualified name.
Definition: abg-ir.cc:4507
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Getter of the pretty representation of the current instance of union_decl.
Definition: abg-ir.cc:27196
A basic type declaration that introduces no scope.
Definition: abg-ir.h:2117
shared_ptr< enum_type_decl > enum_type_decl_sptr
Convenience typedef for shared pointer to a enum_type_decl.
Definition: abg-fwd.h:172
translation_unit::language string_to_translation_unit_language(const string &l)
Parse a string representing a language into a translation_unit::language enumerator into a string...
Definition: abg-ir.cc:1670
virtual bool traverse(ir_node_visitor &)
Traverse the the ABI artifact.
Definition: abg-ir.cc:4303
const config & get_config() const
Getter of the general configuration object.
Definition: abg-ir.cc:3728
shared_ptr< class_decl > class_decl_sptr
Convenience typedef for a shared pointer on a class_decl.
Definition: abg-fwd.h:190
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Return a copy of the pretty representation of the current method_type.
Definition: abg-ir.cc:22667
bool is_const() const
Getter for the 'is-const' property.
Definition: abg-ir.h:4610
Hasher for the class_decl type.
Definition: abg-hash.h:269
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Compute the qualified name of the decl.
Definition: abg-ir.cc:4823
const type_base_sptr get_return_type() const
Definition: abg-ir.cc:23050
int64_t get_signed_value() const
Getter of the bound value as a signed value.
Definition: abg-ir.cc:19227
const interned_string & peek_temporary_qualified_name() const
Getter of the temporary qualified name of the current declaration.
Definition: abg-ir.cc:4536
const interned_string & get_cached_pretty_representation(bool internal=false) const
Get the pretty representation of the current decl.
Definition: abg-ir.cc:4894
version & operator=(const version &o)
Assign a version to the current one.
Definition: abg-ir.cc:3257
virtual ~template_parameter()
Destructor.
Definition: abg-ir.cc:27649
const istring_type_base_wptrs_map_type & subrange_types() const
Getter for the map that associates the name of a subrange type to the vector of instances of array_ty...
Definition: abg-ir.cc:740
virtual size_t get_size_in_bits() const
Get the size of the qualified type def.
Definition: abg-ir.cc:17651
decl_base_sptr insert_member_decl(decl_base_sptr member)
Insert a data member to this class_or_union type.
Definition: abg-ir.cc:24509
version & get_version() const
Getter for the version of the current instanc of elf_symbol.
Definition: abg-ir.cc:2218
const std::list< template_parameter_sptr > & get_template_parameters() const
Get the list of template parameters of the current instance of template_decl.
Definition: abg-ir.cc:27495
const type_base_sptr get_element_type() const
Getter of the type of an array element.
Definition: abg-ir.cc:20070
bool operator()(const var_decl *l, const var_decl *r) const
Return true if the two instances of var_decl are equal.
Definition: abg-ir.h:4760
The base class for member types, data members and member functions. Its purpose is mainly to carry th...
Definition: abg-ir.h:3838
const enumerators & get_enumerators() const
Definition: abg-ir.cc:20315
friend decl_base_sptr add_decl_to_scope(decl_base_sptr decl, scope_decl *scope)
Appends a declaration to a given scope, if the declaration doesn't already belong to one and if the d...
Definition: abg-ir.cc:8450
string get_name(const type_or_decl_base *tod, bool qualified)
Build and return a copy of the name of an ABI artifact that is either a type or a decl...
Definition: abg-ir.cc:8686
istring_type_base_wptrs_map_type & function_types()
Getter for the map that associates the name of a function type to the vector of instances of function...
Definition: abg-ir.cc:754
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:5236
friend var_decl_sptr copy_member_variable(class_decl_sptr t, const var_decl_sptr &variable)
Copy a data member of a class_or_union into a new class_or_union.
Definition: abg-ir.cc:24962
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Compute the qualified name of the parameter.
Definition: abg-ir.cc:23718
const translation_unit * get_translation_unit() const
Get the translation_unit this ABI artifact belongs to.
Definition: abg-ir.cc:4295
language
The language of the translation unit.
Definition: abg-ir.h:707
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:26506
void set_is_const(bool)
Setter of the "is-const" property of method_type.
Definition: abg-ir.cc:22675
bool function_decl_is_less_than(const function_decl &f, const function_decl &s)
Test if the pretty representation of a given function_decl is lexicographically less then the pretty ...
Definition: abg-ir.cc:28797
const string & get_qualified_name(bool internal=false) const
Getter for the qualified name of the current instance of enum_type_decl::enumerator. The first invocation of the method builds the qualified name, caches it and return a reference to the cached qualified name. Subsequent invocations just return the cached value.
Definition: abg-ir.cc:20998
virtual bool operator==(const decl_base &) const
Equality operator.
Definition: abg-ir.cc:20833
void maybe_fixup_members_of_anon_data_member(var_decl_sptr &anon_dm)
Fixup the members of the type of an anonymous data member.
Definition: abg-ir.cc:24019
type_base_sptr get_underlying_type() const
Return the underlying type of the enum.
Definition: abg-ir.cc:20310
void set_enum_type(enum_type_decl *)
Setter for the enum type that this enumerator is for.
Definition: abg-ir.cc:21043
void set_naming_typedef(const typedef_decl_sptr &)
Set the naming typedef of the current instance of decl_base.
Definition: abg-ir.cc:4733
const var_decl * lookup_data_member(const type_base *type, const char *dm_name)
Look for a data member of a given class, struct or union type and return it.
Definition: abg-ir.cc:29100
location()
Default constructor for the location type.
Definition: abg-ir.h:389
void set_artificial_location(const location &)
Setter of the artificial location of the artificat.
Definition: abg-ir.cc:4220
const void * type_or_decl_base_pointer() const
Getter of the pointer to either the type_base sub-object of the current instance if it's a type...
Definition: abg-ir.cc:4169
corpus::origin operator|=(corpus::origin &l, corpus::origin r)
Bitwise |= operator for the corpus::origin type.
Definition: abg-corpus.cc:1788
virtual bool operator==(const decl_base &) const
Comparison operator of var_decl.
Definition: abg-ir.cc:21675
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:17860
void set_is_static(bool f)
Set a flag saying if the parameter is static or not.
Definition: abg-ir.h:3878
void set_size(size_t)
Setter of the size of the symbol.
Definition: abg-ir.cc:2197
void set_binding(binding b)
Setter of the binding of the variable.
Definition: abg-ir.cc:21451
This means that a given IR artifact has a local type change.
Definition: abg-ir.h:1365
friend ssize_t get_member_function_vtable_offset(const function_decl &)
Get the vtable offset of a member function.
Definition: abg-ir.cc:6578
This abstracts the global scope of a given translation unit.
Definition: abg-ir.h:1981
bool has_virtual_bases() const
Test if the current instance of class_decl has at least one virtual base.
Definition: abg-ir.cc:26022
A comparison functor to compare translation units based on their absolute paths.
Definition: abg-ir.h:871
bool get_has_anonymous_parent() const
Get the "has_anonymous_parent" flag of the current declaration.
Definition: abg-ir.cc:4690
unordered_map< string, method_decl * > string_mem_fn_ptr_map_type
Convenience typedef.
Definition: abg-ir.h:4010
const scope_decl_sptr & get_global_scope() const
Getter of the the global scope of the translation unit.
Definition: abg-ir.cc:1221
virtual bool operator==(const decl_base &) const
Equality operator.
Definition: abg-ir.cc:19587
friend class_decl * is_class_type(const type_or_decl_base *)
Test whether a type is a class.
Definition: abg-ir.cc:11174
const istring_type_base_wptrs_map_type & basic_types() const
Getter for the map that associates the name of a basic type to the vector instances of type_decl_sptr...
Definition: abg-ir.cc:595
size_t get_size() const
Getter of the size of the symbol.
Definition: abg-ir.cc:2190
array_type_def::subrange_type * is_subrange_type(const type_or_decl_base *type)
Test if a type is an array_type_def::subrange_type.
Definition: abg-ir.cc:12215
A predicate for deep equality of instances of shared_ptr
Definition: abg-ir.h:2095
virtual void set_scope(scope_decl *)
Setter of the scope of the current decl.
Definition: abg-ir.cc:5247
void set_pointed_to_type(const type_base_sptr &)
Set the pointed-to type of the pointer.
Definition: abg-ir.cc:18144
Hash functor for instances of array_type_def::hash.
Definition: abg-hash.h:186
void set_language(language l)
Setter of the language of the source code of the translation unit.
Definition: abg-ir.cc:1285
bool find_iterator_for_member(const decl_base *, declarations::iterator &)
Find a member of the current scope and return an iterator on it.
Definition: abg-ir.cc:8372
istring_type_base_wptrs_map_type & union_types()
Getter for the map that associates the name of a union type to the vector of instances of union_decl_...
Definition: abg-ir.cc:623
The abstraction of an interned string.
A comparison functor to compare pointer to instances of type_or_decl_base.
Definition: abg-ir.h:3293
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:17217
elf_symbol_sptr update_main_symbol(const std::string &)
Update the main symbol for a group of aliased symbols.
Definition: abg-ir.cc:2496
bool operator!=(const context_rel &o) const
Inequality operator.
Definition: abg-ir.h:1351
bool get_is_anonymous() const
Test if the current declaration is anonymous.
Definition: abg-ir.cc:4668
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Get the pretty representation of the current instance of type_decl.
Definition: abg-ir.cc:17197
virtual bool traverse(ir_node_visitor &)
Default implementation of traversal for types. This function does nothing. It must be implemented by ...
Definition: abg-ir.cc:16518
string get_string_representation_of_cv_quals(const qualified_type_def::CV cv_quals)
Get the string representation of a CV qualifier bitmap.
Definition: abg-ir.cc:8656
std::vector< subrange_sptr > subranges_type
Convenience typedef for a vector of subrange_sptr.
Definition: abg-ir.h:2569
elf_symbol_sptr get_next_alias() const
Get the next alias of the current symbol.
Definition: abg-ir.cc:2418
istring_type_base_wptrs_map_type & array_types()
Getter for the map that associates the name of an array type to the vector of instances of array_type...
Definition: abg-ir.cc:719
friend void set_member_access_specifier(decl_base &d, access_specifier a)
Sets the access specifier for a class member.
Definition: abg-ir.cc:5544
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Implementation for the virtual qualified name builder for type_decl.
Definition: abg-ir.cc:17138
Abstraction for an array range type, like in Ada, or just for an array dimension like in C or C++...
Definition: abg-ir.h:2573
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:20202
const type_maps & get_types() const
Getter of the types of the current translation_unit.
Definition: abg-ir.cc:1248
size_t vtable_offset() const
Getter for the vtable offset property.
Definition: abg-ir.h:4555
virtual const interned_string & get_scoped_name() const
Return the scoped name of the decl.
Definition: abg-ir.cc:4945
Hashing functor for the method_type type.
Definition: abg-hash.h:229
void set_underlying_type(const type_base_sptr &)
Setter ofthe underlying type of the typedef.
Definition: abg-ir.cc:21283
bool canonicalization_started() const
Getter of a flag saying if the canonicalization process has started or not.
Definition: abg-ir.cc:3558
ir_node_visitor()
Default Constructor of the ir_node_visitor type.
Definition: abg-ir.cc:30167
The abstraction of the version of an ELF symbol.
Definition: abg-ir.h:1231
virtual bool operator==(const type_base &) const
Equality operator for function_type.
Definition: abg-ir.cc:22401
const type_base_sptrs_type & get_sorted_canonical_types() const
Return a vector of sorted canonical types of the current scope.
Definition: abg-ir.cc:7857
const std::string & get_path() const
Get the path of the current translation unit.
Definition: abg-ir.cc:1298
virtual size_t get_num_anonymous_member_classes() const
Get the number of anonymous member classes contained in this class.
Definition: abg-ir.cc:24108
size_t operator()(const type_or_decl_base_sptr &artifact) const
Function-call Operator to hash the string representation of an ABI artifact.
Definition: abg-ir.h:551
The hashing functor for class_decl::base_spec.
Definition: abg-hash.h:259
istring_type_base_wptrs_map_type & ptr_to_mbr_types()
Getter for the map that associates the name of a pointer-to-member type to the vector of instances of...
Definition: abg-ir.cc:684
bool is_empty() const
Test if the current scope is empty.
Definition: abg-ir.cc:7988
const parameter_sptr get_parm_at_index_from_first_non_implicit_parm(size_t) const
Get the Ith parameter of the vector of parameters of the current instance of function_type.
Definition: abg-ir.cc:22071
void append_parameters(std::vector< parameter_sptr > &parms)
Append a vector of parameters to the type of this function.
Definition: abg-ir.cc:23069
unordered_map< interned_string, type_or_decl_base_sptr, hash_interned_string > istring_type_or_decl_base_sptr_map_type
A convenience typedef for a map which key is an interned_string and which value is a type_base_wptr...
Definition: abg-ir.h:584
bound_value()
Default constructor of the array_type_def::subrange_type::bound_value class.
Definition: abg-ir.cc:19185
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:25422
The hashing functor for using instances of type_or_decl_base as values in a hash map or set...
Definition: abg-ir.h:525
const data_members & get_data_members() const
Get the data members of this class_or_union.
Definition: abg-ir.cc:24233
Abstracts a template template parameter.
Definition: abg-ir.h:3694
void set_symbol(const elf_symbol_sptr &sym)
Sets the underlying ELF symbol for the current variable.
Definition: abg-ir.cc:21466
This type abstracts the configuration information of the library.
Definition: abg-config.h:17
bool operator()(const type_or_decl_base_sptr &f, const type_or_decl_base_sptr &s)
Comparison operator for ABI artifacts.
Definition: abg-ir.h:3328
This means that a given IR artifact has a local non-type change. That is a change that is carried by ...
Definition: abg-ir.h:1370
bool is_in_ksymtab() const
Getter of the 'is-in-ksymtab' property.
Definition: abg-ir.cc:2313
bool has_artificial_location() const
Test if the current ABI artifact carries an artificial location.
Definition: abg-ir.cc:4245
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:23884
void set_is_artificial(bool)
Setter of the flag that says if the artefact is artificial.
Definition: abg-ir.cc:4103
Hash functor for instances of array_type_def::subrange_type.
Definition: abg-hash.h:176
void set_name(const string &n)
Setter for the name of the current intance of elf_symbol.
Definition: abg-ir.cc:2166
vector< var_decl_sptr > data_members
Convenience typedef.
Definition: abg-ir.h:4007
bool operator()(const type_or_decl_base *l, const type_or_decl_base *r) const
The function-call operator to compare the string representations of two ABI artifacts.
Definition: abg-ir.h:498
friend bool equals(const class_or_union &, const class_or_union &, change_kind *)
Compares two instances of class_or_union.
Definition: abg-ir.cc:24613
location & get_artificial_location() const
Getter of the artificial location of the artifact.
Definition: abg-ir.cc:4238
void set_value(int64_t v)
Setter for the value of enum_type_decl::enumerator.
Definition: abg-ir.cc:21029
access_specifier
Access specifier for class members.
Definition: abg-ir.h:916
void set_visibility(visibility v)
Setter of the visibility of the current instance of elf_symbol.
Definition: abg-ir.cc:2236
void set_namespace(const abg_compat::optional< std::string > &ns)
Setter of the 'namespace' property.
Definition: abg-ir.cc:2349
environment()
Default constructor of the environment type.
Definition: abg-ir.cc:3369
string get_pretty_representation(const type_or_decl_base *tod, bool internal)
Build and return a copy of the pretty representation of an ABI artifact that could be either a type o...
Definition: abg-ir.cc:9286
shared_ptr< template_decl > template_decl_sptr
Convenience typedef for a shared pointer to template_decl.
Definition: abg-fwd.h:303
void is_constructor(bool f)
Setter for the 'is-constructor' property.
Definition: abg-ir.h:4583
void append_parameter(parameter_sptr parm)
Append a parameter to the type of this function.
Definition: abg-ir.cc:23062
virtual ~ptr_to_mbr_type()
Desctructor for ptr_to_mbr_type.
Definition: abg-ir.cc:19110
bool find_enumerator_by_name(const string &name, enum_type_decl::enumerator &result)
Find an enumerator by its name.
Definition: abg-ir.cc:20385
type_base * get_naked_canonical_type() const
Getter of the canonical type pointer.
Definition: abg-ir.cc:16389
void set_element_type(const type_base_sptr &element_type)
Setter of the type of array element.
Definition: abg-ir.cc:20085
const decl_base * get_naked_definition_of_declaration() const
If this decl_base is declaration-only, get its definition, if any.
Definition: abg-ir.cc:4989
void set_type(type_base_sptr &)
Setter of the type of the variable.
Definition: abg-ir.cc:21426
bool operator==(const bound_value &) const
Equality operator of the bound value.
Definition: abg-ir.cc:19264
virtual bool operator==(const decl_base &o) const
Equality operator.
Definition: abg-ir.cc:27529
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:18364
const type_base * get_naked_type() const
Getter of the type of the variable.
Definition: abg-ir.cc:21437
const corpus * get_corpus() const
Get the corpus this ABI artifact belongs to.
Definition: abg-ir.cc:4270
The hashing functor for member_base.
Definition: abg-hash.h:242
type get_type() const
Getter for the type of the current instance of elf_symbol.
Definition: abg-ir.cc:2176
void set_name(const string &n)
Setter for the name of enum_type_decl::enumerator.
Definition: abg-ir.cc:21014
friend void set_member_is_static(const decl_base_sptr &d, bool s)
Sets the static-ness property of a class member.
Definition: abg-ir.cc:26984
bool is_variadic() const
Return true iff the function takes a variable number of parameters.
Definition: abg-ir.cc:23294
const function_decl::parameter * get_function_parameter(const decl_base *fun, unsigned parm_index)
Get the function parameter designated by its index.
Definition: abg-ir.cc:29143
binding get_binding() const
Get the binding of the function template.
Definition: abg-ir.cc:28122
shared_ptr< template_parameter > template_parameter_sptr
Convenience typedef for shared pointer to template parameter.
Definition: abg-fwd.h:311
virtual void get_qualified_name(interned_string &qualified_name, bool internal=false) const
Build and return the qualified name of the current instance of the reference_type_def.
Definition: abg-ir.cc:18693
bool equals(const decl_base &l, const decl_base &r, change_kind *k)
Compares two instances of decl_base.
Definition: abg-ir.cc:5138
corpus::origin operator&(corpus::origin l, corpus::origin r)
Bitwise & operator for the corpus::origin type.
Definition: abg-corpus.cc:1802
virtual bool traverse(ir_node_visitor &v)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:20441
The abstraction of a typedef declaration.
Definition: abg-ir.h:2934
virtual bool operator==(const decl_base &) const
Return true iff both scopes have the same names and have the same member decls.
Definition: abg-ir.cc:8326
friend void set_member_is_static(decl_base &d, bool s)
Sets the static-ness property of a class member.
Definition: abg-ir.cc:26893
This abstracts a composition of types based on template type parameters. The result of the compositio...
Definition: abg-ir.h:3729
friend bool get_member_function_is_virtual(const function_decl &f)
Test if a given member function is virtual.
Definition: abg-ir.cc:6641
const string & get_id_string() const
Get a string that is representative of a given elf_symbol.
Definition: abg-ir.cc:2616
const type_base_sptr get_pointed_to_type() const
Getter of the pointed-to type.
Definition: abg-ir.cc:18250
vector< base_spec_sptr > base_specs
Convenience typedef.
Definition: abg-ir.h:4193
Hash functor for instances of ptr_to_mbr_type.
Definition: abg-hash.h:163
virtual bool traverse(ir_node_visitor &)
This implements the ir_traversable_base::traverse pure virtual function.
Definition: abg-ir.cc:8420
shared_ptr< string_elf_symbols_map_type > string_elf_symbols_map_sptr
Convenience typedef for a shared pointer to string_elf_symbols_map_type.
Definition: abg-ir.h:951
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:27172
virtual bool traverse(ir_node_visitor &v)
Traverse the diff sub-tree under the current instance function_decl.
Definition: abg-ir.cc:23694
virtual size_t get_alignment_in_bits() const
Getter for the alignment of the type.
Definition: abg-ir.cc:16506
void is_destructor(bool f)
Setter for the 'is-destructor' property.
Definition: abg-ir.h:4600
interned_string get_type_name() const
Definition: abg-ir.cc:23517
int64_t get_lower_bound() const
Getter of the lower bound of the subrange type.
Definition: abg-ir.cc:19429
void set_address_size(char)
Setter of the address size in this translation unit.
Definition: abg-ir.cc:1426
const type_base_sptr & get_variadic_parameter_type() const
Get a type_decl instance that represents a the type of a variadic function parameter. This node must be the only one representing a variadic parameter type in the system.
Definition: abg-ir.cc:3506
const function_type * get_naked_type() const
Fast getter of the type of the current instance of function_decl.
Definition: abg-ir.cc:22989
bool operator==(const location &other) const
Equality operator of the location type.
Definition: abg-ir.h:411
bool has_virtual_member_functions() const
Test if the current instance of class_decl has virtual member functions.
Definition: abg-ir.cc:26013
virtual void append_subranges(const std::vector< subrange_sptr > &subs)
Append subranges from the vector.
Definition: abg-ir.cc:20095
static string & get_variadic_parameter_type_name()
Getter of the name of the variadic parameter type.
Definition: abg-ir.cc:3519
friend bool maybe_compare_as_member_decls(const decl_base &l, const decl_base &r, change_kind *k)
Compare the properties that belong to the "is-a-member-relation" of a decl.
Definition: abg-ir.cc:5069
friend bool var_equals_modulo_types(const var_decl &, const var_decl &, change_kind *)
Compares two instances of var_decl without taking their type into account.
Definition: abg-ir.cc:21550
Base class for a template parameter. Client code should use the more specialized type_template_parame...
Definition: abg-ir.h:3598
string expand(void) const
Expand the location into a string.
Definition: abg-ir.cc:472
void set_lower_bound(int64_t lb)
Setter of the lower bound.
Definition: abg-ir.cc:19443
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Get the pretty representation of the current instance of array_type_def.
Definition: abg-ir.cc:19852
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:18957
shared_ptr< subrange_type > subrange_sptr
Convenience typedef for a shared pointer on a function_decl::subrange.
Definition: abg-ir.h:2562
const virtual_mem_fn_map_type & get_virtual_mem_fns_map() const
Get the map that associates a virtual table offset to the virtual member functions with that virtual ...
Definition: abg-ir.cc:25299
const var_decl * get_anonymous_data_member() const
Return a non-nil value if this data member context relationship has an anonymous data member...
Definition: abg-ir.cc:3344
virtual string get_pretty_representation(bool internal=false, bool qualified_name=true) const
Get the pretty representation of the current instance of enum_type_decl.
Definition: abg-ir.cc:20416
namespace_decl(const environment &env, const string &name, const location &locus, visibility vis=VISIBILITY_DEFAULT)
Constructor.
Definition: abg-ir.cc:17385
virtual void set_linkage_name(const string &)
Set the linkage name of the method.
Definition: abg-ir.cc:25704
shared_ptr< array_type_def > array_type_def_sptr
Convenience typedef for a shared pointer on a array_type_def.
Definition: abg-fwd.h:241
bool equals_modulo_cv_qualifier(const array_type_def *l, const array_type_def *r)
Test if two array types are equals modulo CV qualifiers.
Definition: abg-ir.cc:19932
shared_ptr< pointer_type_def > pointer_type_def_sptr
Convenience typedef for a shared pointer on a pointer_type_def.
Definition: abg-fwd.h:223
void set_crc(const abg_compat::optional< uint32_t > &crc)
Setter of the 'crc' property.
Definition: abg-ir.cc:2335
bool operator==(const ptr_to_mbr_type &) const
Equality operator for the current ptr_to_mbr_type.
Definition: abg-ir.cc:19018
friend bool get_member_function_is_ctor(const function_decl &)
Test whether a member function is a constructor.
Definition: abg-ir.cc:6395
unsigned get_value() const
Get the value of the location.
Definition: abg-ir.h:395
friend void remove_decl_from_scope(decl_base_sptr)
Remove a given decl from its scope.
Definition: abg-ir.cc:8475
binding
ELF binding.
Definition: abg-ir.h:1635
string get_pretty_representation(diff *d)
Get a copy of the pretty representation of a diff node.
const decl_base_sptr get_definition_of_declaration() const
If this decl_base is declaration-only, get its definition, if any.
Definition: abg-ir.cc:4973
virtual bool operator==(const decl_base &) const
Return true iff both instances of pointer_type_def are equal.
Definition: abg-ir.cc:18206
bool does_alias(const elf_symbol &) const
Test if the current symbol aliases another one.
Definition: abg-ir.cc:2811
char get_address_size() const
Getter of the address size in this translation unit.
Definition: abg-ir.cc:1419
bool is_empty() const
Tests whether if the current translation unit contains ABI artifacts or not.
Definition: abg-ir.cc:1408
virtual bool is_non_finite() const
Definition: abg-ir.cc:20109
const type_base_sptr & get_void_pointer_type() const
Getter of the "pointer-to-void" IR node that is shared across the ABI corpus. This node must be the o...
Definition: abg-ir.cc:3487
const method_decl * find_member_function(const string &mangled_name) const
Find a method, using its linkage name as a key.
Definition: abg-ir.cc:24386
virtual bool operator==(const decl_base &) const
Comparison operator for the function_tdecl type.
Definition: abg-ir.cc:28131
void add_common_instance(const elf_symbol_sptr &)
Add a common instance to the current common elf symbol.
Definition: abg-ir.cc:2571
Abstraction of a function type.
Definition: abg-ir.h:3419
enum type_or_decl_kind kind() const
Getter for the "kind" property of type_or_decl_base type.
Definition: abg-ir.cc:4114
string build_name(bool, bool internal=false) const
Build the name of the current instance of qualified type.
Definition: abg-ir.cc:17554
void set_pattern(class_decl_sptr p)
Setter of the pattern of the template.
Definition: abg-ir.cc:28274
virtual hash_t hash_value() const
Return the hash value of the current IR node.
Definition: abg-ir.cc:4191
friend uint64_t get_absolute_data_member_offset(const var_decl &m)
Get the absolute offset of a data member.
Definition: abg-ir.cc:6273
The entry point to manage locations.
Definition: abg-ir.h:448
method_decl_sptr find_member_function_sptr(const string &mangled_name)
Find a method, using its linkage name as a key.
Definition: abg-ir.cc:24412
const vector< type_base_sptr > * get_canonical_types(const char *name) const
Get the vector of canonical types which have a given "string representation".
Definition: abg-ir.cc:3875
void set_version(const version &v)
Setter for the version of the current instance of elf_symbol.
Definition: abg-ir.cc:2225
CV
Bit field values representing the cv qualifiers of the underlying type.
Definition: abg-ir.h:2254
virtual ~type_or_decl_base()
The destructor of the type_or_decl_base type.
Definition: abg-ir.cc:4080
visibility
ELF visibility.
Definition: abg-ir.h:1625
void add_base_specifier(shared_ptr< base_spec > b)
Add a base specifier to this class.
Definition: abg-ir.cc:25244
friend hash_t set_or_get_cached_hash_value(const T &type_or_decl)
Set the hash value of an IR node and return it.
Definition: abg-ir-priv.h:415
bool is_java_language(translation_unit::language l)
Test if a language enumerator designates the Java language.
Definition: abg-ir.cc:1824
void set_is_in_public_symbol_table(bool)
Set the flag saying if this decl is from a symbol that is in a public symbols table, defined as public (global or weak).
Definition: abg-ir.cc:4585
const var_decl_sptr find_data_member(const string &) const
Find a data member of a given name in the current class_or_union.
Definition: abg-ir.cc:24244
The abstraction of a namespace declaration.
Definition: abg-ir.h:2206
const base_specs & get_base_specifiers() const
Get the base specifiers for this class.
Definition: abg-ir.cc:25254