libabigail
abg-fwd.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-2023 Red Hat, Inc.
5
6/// @file
7
8#ifndef __ABG_IRFWD_H__
9#define __ABG_IRFWD_H__
10
11#include <stdint.h>
12#include <cstddef>
13#include <cstdlib>
14#include <regex.h>
15#include <list>
16#include <memory>
17#include <ostream>
18#include <string>
19#include <typeinfo>
20#include <unordered_map>
21#include <unordered_set>
22#include <utility> // for std::rel_ops, at least.
23#include <vector>
24#include "abg-interned-str.h"
25#include "abg-hash.h"
26
27/// Toplevel namespace for libabigail.
28namespace abigail
29{
30/**
31 @mainpage libabigail
32
33 This is the API documentation of the Application Binary
34 Interface Generic Analysis and Instrumentation Library, aka,
35 <em>libabigail</em>.
36
37 Check out <a href="http://sourceware.org/libabigail"> the project
38 homepage</a>!
39
40 The current libabigail source code can be browsed at
41 http://sourceware.org/git/gitweb.cgi?p=libabigail.git
42
43 It can be checked out with:
44 <em>git clone git://sourceware.org/git/libabigail.git</em>
45
46 The mailing list to send messages and patches to is
47 libabigail@sourceware.org.
48
49 You can hang out with libabigail developers and users on irc at
50 irc://irc.oftc.net\#libabigail.
51*/
52
53// Inject some types.
54using std::shared_ptr;
55using std::weak_ptr;
56using std::unordered_map;
57using std::string;
58using std::vector;
59using std::unordered_set;
60
61typedef unordered_set<string> string_set_type;
62
63// Pull in relational operators.
64using namespace std::rel_ops;
65
66namespace comparison
67{
68class diff_context;
69
70/// Convenience typedef for a shared pointer of @ref diff_context.
71typedef shared_ptr<diff_context> diff_context_sptr;
72
73/// Convenience typedef for a weak pointer of @ref diff_context.
74typedef weak_ptr<diff_context> diff_context_wptr;
75
76class diff;
77
78/// Convenience typedef for a shared_ptr for the @ref diff class
79typedef shared_ptr<diff> diff_sptr;
80
81/// Convenience typedef for a weak_ptr for the @ref diff class
82typedef weak_ptr<diff> diff_wptr;
83}
84
85namespace regex
86{
87/// A convenience typedef for a shared pointer of regex_t.
88typedef std::shared_ptr<regex_t> regex_t_sptr;
89}// end namespace regex
90
91namespace ir
92{
93
94// Forward declarations for corpus.
95
96class corpus;
97typedef shared_ptr<corpus> corpus_sptr;
98
99class corpus_group;
100typedef shared_ptr<corpus_group> corpus_group_sptr;
101
102// Forward declarations for ir.
103
104class ir_node_visitor;
105
107
108/// Convenience typedef for a shared pointer to @ref
109/// ir_traversable_base.
110typedef shared_ptr<ir_traversable_base> ir_traversable_base_sptr;
111
112class environment;
113/// Convenience typedef for a shared pointer to an @ref environment
114typedef shared_ptr<environment> environment_sptr;
115
116class location;
117class location_manager;
118
120/// A convenience typedef for a shared_ptr to @ref type_or_decl_base.
121typedef shared_ptr<type_or_decl_base> type_or_decl_base_sptr;
122
123class type_base;
124
125// Convenience typedef for a shared pointer on a @ref type_base
126typedef shared_ptr<type_base> type_base_sptr;
127
128/// Convenience typedef for a weak pointer on a @ref type_base
129typedef weak_ptr<type_base> type_base_wptr;
130
131/// Convenience typedef for a weak pointer to a @ref corpus.
132typedef weak_ptr<corpus> corpus_wptr;
133
134class translation_unit;
135/// Convenience typedef for a shared pointer on a @ref
136/// translation_unit type.
137typedef shared_ptr<translation_unit> translation_unit_sptr;
138/// Convenience typedef for a map that associates a string to a
139/// translation unit.
140typedef unordered_map<string, translation_unit_sptr> string_tu_map_type;
141
142/// A convenience typedef for a vector of type_base_wptr.
143typedef vector<type_base_wptr> type_base_wptrs_type;
144
145/// A convenience typedef for a map which key is an interned_string
146/// and which value is a vector of type_base_wptr.
147typedef unordered_map<interned_string,
150
151class decl_base;
152
153// Convenience typedef for a smart pointer on @ref decl_base.
154typedef shared_ptr<decl_base> decl_base_sptr;
155
156class type_decl;
157/// Convenience typedef for a shared pointer on a @ref type_decl.
158typedef shared_ptr<type_decl> type_decl_sptr;
159
160
161class typedef_decl;
162
163/// Convenience typedef for a shared pointer on a @ref typedef_decl.
164typedef shared_ptr<typedef_decl> typedef_decl_sptr;
165
166/// Convenience typedef for a weak pointer on a @ref typedef_decl.
167typedef weak_ptr<typedef_decl> typedef_decl_wptr;
168
169class enum_type_decl;
170
171/// Convenience typedef for shared pointer to a @ref enum_type_decl.
172typedef shared_ptr<enum_type_decl> enum_type_decl_sptr;
173
174/// Convenience typedef for a vector of @ref enum_type_decl_sptr
175typedef vector<enum_type_decl_sptr> enums_type;
176
177/// Convenience typedef for a weak pointer to a @ref decl_base.
178typedef weak_ptr<decl_base> decl_base_wptr;
179
180class class_or_union;
181
182typedef shared_ptr<class_or_union> class_or_union_sptr;
183typedef weak_ptr<class_or_union> class_or_union_wptr;
184
185class scope_type_decl;
186
187class class_decl;
188
189/// Convenience typedef for a shared pointer on a @ref class_decl
190typedef shared_ptr<class_decl> class_decl_sptr;
191
192/// Convenience typedef for a vector of @ref class_decl_sptr
193typedef vector<class_decl_sptr> classes_type;
194
195/// Convenience typedef for a vector of @ref class_or_union_sptr
196typedef vector<class_or_union_sptr> classes_or_unions_type;
197
198/// Convenience typedef for a weak pointer on a @ref class_decl.
199typedef weak_ptr<class_decl> class_decl_wptr;
200
201class union_decl;
202
203typedef shared_ptr<union_decl> union_decl_sptr;
204
205class function_type;
206/// Convenience typedef for a shared pointer on a @ref function_type
207typedef shared_ptr<function_type> function_type_sptr;
208
209/// Convenience typedef fo a vector of @ref function_type_sptr
210typedef vector<function_type_sptr> function_types_type;
211
212/// Convenience typedef for a weak pointer on a @ref function_type
213typedef weak_ptr<function_type> function_type_wptr;
214
215class method_type;
216
217/// Convenience typedef for shared pointer to @ref method_type.
218typedef shared_ptr<method_type> method_type_sptr;
219
220class pointer_type_def;
221
222/// Convenience typedef for a shared pointer on a @ref pointer_type_def
223typedef shared_ptr<pointer_type_def> pointer_type_def_sptr;
224
226
227typedef shared_ptr<qualified_type_def> qualified_type_def_sptr;
228
230
231/// Convenience typedef for a shared pointer on a @ref reference_type_def
232typedef shared_ptr<reference_type_def> reference_type_def_sptr;
233
234class array_type_def;
235
236/// Convenience typedef for a shared pointer on a @ref array_type_def
237typedef shared_ptr<array_type_def> array_type_def_sptr;
238
239class subrange_type;
240
241class dm_context_rel;
242
243/// A convenience typedef for a shared pointer to dm_context_rel.
244typedef shared_ptr<dm_context_rel> dm_context_rel_sptr;
245
246class var_decl;
247
248/// Convenience typedef for a shared pointer on a @ref var_decl
249typedef shared_ptr<var_decl> var_decl_sptr;
250
251/// Convenience typedef for a weak pointer on a @ref var_decl
252typedef weak_ptr<var_decl> var_decl_wptr;
253
254typedef unordered_map<interned_string,
255 var_decl*,
256 hash_interned_string> istring_var_decl_ptr_map_type;
257
258class scope_decl;
259
260/// Convenience typedef for a shared pointer on a @ref scope_decl.
261typedef shared_ptr<scope_decl> scope_decl_sptr;
262
263class function_decl;
264
265/// Convenience typedef for a shared pointer on a @ref function_decl
266typedef shared_ptr<function_decl> function_decl_sptr;
267
268typedef unordered_map<interned_string,
270 hash_interned_string> istring_function_decl_ptr_map_type;
271
272class method_decl;
273
274typedef shared_ptr<method_decl> method_decl_sptr;
275
277
278/// A convenience typedef for a shared pointer to @ref
279/// mem_fn_context_rel.
280typedef shared_ptr<mem_fn_context_rel> mem_fn_context_rel_sptr;
281
282class namespace_decl;
283
284/// Convenience typedef for a shared pointer on namespace_decl.
285typedef shared_ptr<namespace_decl> namespace_decl_sptr;
286
287class class_tdecl;
288
289/// Convenience typedef for a shared pointer on a @ref class_tdecl
290typedef shared_ptr<class_tdecl> class_tdecl_sptr;
291
292class function_tdecl;
293
294/// Convenience typedef for a shared pointer on a @ref function_tdecl
295typedef shared_ptr<function_tdecl> function_tdecl_sptr;
296
297class global_scope;
298
299/// Convenience typedef for shared pointer on @ref global_scope.
300typedef shared_ptr<global_scope> global_scope_sptr;
301
302class node_visitor;
303
304class template_decl;
305
306/// Convenience typedef for a shared pointer to @ref template_decl
307typedef shared_ptr<template_decl> template_decl_sptr;
308
309/// Convenience typedef for a weak pointer to template_decl
310typedef weak_ptr<template_decl> template_decl_wptr;
311
313
314/// Convenience typedef for shared pointer to template parameter
315typedef shared_ptr<template_parameter> template_parameter_sptr;
316
318
319/// Convenience typedef for shared pointer to @ref
320/// non_type_template_parameter
321typedef shared_ptr<non_type_tparameter> non_type_tparameter_sptr;
322
323class type_tparameter;
324
326
327/// Convenience typedef for a shared_ptr to @ref template_tparameter.
328typedef shared_ptr<template_tparameter> template_tparameter_sptr;
329
330/// Convenience typedef for a shared pointer to @ref type_tparameter.
331typedef shared_ptr<type_tparameter> type_tparameter_sptr;
332
333class type_composition;
334
336typedef shared_ptr<member_function_template> member_function_template_sptr;
337typedef vector<member_function_template_sptr> member_function_templates;
338
340typedef shared_ptr<member_class_template> member_class_template_sptr;
341typedef vector<member_class_template_sptr> member_class_templates;
342
343/// Convenience typedef for shared pointer to type_composition
344typedef shared_ptr<type_composition> type_composition_sptr;
345
346decl_base_sptr
347add_decl_to_scope(decl_base_sptr, scope_decl*);
348
349decl_base_sptr
350add_decl_to_scope(decl_base_sptr, const scope_decl_sptr&);
351
352const global_scope*
354
355const global_scope*
357
358const global_scope*
359get_global_scope(const decl_base_sptr);
360
363
366
368get_translation_unit(const decl_base_sptr);
369
370bool
372
373const global_scope*
375
376bool
378
379bool
381
382bool
383is_at_global_scope(const decl_base_sptr);
384
385bool
387
389is_at_class_scope(const decl_base_sptr);
390
393
396
397bool
398is_at_template_scope(const decl_base_sptr);
399
400bool
401is_template_parameter(const decl_base_sptr);
402
405
408
409bool
411
414
415decl_base_sptr
417
420
421decl_base_sptr
423
424bool
426
429
430type_base_sptr
432
433bool
435
436bool
437is_anonymous_type(const type_base_sptr&);
438
439const type_decl*
441
444
447
450
453
454const typedef_decl*
456
457const typedef_decl*
458is_typedef(const type_base*);
459
462
464is_compatible_with_enum_type(const type_base_sptr&);
465
467is_compatible_with_enum_type(const decl_base_sptr&);
468
471
472const enum_type_decl*
474
475bool
477
480
483
484bool
486 bool look_through_decl_only = false);
487
488bool
489is_declaration_only_class_or_union_type(const type_base_sptr& t,
490 bool look_through_decl_only = false);
491
494
495class_or_union_sptr
497
498bool
500
503
504union_decl_sptr
506
508is_compatible_with_class_type(const type_base_sptr&);
509
511is_compatible_with_class_type(const decl_base_sptr&);
512
515
516const pointer_type_def*
518
521
522bool
524
525bool
527
528bool
530
533
536
539
540const type_base*
542
543const type_base_sptr
544is_void_pointer_type(const type_base_sptr&);
545
546const type_base*
548
549const type_base*
551
554
555qualified_type_def_sptr
557
560
563
564const function_type*
566
569
570const method_type*
572
575
576class_or_union_sptr
578
579class_or_union_sptr
580look_through_decl_only_class(class_or_union_sptr);
581
584
587
590
591decl_base_sptr
593
596
597decl_base_sptr
598look_through_decl_only(const decl_base_sptr&);
599
602
605
607is_namespace(const decl_base_sptr&);
608
610is_namespace(const decl_base*);
611
612bool
613is_template_parm_composition_type(const decl_base_sptr);
614
615bool
616is_template_decl(const decl_base_sptr);
617
618bool
619is_function_template_pattern(const decl_base_sptr);
620
621
622decl_base_sptr
623insert_decl_into_scope(decl_base_sptr,
624 vector<decl_base_sptr >::iterator,
625 scope_decl*);
626
627decl_base_sptr
628insert_decl_into_scope(decl_base_sptr,
629 vector<decl_base_sptr >::iterator,
631
632bool
633has_scope(const decl_base&);
634
635bool
636has_scope(const decl_base_sptr);
637
638bool
639is_member_decl(const decl_base_sptr);
640
641bool
643
644bool
646
649
651is_scope_decl(const decl_base_sptr&);
652
653bool
654is_member_type(const type_base_sptr&);
655
656bool
658
659bool
660is_user_defined_type(const type_base_sptr&);
661
662void
663remove_decl_from_scope(decl_base_sptr);
664
665bool
667
668bool
670
671bool
672get_member_is_static(const decl_base_sptr&);
673
674void
676
677void
678set_member_is_static(const decl_base_sptr&, bool);
679
680bool
682
685
686bool
688
691
692bool
694
696is_data_member(const decl_base_sptr&);
697
700
703
704const var_decl_sptr
705get_next_data_member(const class_or_union_sptr&, const var_decl_sptr&);
706
709
712
714get_last_data_member(const class_or_union_sptr&);
715
716bool
718
719const var_decl*
721
722const var_decl*
724
727
729is_anonymous_data_member(const decl_base_sptr&);
730
733
734const var_decl*
736
737bool
739
740const var_decl_sptr
742
745 const string&);
746
749
750class_or_union_sptr
752
753class_or_union_sptr
755
756bool
758 const class_or_union& clazz);
759
760bool
762
763const class_or_union_sptr
765
766const class_or_union_sptr
768
769const class_or_union_sptr
771
774
777
779is_array_of_qualified_element(const type_base_sptr&);
780
781qualified_type_def_sptr
783
785is_typedef_of_array(const type_base_sptr&);
786
787void
789
790uint64_t
792
793uint64_t
795
796uint64_t
797get_data_member_offset(const decl_base_sptr);
798
799uint64_t
801
802bool
804 const var_decl_sptr&,
805 uint64_t&);
806
807bool
808get_next_data_member_offset(const class_or_union_sptr&,
809 const var_decl_sptr&,
810 uint64_t&);
811
812uint64_t
814
815void
817
818bool
820
821bool
823
824bool
826
827bool
829
830bool
832
833bool
835
836bool
838
839void
841
842void
844
845bool
847
848bool
850
851void
853
854void
856
857bool
859
860bool
862
863void
865
866void
868
869bool
871
872ssize_t
874
875ssize_t
877
878void
880 ssize_t s);
881
882void
884 ssize_t s);
885
886bool
888
889bool
891
892bool
894
895void
897
898void
900
901type_base_sptr
902strip_typedef(const type_base_sptr);
903
904decl_base_sptr
905strip_useless_const_qualification(const qualified_type_def_sptr t);
906
907void
908strip_redundant_quals_from_underyling_types(const qualified_type_def_sptr&);
909
910type_base_sptr
911peel_typedef_type(const type_base_sptr&);
912
913const type_base*
915
916type_base_sptr
917peel_pointer_type(const type_base_sptr&);
918
919const type_base*
921
922type_base_sptr
923peel_reference_type(const type_base_sptr&);
924
925const type_base*
927
928const type_base_sptr
929peel_array_type(const type_base_sptr&);
930
931const type_base*
933
934const type_base*
936
937const type_base_sptr
938peel_qualified_type(const type_base_sptr&);
939
942
943type_base_sptr
944peel_qualified_or_typedef_type(const type_base_sptr &type);
945
946type_base_sptr
947peel_typedef_pointer_or_reference_type(const type_base_sptr);
948
951
954 bool peel_qual_type);
955
958 bool peel_qualified_type = true);
959
961clone_array(const array_type_def_sptr& array);
962
965
966qualified_type_def_sptr
967clone_qualified_type(const qualified_type_def_sptr& t);
968
969type_base_sptr
970clone_array_tree(const type_base_sptr t);
971
972string
973get_name(const type_or_decl_base*, bool qualified = true);
974
975string
977 bool qualified = true);
978
980get_location(const type_base_sptr& type);
981
983get_location(const decl_base_sptr& decl);
984
985string
986build_qualified_name(const scope_decl* scope, const string& name);
987
988string
990 const type_base_sptr& type);
991
994
996get_type_scope(const type_base_sptr&);
997
999get_type_name(const type_base_sptr&,
1000 bool qualified = true,
1001 bool internal = false);
1002
1005 bool qualified = true,
1006 bool internal = false);
1007
1010 bool qualified = true,
1011 bool internal = false);
1012
1014get_name_of_pointer_to_type(const type_base& pointed_to_type,
1015 bool qualified = true,
1016 bool internal = false);
1017
1019get_name_of_reference_to_type(const type_base& pointed_to_type,
1020 bool lvalue_reference = false,
1021 bool qualified = true,
1022 bool internal = false);
1023
1026 bool internal = false);
1027
1029get_function_type_name(const function_type*, bool internal = false);
1030
1032get_function_type_name(const function_type&, bool internal = false);
1033
1036
1038get_method_type_name(const method_type_sptr&, bool internal = false);
1039
1041get_method_type_name(const method_type*, bool internal = false);
1042
1044get_method_type_name(const method_type&, bool internal = false);
1045
1046string
1047get_pretty_representation(const decl_base*, bool internal = false);
1048
1049string
1050get_pretty_representation(const type_base*, bool internal = false);
1051
1052string
1053get_pretty_representation(const type_or_decl_base*, bool internal = false);
1054
1055string
1057 bool internal = false);
1058
1059string
1060get_pretty_representation(const decl_base_sptr&, bool internal = false);
1061
1062string
1063get_pretty_representation(const type_base_sptr&, bool internal = false);
1064
1065string
1066get_pretty_representation(const function_type&, bool internal = false);
1067
1068string
1069get_pretty_representation(const function_type*, bool internal = false);
1070
1071string
1073 bool internal = false);
1074
1075string
1076get_pretty_representation(const method_type&, bool internal = false);
1077
1078string
1079get_pretty_representation(const method_type*, bool internal = false);
1080
1081string
1083 bool internal = false);
1084
1085string
1087 const string& indent,
1088 bool one_line,
1089 bool internal,
1090 bool qualified_name = true);
1091
1092string
1094 const string& indent,
1095 bool one_line,
1096 bool internal,
1097 bool qualified_name = true);
1098
1099string
1100get_class_or_union_flat_representation(const class_or_union_sptr& cou,
1101 const string& indent,
1102 bool one_line,
1103 bool internal,
1104 bool qualified_name = true);
1105
1106string
1108
1110get_data_member(class_or_union *, const char*);
1111
1113get_data_member(type_base *clazz, const char* member_name);
1114
1115const location&
1117
1118const location&
1120
1122debug(const type_or_decl_base* artifact);
1123
1124type_base*
1125debug(const type_base* artifact);
1126
1127decl_base*
1128debug(const decl_base* artifact);
1129
1130bool
1132
1133void
1134debug_comp_stack(const environment& env);
1135
1136bool
1138
1139const decl_base*
1141
1142decl_base*
1144
1145decl_base_sptr
1146get_type_declaration(const type_base_sptr);
1147
1148bool
1149types_are_compatible(const type_base_sptr,
1150 const type_base_sptr);
1151
1152bool
1153types_are_compatible(const decl_base_sptr,
1154 const decl_base_sptr);
1155
1156const scope_decl*
1158 const scope_decl*);
1159
1160const scope_decl*
1161get_top_most_scope_under(const decl_base_sptr,
1162 const scope_decl*);
1163
1164const scope_decl*
1165get_top_most_scope_under(const decl_base_sptr,
1166 const scope_decl_sptr);
1167
1168void
1169fqn_to_components(const std::string&,
1170 std::list<string>&);
1171
1172string
1173components_to_type_name(const std::list<string>&);
1174
1177
1180
1182lookup_basic_type(const string&, const translation_unit&);
1183
1185lookup_basic_type(const type_decl&, const corpus&);
1186
1188lookup_basic_type(const string&, const corpus&);
1189
1192
1195
1197lookup_basic_type_per_location(const string&, const corpus&);
1198
1201
1204
1206lookup_class_type(const string&, const translation_unit&);
1207
1209lookup_class_type(const class_decl&, const corpus&);
1210
1213
1216
1219
1220bool
1222 const corpus&,
1224
1226lookup_class_types(const string&, const corpus&);
1227
1229lookup_union_types(const string&, const corpus&);
1230
1233
1235lookup_class_type_per_location(const string&, const corpus&);
1236
1238lookup_class_type(const string&, const corpus&);
1239
1241lookup_class_type_through_scopes(const std::list<string>&,
1242 const translation_unit&);
1243
1244union_decl_sptr
1246
1247union_decl_sptr
1249
1250union_decl_sptr
1252
1253union_decl_sptr
1254lookup_union_type_per_location(const string&, const corpus&);
1255
1256union_decl_sptr
1257lookup_union_type(const string&, const corpus&);
1258
1261
1263lookup_enum_type(const string&, const translation_unit&);
1264
1266lookup_enum_type(const enum_type_decl&, const corpus&);
1267
1269lookup_enum_type(const string&, const corpus&);
1270
1273
1276
1278lookup_enum_types(const string&, const corpus&);
1279
1282
1284lookup_enum_type_per_location(const string&, const corpus&);
1285
1288
1291
1293lookup_typedef_type(const interned_string& type_name,
1294 const translation_unit& tu);
1295
1297lookup_typedef_type(const string& type_name, const translation_unit& tu);
1298
1301
1304
1306lookup_typedef_type_per_location(const string&, const corpus &);
1307
1309lookup_typedef_type(const string&, const corpus&);
1310
1311type_base_sptr
1312lookup_class_or_typedef_type(const string&, const translation_unit&);
1313
1314type_base_sptr
1316
1317type_base_sptr
1318lookup_class_or_typedef_type(const string&, const corpus&);
1319
1320type_base_sptr
1321lookup_class_typedef_or_enum_type(const string&, const corpus&);
1322
1323qualified_type_def_sptr
1325
1326qualified_type_def_sptr
1327lookup_qualified_type(const string&, const translation_unit&);
1328
1329qualified_type_def_sptr
1331
1332qualified_type_def_sptr
1334
1337
1339lookup_pointer_type(const string&, const translation_unit&);
1340
1342lookup_pointer_type(const type_base_sptr& pointed_to_type,
1343 const translation_unit& tu);
1344
1347
1350
1353
1355lookup_reference_type(const string&, const translation_unit&);
1356
1358lookup_reference_type(const type_base_sptr& pointed_to_type,
1359 bool lvalue_reference,
1360 const translation_unit& tu);
1361
1364
1367
1370
1372lookup_array_type(const string&, const translation_unit&);
1373
1376
1379
1381lookup_function_type(const string&,
1382 const translation_unit&);
1383
1386 const translation_unit&);
1387
1390 const translation_unit&);
1391
1394 const translation_unit&);
1395
1398
1401
1404
1407
1408type_base_sptr
1409lookup_type(const string&, const translation_unit&);
1410
1411const type_base_sptr
1412lookup_type(const type_base_sptr, const translation_unit&);
1413
1414type_base_sptr
1415lookup_type(const interned_string&, const corpus&);
1416
1417type_base_sptr
1419
1420type_base_sptr
1421lookup_type(const type_base&, const corpus&);
1422
1423type_base_sptr
1424lookup_type(const type_base_sptr&, const corpus&);
1425
1426type_base_sptr
1427lookup_type_through_scopes(const std::list<string>&,
1428 const translation_unit&);
1429
1430type_base_sptr
1431lookup_type_through_translation_units(const string&, const corpus&);
1432
1433type_base_sptr
1434lookup_type_from_translation_unit(const string& type_name,
1435 const string& tu_path,
1436 const corpus& corp);
1437
1440 const corpus&);
1441
1442type_base_sptr
1443synthesize_type_from_translation_unit(const type_base_sptr&,
1445
1449
1450const type_base_sptr
1451lookup_type_in_scope(const string&,
1452 const scope_decl_sptr&);
1453
1454const type_base_sptr
1455lookup_type_in_scope(const std::list<string>&,
1456 const scope_decl_sptr&);
1457
1458const decl_base_sptr
1459lookup_var_decl_in_scope(const string&,
1460 const scope_decl_sptr&);
1461
1462const decl_base_sptr
1463lookup_var_decl_in_scope(const std::list<string>&,
1464 const scope_decl_sptr&);
1465
1466string
1467demangle_cplus_mangled_name(const string&);
1468
1469type_base_sptr
1470type_or_void(const type_base_sptr, const environment&);
1471
1472type_base_sptr
1473canonicalize(type_base_sptr);
1474
1475type_base*
1476type_has_non_canonicalized_subtype(type_base_sptr t);
1477
1478bool
1479type_has_sub_type_changes(type_base_sptr t_v1,
1480 type_base_sptr t_v2);
1481
1482void
1483keep_type_alive(type_base_sptr t);
1484
1485size_t
1486hash_type(const type_base *t);
1487
1488size_t
1490
1491size_t
1493
1494bool
1496
1497bool
1498is_non_canonicalized_type(const type_base_sptr&);
1499
1500bool
1501is_unique_type(const type_base_sptr&);
1502
1503bool
1505
1506/// For a given type, return its exemplar type.
1507///
1508/// For a given type, its exemplar type is either its canonical type
1509/// or the canonical type of the definition type of a given
1510/// declaration-only type. If the neither of those two types exist,
1511/// then the exemplar type is the given type itself.
1512///
1513/// @param type the input to consider.
1514///
1515/// @return the exemplar type.
1516type_base*
1517get_exemplar_type(const type_base* type);
1518
1519bool
1521
1522bool
1523types_have_similar_structure(const type_base_sptr& first,
1524 const type_base_sptr& second,
1525 bool indirect_type = false);
1526
1527bool
1529 const type_base* second,
1530 bool indirect_type = false);
1531
1532string
1534 bool is_anonymous,
1535 uint64_t size);
1536
1539 const regex::regex_t_sptr& r);
1540
1543 const regex::regex_t_sptr& regex);
1544} // end namespace ir
1545
1546using namespace abigail::ir;
1547
1548namespace suppr
1549{
1550class suppression_base;
1551
1552/// Convenience typedef for a shared pointer to a @ref suppression.
1553typedef shared_ptr<suppression_base> suppression_sptr;
1554
1555/// Convenience typedef for a vector of @ref suppression_sptr
1556typedef vector<suppression_sptr> suppressions_type;
1557
1558} // end namespace suppr
1559
1560namespace symtab_reader
1561{
1562
1563class symtab;
1564/// Convenience typedef for a shared pointer to a @ref symtab
1565typedef std::shared_ptr<symtab> symtab_sptr;
1566
1567} // end namespace symtab_reader
1568
1569void
1570dump(const decl_base_sptr, std::ostream&);
1571
1572void
1573dump(const decl_base_sptr);
1574
1575void
1576dump(const type_base_sptr, std::ostream&);
1577
1578void
1579dump(const type_base_sptr);
1580
1581void
1582dump(const var_decl_sptr, std::ostream&);
1583
1584void
1585dump(const var_decl_sptr);
1586
1587void
1588dump(const translation_unit&, std::ostream&);
1589
1590void
1591dump(const translation_unit&);
1592
1593void
1594dump(const translation_unit_sptr, std::ostream&);
1595
1596void
1598
1599void
1601
1602void
1604
1605void
1606dump_decl_location(const decl_base_sptr&);
1607
1608#ifndef ABG_ASSERT
1609/// This is a wrapper around the 'assert' glibc call. It allows for
1610/// its argument to have side effects, so that it keeps working when
1611/// the code of libabigail is compiled with the NDEBUG macro defined.
1612#define ABG_ASSERT(cond) do {({bool __abg_cond__ = bool(cond); assert(__abg_cond__); !!__abg_cond__;});} while (false)
1613#endif
1614
1615} // end namespace abigail
1616#endif // __ABG_IRFWD_H__
std::shared_ptr< symtab > symtab_sptr
Convenience typedef for a shared pointer to a symtab.
Definition: abg-fwd.h:1565
Declaration of types pertaining to the interned string pool used throughout Libabigail,...
The abstraction of a change between two ABI artifacts, a.k.a an artifact change.
The abstraction of an interned string.
The abstraction of an array type.
Definition: abg-ir.h:2455
Abstracts a class declaration.
Definition: abg-ir.h:4150
The base type of class_decl and union_decl.
Definition: abg-ir.h:3948
Abstract a class template.
Definition: abg-ir.h:3751
Abstraction of a group of corpora.
Definition: abg-corpus.h:353
This is the abstraction of a set of translation units (themselves seen as bundles of unitary abi arte...
Definition: abg-corpus.h:25
The base type of all declarations.
Definition: abg-ir.h:1525
The abstraction for a data member context relationship. This relates a data member to its parent clas...
Definition: abg-ir.h:2876
Abstracts a declaration for an enum type.
Definition: abg-ir.h:2686
This is an abstraction of the set of resources necessary to manage several aspects of the internal re...
Definition: abg-ir.h:140
Abstraction for a function declaration.
Definition: abg-ir.h:3033
Abstract a function template declaration.
Definition: abg-ir.h:3702
Abstraction of a function type.
Definition: abg-ir.h:3309
This abstracts the global scope of a given translation unit.
Definition: abg-ir.h:1939
The base class for the visitor type hierarchy used for traversing a translation unit.
Definition: abg-ir.h:4870
The entry point to manage locations.
Definition: abg-ir.h:441
The source location of a token.
Definition: abg-ir.h:299
Abstraction of a member function context relationship. This relates a member function to its parent c...
Definition: abg-ir.h:4475
Abstracts a member class template template.
Definition: abg-ir.h:4676
Abstract a member function template.
Definition: abg-ir.h:4621
Abstraction of the declaration of a method.
Definition: abg-ir.h:3846
Abstracts the type of a class member function.
Definition: abg-ir.h:3405
The abstraction of a namespace declaration.
Definition: abg-ir.h:2184
Abstracts non type template parameters.
Definition: abg-ir.h:3579
The abstraction of a pointer type.
Definition: abg-ir.h:2324
The abstraction of a qualified type.
Definition: abg-ir.h:2213
Abstracts a reference type.
Definition: abg-ir.h:2387
A declaration that introduces a scope.
Definition: abg-ir.h:1796
A type that introduces a scope.
Definition: abg-ir.h:2158
The base class of templates.
Definition: abg-ir.h:3461
Base class for a template parameter. Client code should use the more specialized type_template_parame...
Definition: abg-ir.h:3496
Abstracts a template template parameter.
Definition: abg-ir.h:3626
This is the abstraction of the set of relevant artefacts (types, variable declarations,...
Definition: abg-ir.h:672
An abstraction helper for type declarations.
Definition: abg-ir.h:1960
This abstracts a composition of types based on template type parameters. The result of the compositio...
Definition: abg-ir.h:3664
A basic type declaration that introduces no scope.
Definition: abg-ir.h:2095
The base class of both types and declarations.
Definition: abg-ir.h:1354
Abstracts a type template parameter.
Definition: abg-ir.h:3542
The abstraction of a typedef declaration.
Definition: abg-ir.h:2818
Abstracts a union type declaration.
Definition: abg-ir.h:4405
Abstracts a variable declaration.
Definition: abg-ir.h:2930
Base type of a direct suppression specifications types.
shared_ptr< diff > diff_sptr
Convenience typedef for a shared_ptr for the diff class.
Definition: abg-fwd.h:79
weak_ptr< diff > diff_wptr
Convenience typedef for a weak_ptr for the diff class.
Definition: abg-fwd.h:82
shared_ptr< diff_context > diff_context_sptr
Convenience typedef for a shared pointer of diff_context.
Definition: abg-fwd.h:71
weak_ptr< diff_context > diff_context_wptr
Convenience typedef for a weak pointer of diff_context.
Definition: abg-fwd.h:74
The namespace of the internal representation of ABI artifacts like types and decls.
shared_ptr< type_tparameter > type_tparameter_sptr
Convenience typedef for a shared pointer to type_tparameter.
Definition: abg-fwd.h:331
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
const type_base_sptr lookup_type_in_scope(const string &fqn, const scope_decl_sptr &skope)
Lookup a type in a scope.
Definition: abg-ir.cc:11969
bool is_non_canonicalized_type(const type_base *t)
Test if a given type is allowed to be non canonicalized.
Definition: abg-ir.cc:26654
shared_ptr< dm_context_rel > dm_context_rel_sptr
A convenience typedef for a shared pointer to dm_context_rel.
Definition: abg-fwd.h:244
bool get_member_function_is_dtor(const function_decl &f)
Test whether a member function is a destructor.
Definition: abg-ir.cc:6487
const type_base * peel_qualified_type(const type_base *type)
Return the leaf underlying type of a qualified type.
Definition: abg-ir.cc:7248
weak_ptr< typedef_decl > typedef_decl_wptr
Convenience typedef for a weak pointer on a typedef_decl.
Definition: abg-fwd.h:167
type_decl_sptr lookup_basic_type(const interned_string &type_name, const translation_unit &tu)
Lookup a basic type from a translation unit.
Definition: abg-ir.cc:11456
shared_ptr< method_type > method_type_sptr
Convenience typedef for shared pointer to method_type.
Definition: abg-fwd.h:218
size_t hash_type(const type_base *t)
Hash an ABI artifact that is either a type.
Definition: abg-ir.cc:26631
void fqn_to_components(const string &fqn, list< string > &comps)
Decompose a fully qualified name into the list of its components.
Definition: abg-ir.cc:11320
var_decl_sptr get_last_data_member(const class_or_union &klass)
Get the last data member of a class type.
Definition: abg-ir.cc:5923
bool is_anonymous_or_typedef_named(const decl_base &d)
Test if a given decl is anonymous or has a naming typedef.
Definition: abg-ir.cc:6187
weak_ptr< var_decl > var_decl_wptr
Convenience typedef for a weak pointer on a var_decl.
Definition: abg-fwd.h:252
bool is_template_parm_composition_type(const shared_ptr< decl_base > decl)
Tests whether a decl is a template parameter composition type.
Definition: abg-ir.cc:11121
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:5717
bool debug_equals(const type_or_decl_base *l, const type_or_decl_base *r)
Test if two ABI artifacts are equal.
Definition: abg-ir.cc:9797
shared_ptr< function_decl > function_decl_sptr
Convenience typedef for a shared pointer on a function_decl.
Definition: abg-fwd.h:266
const type_base_wptrs_type * lookup_enum_types(const interned_string &qualified_name, const corpus &corp)
Look into a given corpus to find the enum type*s* that have a given qualified name.
Definition: abg-ir.cc:13037
shared_ptr< class_tdecl > class_tdecl_sptr
Convenience typedef for a shared pointer on a class_tdecl.
Definition: abg-fwd.h:290
weak_ptr< function_type > function_type_wptr
Convenience typedef for a weak pointer on a function_type.
Definition: abg-fwd.h:213
type_base_sptr lookup_class_or_typedef_type(const string &qualified_name, const corpus &corp)
Look into a corpus to find a class, union or typedef type which has a given qualified name.
Definition: abg-ir.cc:13199
void set_member_function_is_virtual(function_decl &f, bool is_virtual)
Set the virtual-ness of a member function.
Definition: abg-ir.cc:6712
ssize_t get_member_function_vtable_offset(const function_decl &f)
Get the vtable offset of a member function.
Definition: abg-ir.cc:6611
vector< type_base_wptr > type_base_wptrs_type
A convenience typedef for a vector of type_base_wptr.
Definition: abg-fwd.h:143
scope_decl * get_type_scope(type_base *t)
Get the scope of a given type.
Definition: abg-ir.cc:8697
qualified_type_def_sptr clone_qualified_type(const qualified_type_def_sptr &t)
Clone a qualifiend type.
Definition: abg-ir.cc:7550
const type_base * is_void_pointer_type(const type_base *t)
Test if a type is a pointer to void type.
Definition: abg-ir.cc:10812
bool is_type(const type_or_decl_base &tod)
Test whether a declaration is a type.
Definition: abg-ir.cc:10248
scope_decl * is_scope_decl(decl_base *d)
Test if a declaration is a scope_decl.
Definition: abg-ir.cc:5587
bool is_anonymous_data_member(const decl_base &d)
Test if a decl is an anonymous data member.
Definition: abg-ir.cc:5946
bool is_template_parameter(const shared_ptr< decl_base > decl)
Tests whether a decl is a template parameter.
Definition: abg-ir.cc:10122
weak_ptr< type_base > type_base_wptr
Convenience typedef for a weak pointer on a type_base.
Definition: abg-fwd.h:129
type_base_sptr peel_reference_type(const type_base_sptr &type)
Return the leaf pointed-to type node of a reference_type_def node.
Definition: abg-ir.cc:7157
bool has_scope(const decl_base &d)
Tests if a declaration has got a scope.
Definition: abg-ir.cc:5541
void set_member_function_vtable_offset(function_decl &f, ssize_t s)
Set the vtable offset of a member function.
Definition: abg-ir.cc:6644
type_base_sptr lookup_type_from_translation_unit(const string &type_name, const string &tu_path, const corpus &corp)
Lookup a type from a given translation unit present in a give corpus.
Definition: abg-ir.cc:12596
type_base * get_exemplar_type(const type_base *type)
For a given type, return its exemplar type.
Definition: abg-ir.cc:26726
shared_ptr< non_type_tparameter > non_type_tparameter_sptr
Convenience typedef for shared pointer to non_type_template_parameter.
Definition: abg-fwd.h:321
class_decl_sptr is_compatible_with_class_type(const type_base_sptr &t)
Test if a type is a class. This function looks through typedefs.
Definition: abg-ir.cc:10480
void remove_decl_from_scope(decl_base_sptr decl)
Remove a given decl from its scope.
Definition: abg-ir.cc:8371
bool odr_is_relevant(const type_or_decl_base &artifact)
By looking at the language of the TU a given ABI artifact belongs to, test if the ONE Definition Rule...
Definition: abg-ir.cc:9862
array_type_def_sptr clone_array(const array_type_def_sptr &array)
Clone an array type.
Definition: abg-ir.cc:7483
var_decl_sptr find_last_data_member_matching_regexp(const class_or_union &t, const regex::regex_t_sptr &regex)
Find the last data member of a class or union which name matches a regular expression.
Definition: abg-ir.cc:27174
const var_decl_sptr get_first_non_anonymous_data_member(const var_decl_sptr anon_dm)
Get the first non-anonymous data member of a given anonymous data member.
Definition: abg-ir.cc:5860
class_decl_sptr lookup_class_type_through_scopes(const list< string > &fqn, const translation_unit &tu)
Lookup a class type from a translation unit by walking its scopes in sequence and by looking into the...
Definition: abg-ir.cc:12331
bool is_user_defined_type(const type_base *t)
Test if a type is user-defined.
Definition: abg-ir.cc:5621
weak_ptr< class_decl > class_decl_wptr
Convenience typedef for a weak pointer on a class_decl.
Definition: abg-fwd.h:199
string components_to_type_name(const list< string > &comps)
Turn a set of qualified name components (that name a type) into a qualified name string.
Definition: abg-ir.cc:11346
void debug_comp_stack(const environment &env)
Emit a trace of the two comparison operands stack on the standard error stream.
Definition: abg-ir.cc:9847
shared_ptr< global_scope > global_scope_sptr
Convenience typedef for shared pointer on global_scope.
Definition: abg-fwd.h:300
bool is_class_type(const type_or_decl_base &t)
Test whether a type is a class.
Definition: abg-ir.cc:10512
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:14243
shared_ptr< array_type_def > array_type_def_sptr
Convenience typedef for a shared pointer on a array_type_def.
Definition: abg-fwd.h:237
function_type_sptr lookup_or_synthesize_fn_type(const function_type_sptr &fn_t, const corpus &corpus)
Look into an ABI corpus for a function type.
Definition: abg-ir.cc:12621
bool is_declaration_only_class_or_union_type(const type_base *t, bool look_through_decl_only)
Test wheter a type is a declaration-only class.
Definition: abg-ir.cc:10553
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:9198
bool is_anonymous_type(const type_base *t)
Test whether a declaration is a type.
Definition: abg-ir.cc:10299
type_base_sptr lookup_class_typedef_or_enum_type(const string &qualified_name, const corpus &corp)
Look into a corpus to find a class, typedef or enum type which has a given qualified name.
Definition: abg-ir.cc:13224
array_type_def * is_array_type(const type_or_decl_base *type)
Test if a type is an array_type_def.
Definition: abg-ir.cc:11148
reference_type_def * is_reference_type(type_or_decl_base *t)
Test whether a type is a reference_type_def.
Definition: abg-ir.cc:10742
const class_or_union_sptr data_member_has_anonymous_type(const var_decl &d)
Test if a data member has annonymous type or not.
Definition: abg-ir.cc:6091
type_decl * is_integral_type(const type_or_decl_base *t)
Test if a type is an integral type.
Definition: abg-ir.cc:10350
bool anonymous_data_member_exists_in_class(const var_decl &anon_dm, const class_or_union &clazz)
Test if a given anonymous data member exists in a class or union.
Definition: abg-ir.cc:6147
class_decl_sptr lookup_class_type_per_location(const interned_string &loc, const corpus &corp)
Look up a class_decl from a given corpus by its location.
Definition: abg-ir.cc:12900
void set_member_function_is_dtor(function_decl &f, bool d)
Set the destructor-ness property of a member function.
Definition: abg-ir.cc:6515
const type_base_sptr peel_array_type(const type_base_sptr &type)
Return the leaf element type of an array.
Definition: abg-ir.cc:7206
reference_type_def_sptr lookup_reference_type(const interned_string &type_name, const translation_unit &tu)
Lookup a reference type from a translation unit.
Definition: abg-ir.cc:11787
bool types_have_similar_structure(const type_base_sptr &first, const type_base_sptr &second, bool indirect_type)
Test if two types have similar structures, even though they are (or can be) different.
Definition: abg-ir.cc:26870
shared_ptr< template_parameter > template_parameter_sptr
Convenience typedef for shared pointer to template parameter.
Definition: abg-fwd.h:315
class_or_union * is_class_or_union_type(const type_or_decl_base *t)
Test if a type is a class_or_union.
Definition: abg-ir.cc:10586
var_decl_sptr get_data_member(class_or_union *clazz, const char *member_name)
Get a given data member, referred to by its name, of a class type.
Definition: abg-ir.cc:9679
const var_decl_sptr get_next_data_member(const class_or_union *klass, const var_decl_sptr &data_member)
In the context of a given class or union, this function returns the data member that is located after...
Definition: abg-ir.cc:5884
shared_ptr< class_decl > class_decl_sptr
Convenience typedef for a shared pointer on a class_decl.
Definition: abg-fwd.h:190
type_base_sptr peel_typedef_pointer_or_reference_type(const type_base_sptr type)
Return the leaf underlying or pointed-to type node of a typedef_decl, pointer_type_def,...
Definition: abg-ir.cc:7344
void set_member_function_is_const(function_decl &f, bool is_const)
set the const-ness property of a member function.
Definition: abg-ir.cc:6571
decl_base_sptr strip_useless_const_qualification(const qualified_type_def_sptr t)
Strip qualification from a qualified type, when it makes sense.
Definition: abg-ir.cc:6899
namespace_decl_sptr is_namespace(const decl_base_sptr &d)
Tests if a declaration is a namespace declaration.
Definition: abg-ir.cc:11103
const type_decl * is_type_decl(const type_or_decl_base *t)
Test whether a type is a type_decl (a builtin type).
Definition: abg-ir.cc:10332
decl_base * is_decl_slow(const type_or_decl_base *t)
Test if an ABI artifact is a declaration.
Definition: abg-ir.cc:10228
decl_base_sptr look_through_decl_only(const decl_base &d)
If a decl is decl-only get its definition. Otherwise, just return nil.
Definition: abg-ir.cc:10992
function_type_sptr is_function_type(const type_or_decl_base_sptr &t)
Test whether a type is a function_type.
Definition: abg-ir.cc:10883
vector< class_decl_sptr > classes_type
Convenience typedef for a vector of class_decl_sptr.
Definition: abg-fwd.h:193
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:8583
typedef_decl_sptr is_typedef(const type_or_decl_base_sptr t)
Test whether a type is a typedef.
Definition: abg-ir.cc:10390
shared_ptr< template_tparameter > template_tparameter_sptr
Convenience typedef for a shared_ptr to template_tparameter.
Definition: abg-fwd.h:328
uint64_t get_var_size_in_bits(const var_decl_sptr &v)
Get the size of a given variable.
Definition: abg-ir.cc:6349
weak_ptr< corpus > corpus_wptr
Convenience typedef for a weak pointer to a corpus.
Definition: abg-fwd.h:132
enum_type_decl_sptr lookup_enum_type_per_location(const interned_string &loc, const corpus &corp)
Look up an enum_type_decl from a given corpus, by its location.
Definition: abg-ir.cc:13067
string get_debug_representation(const type_or_decl_base *artifact)
Get the textual representation of a type for debugging purposes.
Definition: abg-ir.cc:9566
shared_ptr< function_type > function_type_sptr
Convenience typedef for a shared pointer on a function_type.
Definition: abg-fwd.h:207
shared_ptr< typedef_decl > typedef_decl_sptr
Convenience typedef for a shared pointer on a typedef_decl.
Definition: abg-fwd.h:164
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:14326
type_base_sptr peel_pointer_type(const type_base_sptr &type)
Return the leaf pointed-to type node of a pointer_type_def node.
Definition: abg-ir.cc:7101
class_decl_sptr lookup_class_type(const string &fqn, const translation_unit &tu)
Lookup a class type from a translation unit.
Definition: abg-ir.cc:11496
type_base_sptr lookup_type_through_translation_units(const string &qn, const corpus &abi_corpus)
Lookup a type definition in all the translation units of a given ABI corpus.
Definition: abg-ir.cc:12571
qualified_type_def_sptr is_array_of_qualified_element(const array_type_def_sptr &array)
Tests if the element of a given array is a qualified type.
Definition: abg-ir.cc:11167
type_base * peel_pointer_or_reference_type(const type_base *type, bool peel_qual_type)
Return the leaf underlying or pointed-to type node of a, pointer_type_def, reference_type_def or qual...
Definition: abg-ir.cc:7446
vector< function_type_sptr > function_types_type
Convenience typedef fo a vector of function_type_sptr.
Definition: abg-fwd.h:210
bool is_typedef_to_decl_only_class_or_union_type(const type_or_decl_base *t)
Test if a type is a typedef to a decl-only class/union.
Definition: abg-ir.cc:10721
bool is_pointer_to_decl_only_class_or_union_type(const type_or_decl_base *t)
Test if a type is a pointer to a decl-only class/union.
Definition: abg-ir.cc:10675
bool lookup_decl_only_class_types(const interned_string &qualified_name, const corpus &corp, type_base_wptrs_type &result)
Look into a given corpus to find the class type*s* that have a given qualified name and that are decl...
Definition: abg-ir.cc:12824
bool member_function_has_vtable_offset(const function_decl &f)
Test if a virtual member function has a vtable offset set.
Definition: abg-ir.cc:6600
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:8391
const enum_type_decl * is_enum_type(const type_or_decl_base *d)
Test if a decl is an enum_type_decl.
Definition: abg-ir.cc:10462
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:149
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:26818
var_decl_sptr find_data_member_from_anonymous_data_member(const var_decl_sptr &anon_dm, const string &name)
Find a data member inside an anonymous data member.
Definition: abg-ir.cc:10091
const global_scope * get_global_scope(const decl_base &decl)
return the global scope as seen by a given declaration.
Definition: abg-ir.cc:8440
shared_ptr< var_decl > var_decl_sptr
Convenience typedef for a shared pointer on a var_decl.
Definition: abg-fwd.h:249
const location & get_natural_or_artificial_location(const decl_base *decl)
Get the non-artificial (natural) location of a decl.
Definition: abg-ir.cc:9707
size_t hash_type_or_decl(const type_or_decl_base *tod)
Hash an ABI artifact that is either a type or a decl.
Definition: abg-ir.cc:26552
bool is_template_decl(const decl_base_sptr &decl)
Tests whether a decl is a template.
Definition: abg-ir.cc:11249
shared_ptr< scope_decl > scope_decl_sptr
Convenience typedef for a shared pointer on a scope_decl.
Definition: abg-fwd.h:261
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:121
pointer_type_def_sptr lookup_pointer_type(const interned_string &type_name, const translation_unit &tu)
Lookup a pointer type from a translation unit.
Definition: abg-ir.cc:11725
shared_ptr< translation_unit > translation_unit_sptr
Convenience typedef for a shared pointer on a translation_unit type.
Definition: abg-fwd.h:137
shared_ptr< environment > environment_sptr
Convenience typedef for a shared pointer to an environment.
Definition: abg-fwd.h:114
const type_base * is_void_pointer_type_equivalent(const type_base *type)
Test if a type is equivalent to a pointer to void type.
Definition: abg-ir.cc:10775
const decl_base_sptr lookup_var_decl_in_scope(const string &fqn, const scope_decl_sptr &skope)
Lookup a var_decl in a scope.
Definition: abg-ir.cc:11986
type_base * type_has_non_canonicalized_subtype(type_base_sptr t)
Test if a type has sub-types that are non-canonicalized.
Definition: abg-ir.cc:26489
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:11679
const type_base_sptr lookup_type(const interned_string &fqn, const translation_unit &tu)
Lookup a type in a translation unit.
Definition: abg-ir.cc:11902
bool get_data_member_is_laid_out(const var_decl &m)
Test whether a data member is laid out.
Definition: abg-ir.cc:6377
union_decl_sptr lookup_union_type(const interned_string &type_name, const translation_unit &tu)
Lookup a union type from a translation unit.
Definition: abg-ir.cc:11533
type_base_sptr canonicalize(type_base_sptr t)
Compute the canonical type of a given type.
Definition: abg-ir.cc:15034
bool get_member_function_is_const(const function_decl &f)
Test whether a member function is const.
Definition: abg-ir.cc:6543
interned_string get_name_of_reference_to_type(const type_base &pointed_to_type, bool lvalue_reference, bool qualified, bool internal)
Get the name of the reference to a given type.
Definition: abg-ir.cc:8916
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
unordered_map< string, translation_unit_sptr > string_tu_map_type
Convenience typedef for a map that associates a string to a translation unit.
Definition: abg-fwd.h:140
pointer_type_def * is_pointer_type(type_or_decl_base *t)
Test whether a type is a pointer_type_def.
Definition: abg-ir.cc:10635
type_base_sptr lookup_type_per_location(const interned_string &loc, const corpus &corp)
Lookup a type from a corpus, by its location.
Definition: abg-ir.cc:13529
bool get_next_data_member_offset(const class_or_union *klass, const var_decl_sptr &dm, uint64_t &offset)
Get the offset of the non-static data member that comes after a given one.
Definition: abg-ir.cc:6262
uint64_t get_absolute_data_member_offset(const var_decl &m)
Get the absolute offset of a data member.
Definition: abg-ir.cc:6306
shared_ptr< ir_traversable_base > ir_traversable_base_sptr
Convenience typedef for a shared pointer to ir_traversable_base.
Definition: abg-fwd.h:110
bool is_member_function(const function_decl &f)
Test whether a function_decl is a member function.
Definition: abg-ir.cc:6401
var_decl * is_var_decl(const type_or_decl_base *tod)
Tests if a declaration is a variable declaration.
Definition: abg-ir.cc:11084
decl_base * is_decl(const type_or_decl_base *d)
Test if an ABI artifact is a declaration.
Definition: abg-ir.cc:10188
void keep_type_alive(type_base_sptr t)
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:26527
array_type_def_sptr lookup_array_type(const interned_string &type_name, const translation_unit &tu)
Lookup an array type from a translation unit.
Definition: abg-ir.cc:11831
bool is_member_type(const type_base_sptr &t)
Tests if a type is a class member.
Definition: abg-ir.cc:5606
string get_class_or_union_flat_representation(const class_or_union &cou, const string &indent, bool one_line, bool internal, bool qualified_names)
Get the flat representation of an instance of class_or_union type.
Definition: abg-ir.cc:9420
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:8347
string build_internal_underlying_enum_type_name(const string &base_name, bool is_anonymous, uint64_t size)
Build the internal name of the underlying type of an enum.
Definition: abg-ir.cc:27128
shared_ptr< enum_type_decl > enum_type_decl_sptr
Convenience typedef for shared pointer to a enum_type_decl.
Definition: abg-fwd.h:172
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:6200
type_base_sptr strip_typedef(const type_base_sptr type)
Recursively returns the the underlying type of a typedef. The return type should not be a typedef of ...
Definition: abg-ir.cc:6764
uint64_t get_data_member_offset(const var_decl &m)
Get the offset of a data member.
Definition: abg-ir.cc:6217
vector< class_or_union_sptr > classes_or_unions_type
Convenience typedef for a vector of class_or_union_sptr.
Definition: abg-fwd.h:196
class_or_union * is_at_class_scope(const decl_base_sptr decl)
Tests whether a given decl is at class scope.
Definition: abg-ir.cc:10048
bool get_member_function_is_virtual(const function_decl &f)
Test if a given member function is virtual.
Definition: abg-ir.cc:6674
class_or_union * anonymous_data_member_to_class_or_union(const var_decl *d)
Get the class_or_union type of a given anonymous data member.
Definition: abg-ir.cc:6063
location get_location(const type_base_sptr &type)
Get the location of the declaration of a given type.
Definition: abg-ir.cc:8663
weak_ptr< decl_base > decl_base_wptr
Convenience typedef for a weak pointer to a decl_base.
Definition: abg-fwd.h:178
interned_string get_function_type_name(const function_type_sptr &fn_type, bool internal)
Get the name of a given function type and return a copy of it.
Definition: abg-ir.cc:8993
bool is_function_template_pattern(const shared_ptr< decl_base > decl)
Test whether a decl is the pattern of a function template.
Definition: abg-ir.cc:11135
class_or_union * look_through_decl_only_class(class_or_union *the_class)
If a class (or union) is a decl-only class, get its definition. Otherwise, just return the initial cl...
Definition: abg-ir.cc:10943
bool is_union_type(const type_or_decl_base &t)
Test if a type is a union_decl.
Definition: abg-ir.cc:10605
const location & get_artificial_or_natural_location(const decl_base *decl)
Get the artificial location of a decl.
Definition: abg-ir.cc:9726
enum_type_decl_sptr lookup_enum_type(const interned_string &type_name, const translation_unit &tu)
Lookup an enum type from a translation unit.
Definition: abg-ir.cc:11601
type_base_sptr peel_typedef_type(const type_base_sptr &type)
Return the leaf underlying type node of a typedef_decl node.
Definition: abg-ir.cc:7047
const type_base_wptrs_type * lookup_union_types(const interned_string &qualified_name, const corpus &corp)
Look into a given corpus to find the union type*s* that have a given qualified name.
Definition: abg-ir.cc:12855
shared_ptr< template_decl > template_decl_sptr
Convenience typedef for a shared pointer to template_decl.
Definition: abg-fwd.h:307
array_type_def_sptr is_typedef_of_array(const type_base_sptr &t)
Test if a type is a typedef of an array.
Definition: abg-ir.cc:11205
function_type_sptr lookup_function_type(const interned_string &type_name, const translation_unit &tu)
Lookup a function type from a translation unit.
Definition: abg-ir.cc:11851
bool is_global_scope(const scope_decl &scope)
Tests whether if a given scope is the global scope.
Definition: abg-ir.cc:9993
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:6363
bool is_data_member(const var_decl &v)
Test if a var_decl is a data member.
Definition: abg-ir.cc:5755
var_decl_sptr find_first_data_member_matching_regexp(const class_or_union &t, const regex::regex_t_sptr &r)
Find the first data member of a class or union which name matches a regular expression.
Definition: abg-ir.cc:27153
const type_base_wptrs_type * lookup_class_types(const interned_string &qualified_name, const corpus &corp)
Look into a given corpus to find the class type*s* that have a given qualified name.
Definition: abg-ir.cc:12804
const decl_base * get_type_declaration(const type_base *t)
Get the declaration for a given type.
Definition: abg-ir.cc:9881
shared_ptr< type_composition > type_composition_sptr
Convenience typedef for shared pointer to type_composition.
Definition: abg-fwd.h:344
void set_member_is_static(decl_base &d, bool s)
Sets the static-ness property of a class member.
Definition: abg-ir.cc:24952
interned_string get_method_type_name(const method_type_sptr fn_type, bool internal)
Get the name of a given method type and return a copy of it.
Definition: abg-ir.cc:9100
weak_ptr< template_decl > template_decl_wptr
Convenience typedef for a weak pointer to template_decl.
Definition: abg-fwd.h:310
shared_ptr< mem_fn_context_rel > mem_fn_context_rel_sptr
A convenience typedef for a shared pointer to mem_fn_context_rel.
Definition: abg-fwd.h:280
shared_ptr< type_decl > type_decl_sptr
Convenience typedef for a shared pointer on a type_decl.
Definition: abg-fwd.h:158
typedef_decl_sptr clone_typedef(const typedef_decl_sptr &t)
Clone a typedef type.
Definition: abg-ir.cc:7525
type_decl_sptr lookup_basic_type_per_location(const interned_string &loc, const corpus &corp)
Lookup a type_decl type from a given corpus, by its location.
Definition: abg-ir.cc:12692
const type_base_sptr lookup_type_through_scopes(const type_base_sptr type, const translation_unit &tu)
Lookup a type from a translation unit by walking the scopes of the translation unit in sequence and l...
Definition: abg-ir.cc:12263
void strip_redundant_quals_from_underyling_types(const qualified_type_def_sptr &t)
Merge redundant qualifiers from a tree of qualified types.
Definition: abg-ir.cc:7022
translation_unit * get_translation_unit(const decl_base &decl)
Return the translation unit a declaration belongs to.
Definition: abg-ir.cc:9964
type_or_decl_base * debug(const type_or_decl_base *artifact)
Emit a textual representation of an artifact to std error stream for debugging purposes.
Definition: abg-ir.cc:9746
shared_ptr< namespace_decl > namespace_decl_sptr
Convenience typedef for a shared pointer on namespace_decl.
Definition: abg-fwd.h:285
string demangle_cplus_mangled_name(const string &mangled_name)
Demangle a C++ mangled name and return the resulting string.
Definition: abg-ir.cc:14400
bool is_unique_type(const type_base_sptr &t)
Test if a type is unique in the entire environment.
Definition: abg-ir.cc:26691
bool types_are_compatible(const type_base_sptr type1, const type_base_sptr type2)
Test if two types are equal modulo a typedef.
Definition: abg-ir.cc:9915
interned_string get_type_name(const type_base_sptr &t, bool qualified, bool internal)
Get the name of a given type and return a copy of it.
Definition: abg-ir.cc:8732
const scope_decl * get_top_most_scope_under(const decl_base *decl, const scope_decl *scope)
Return the a scope S containing a given declaration and that is right under a given scope P.
Definition: abg-ir.cc:8484
type_base_sptr clone_array_tree(const type_base_sptr t)
Clone a type tree made of an array or a typedef of array.
Definition: abg-ir.cc:7603
interned_string get_name_of_pointer_to_type(const type_base &pointed_to_type, bool qualified, bool internal)
Get the name of the pointer to a given type.
Definition: abg-ir.cc:8894
bool is_at_template_scope(const shared_ptr< decl_base > decl)
Tests whether a given decl is at template scope.
Definition: abg-ir.cc:10113
typedef_decl_sptr lookup_typedef_type_per_location(const interned_string &loc, const corpus &corp)
Lookup a typedef_decl from a corpus, by its location.
Definition: abg-ir.cc:13162
function_decl * is_function_decl(const type_or_decl_base *d)
Test whether a declaration is a function_decl.
Definition: abg-ir.cc:10136
bool type_has_sub_type_changes(const type_base_sptr t_v1, const type_base_sptr t_v2)
Tests if the change of a given type effectively comes from just its sub-types. That is,...
Definition: abg-ir.cc:26511
method_type_sptr is_method_type(const type_or_decl_base_sptr &t)
Test whether a type is a method_type.
Definition: abg-ir.cc:10913
qualified_type_def * is_qualified_type(const type_or_decl_base *t)
Test whether a type is a reference_type_def.
Definition: abg-ir.cc:10863
typedef_decl_sptr lookup_typedef_type(const interned_string &type_name, const translation_unit &tu)
Lookup a typedef type from a translation unit.
Definition: abg-ir.cc:11639
interned_string get_function_id_or_pretty_representation(function_decl *fn)
Get the ID of a function, or, if the ID can designate several different functions,...
Definition: abg-ir.cc:9072
union_decl_sptr lookup_union_type_per_location(const interned_string &loc, const corpus &corp)
Lookup a union type in a given corpus, from its location.
Definition: abg-ir.cc:11566
string build_qualified_name(const scope_decl *scope, const string &name)
Build and return a qualified name from a name and its scope.
Definition: abg-ir.cc:8629
bool is_reference_to_decl_only_class_or_union_type(const type_or_decl_base *t)
Test if a type is a reference to a decl-only class/union.
Definition: abg-ir.cc:10698
enum_type_decl_sptr look_through_decl_only_enum(const enum_type_decl &the_enum)
If an enum is a decl-only enum, get its definition. Otherwise, just return the initial enum.
Definition: abg-ir.cc:10973
shared_ptr< function_tdecl > function_tdecl_sptr
Convenience typedef for a shared pointer on a function_tdecl.
Definition: abg-fwd.h:295
enum_type_decl_sptr is_compatible_with_enum_type(const type_base_sptr &t)
Test if a type is an enum. This function looks through typedefs.
Definition: abg-ir.cc:10429
type_base * peel_qualified_or_typedef_type(const type_base *type)
Return the leaf underlying type of a qualified or typedef type.
Definition: abg-ir.cc:7293
type_base_sptr type_or_void(const type_base_sptr t, const environment &env)
Return either the type given in parameter if it's non-null, or the void type.
Definition: abg-ir.cc:14430
bool is_at_global_scope(const decl_base &decl)
Tests whether a given declaration is at global scope.
Definition: abg-ir.cc:10021
vector< enum_type_decl_sptr > enums_type
Convenience typedef for a vector of enum_type_decl_sptr.
Definition: abg-fwd.h:175
bool is_member_decl(const decl_base_sptr d)
Tests if a declaration is a class member.
Definition: abg-ir.cc:5559
bool get_member_function_is_ctor(const function_decl &f)
Test whether a member function is a constructor.
Definition: abg-ir.cc:6428
void set_member_function_is_ctor(function_decl &f, bool c)
Setter for the is_ctor property of the member function.
Definition: abg-ir.cc:6458
std::shared_ptr< regex_t > regex_t_sptr
A convenience typedef for a shared pointer of regex_t.
Definition: abg-fwd.h:88
vector< suppression_sptr > suppressions_type
Convenience typedef for a vector of suppression_sptr.
Definition: abg-fwd.h:1556
shared_ptr< suppression_base > suppression_sptr
Convenience typedef for a shared pointer to a suppression.
Definition: abg-fwd.h:1553
bool base_name(string const &path, string &file_name)
Return the file name part of a file part.
Toplevel namespace for libabigail.
void dump(const decl_base_sptr d, std::ostream &o, const bool annotate)
Serialize a pointer to decl_base to an output stream.
Definition: abg-writer.cc:4713
void dump_decl_location(const decl_base &d, ostream &o)
Serialize the source location of a decl to an output stream for debugging purposes.
Definition: abg-writer.cc:4853
A functor to hash instances of interned_string.
The base of an entity of the intermediate representation that is to be traversed.
Definition: abg-ir.h:462