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 ptr_to_mbr_type;
235/// Convenience typedef for a shared pointer to a @ref ptr_to_mbr_type
236typedef shared_ptr<ptr_to_mbr_type> ptr_to_mbr_type_sptr;
237
238class array_type_def;
239
240/// Convenience typedef for a shared pointer on a @ref array_type_def
241typedef shared_ptr<array_type_def> array_type_def_sptr;
242
243class subrange_type;
244
245class dm_context_rel;
246
247/// A convenience typedef for a shared pointer to dm_context_rel.
248typedef shared_ptr<dm_context_rel> dm_context_rel_sptr;
249
250class var_decl;
251
252/// Convenience typedef for a shared pointer on a @ref var_decl
253typedef shared_ptr<var_decl> var_decl_sptr;
254
255/// Convenience typedef for a weak pointer on a @ref var_decl
256typedef weak_ptr<var_decl> var_decl_wptr;
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
268class method_decl;
269
270typedef shared_ptr<method_decl> method_decl_sptr;
271
273
274/// A convenience typedef for a shared pointer to @ref
275/// mem_fn_context_rel.
276typedef shared_ptr<mem_fn_context_rel> mem_fn_context_rel_sptr;
277
278class namespace_decl;
279
280/// Convenience typedef for a shared pointer on namespace_decl.
281typedef shared_ptr<namespace_decl> namespace_decl_sptr;
282
283class class_tdecl;
284
285/// Convenience typedef for a shared pointer on a @ref class_tdecl
286typedef shared_ptr<class_tdecl> class_tdecl_sptr;
287
288class function_tdecl;
289
290/// Convenience typedef for a shared pointer on a @ref function_tdecl
291typedef shared_ptr<function_tdecl> function_tdecl_sptr;
292
293class global_scope;
294
295/// Convenience typedef for shared pointer on @ref global_scope.
296typedef shared_ptr<global_scope> global_scope_sptr;
297
298class node_visitor;
299
300class template_decl;
301
302/// Convenience typedef for a shared pointer to @ref template_decl
303typedef shared_ptr<template_decl> template_decl_sptr;
304
305/// Convenience typedef for a weak pointer to template_decl
306typedef weak_ptr<template_decl> template_decl_wptr;
307
309
310/// Convenience typedef for shared pointer to template parameter
311typedef shared_ptr<template_parameter> template_parameter_sptr;
312
314
315/// Convenience typedef for shared pointer to @ref
316/// non_type_template_parameter
317typedef shared_ptr<non_type_tparameter> non_type_tparameter_sptr;
318
319class type_tparameter;
320
322
323/// Convenience typedef for a shared_ptr to @ref template_tparameter.
324typedef shared_ptr<template_tparameter> template_tparameter_sptr;
325
326/// Convenience typedef for a shared pointer to @ref type_tparameter.
327typedef shared_ptr<type_tparameter> type_tparameter_sptr;
328
329class type_composition;
330
332typedef shared_ptr<member_function_template> member_function_template_sptr;
333typedef vector<member_function_template_sptr> member_function_templates;
334
336typedef shared_ptr<member_class_template> member_class_template_sptr;
337typedef vector<member_class_template_sptr> member_class_templates;
338
339/// Convenience typedef for shared pointer to type_composition
340typedef shared_ptr<type_composition> type_composition_sptr;
341
342decl_base_sptr
343add_decl_to_scope(decl_base_sptr, scope_decl*);
344
345decl_base_sptr
346add_decl_to_scope(decl_base_sptr, const scope_decl_sptr&);
347
348const global_scope*
350
351const global_scope*
353
354const global_scope*
355get_global_scope(const decl_base_sptr);
356
359
362
364get_translation_unit(const decl_base_sptr);
365
366bool
368
369const global_scope*
371
372bool
374
375bool
377
378bool
379is_at_global_scope(const decl_base_sptr);
380
381bool
383
385is_at_class_scope(const decl_base_sptr);
386
389
392
393bool
394is_at_template_scope(const decl_base_sptr);
395
396bool
397is_template_parameter(const decl_base_sptr);
398
401
404
405bool
407
410
411decl_base_sptr
413
416
417decl_base_sptr
419
420bool
422
425
426type_base_sptr
428
429bool
431
432bool
433is_anonymous_type(const type_base_sptr&);
434
435bool
436is_npaf_type(const type_base_sptr&);
437
438const type_decl*
440
443
446
449
452
453const typedef_decl*
455
456const typedef_decl*
457is_typedef(const type_base*);
458
461
463is_compatible_with_enum_type(const type_base_sptr&);
464
466is_compatible_with_enum_type(const decl_base_sptr&);
467
470
471const enum_type_decl*
473
474bool
476
479
482
485
488
491
494
497
500
501bool
503 bool look_through_decl_only = false);
504
505bool
506is_declaration_only_class_or_union_type(const type_base_sptr& t,
507 bool look_through_decl_only = false);
508
511
512class_or_union_sptr
514
515bool
517 const class_or_union*);
518
519bool
520class_or_union_types_of_same_kind(const class_or_union_sptr&,
521 const class_or_union_sptr&);
522
523bool
525
528
529union_decl_sptr
531
533is_compatible_with_class_type(const type_base_sptr&);
534
536is_compatible_with_class_type(const decl_base_sptr&);
537
538const pointer_type_def*
540 bool look_through_qualifiers=false);
541
544 bool look_through_qualifiers=false);
545
547is_pointer_to_function_type(const type_base_sptr&);
548
550is_pointer_to_array_type(const type_base_sptr&);
551
553is_pointer_to_ptr_to_mbr_type(const type_base_sptr&);
554
556is_pointer_to_npaf_type(const type_base_sptr&);
557
558bool
560
561bool
563
564bool
566
568is_reference_type(type_or_decl_base*, bool look_through_qualifiers=false);
569
571is_reference_type(const type_or_decl_base*, bool look_through_qualifiers=false);
572
575 bool look_through_qualifiers=false);
576
577const ptr_to_mbr_type*
579 bool look_through_qualifiers=false);
580
583 bool look_through_qualifiers=false);
584
585const type_base*
587
588const type_base_sptr
589is_void_pointer_type(const type_base_sptr&);
590
591const type_base*
593
594const type_base*
596
599
600qualified_type_def_sptr
602
605
608
609const function_type*
611
614
615const method_type*
617
620
621class_or_union_sptr
623
624class_or_union_sptr
625look_through_decl_only_class(class_or_union_sptr);
626
629
632
635
636decl_base_sptr
638
641
642decl_base_sptr
643look_through_decl_only(const decl_base_sptr&);
644
647
650
652is_namespace(const decl_base_sptr&);
653
655is_namespace(const decl_base*);
656
657bool
658is_template_parm_composition_type(const decl_base_sptr);
659
660bool
661is_template_decl(const decl_base_sptr);
662
663bool
664is_function_template_pattern(const decl_base_sptr);
665
666
667decl_base_sptr
668insert_decl_into_scope(decl_base_sptr,
669 vector<decl_base_sptr >::iterator,
670 scope_decl*);
671
672decl_base_sptr
673insert_decl_into_scope(decl_base_sptr,
674 vector<decl_base_sptr >::iterator,
676
677bool
678has_scope(const decl_base&);
679
680bool
681has_scope(const decl_base_sptr);
682
683bool
684is_member_decl(const decl_base_sptr);
685
686bool
688
689bool
691
694
696is_scope_decl(const decl_base_sptr&);
697
698bool
699is_member_type(const type_base_sptr&);
700
701bool
703
704bool
705is_user_defined_type(const type_base_sptr&);
706
707void
708remove_decl_from_scope(decl_base_sptr);
709
710bool
712
713bool
715
716bool
717get_member_is_static(const decl_base_sptr&);
718
719void
721
722void
723set_member_is_static(const decl_base_sptr&, bool);
724
725bool
727
730
731bool
733
736
737bool
739
741is_data_member(const decl_base_sptr&);
742
745
748
749const var_decl_sptr
750get_next_data_member(const class_or_union_sptr&, const var_decl_sptr&);
751
754
757
759get_last_data_member(const class_or_union_sptr&);
760
761bool
763
764const var_decl*
766
767const var_decl*
769
772
774is_anonymous_data_member(const decl_base_sptr&);
775
778
779const var_decl*
781
782bool
784
785bool
787
788bool
790
791bool
793
794const var_decl_sptr
796
799 const string&);
800
803
804class_or_union_sptr
806
807class_or_union_sptr
809
810bool
812 const class_or_union& clazz);
813
814bool
816
817const class_or_union_sptr
819
820const class_or_union_sptr
822
823const class_or_union_sptr
825
828 bool look_through_qualifiers = false);
829
832 bool look_through_qualifiers = false);
833
835is_array_of_qualified_element(const type_base_sptr&);
836
837qualified_type_def_sptr
839
841is_typedef_of_array(const type_base_sptr&);
842
843void
845
846uint64_t
848
849uint64_t
851
852uint64_t
853get_data_member_offset(const decl_base_sptr);
854
855uint64_t
857
858bool
860 const var_decl_sptr&,
861 uint64_t&);
862
863bool
864get_next_data_member_offset(const class_or_union_sptr&,
865 const var_decl_sptr&,
866 uint64_t&);
867
868uint64_t
870
871void
873
874bool
876
877bool
879
880bool
882
883bool
885
886bool
888
889bool
891
892bool
894
895void
897
898void
900
901bool
903
904bool
906
907void
909
910void
912
913bool
915
916bool
918
919void
921
922void
924
925bool
927
928ssize_t
930
931ssize_t
933
934void
936 ssize_t s);
937
938void
940 ssize_t s);
941
942bool
944
945bool
947
948bool
950
951void
953
954void
956
957type_base_sptr
958strip_typedef(const type_base_sptr);
959
960decl_base_sptr
961strip_useless_const_qualification(const qualified_type_def_sptr t);
962
963void
964strip_redundant_quals_from_underyling_types(const qualified_type_def_sptr&);
965
966type_base_sptr
967peel_typedef_type(const type_base_sptr&);
968
969const type_base*
971
972type_base_sptr
973peel_pointer_type(const type_base_sptr&);
974
975const type_base*
977
978type_base_sptr
979peel_reference_type(const type_base_sptr&);
980
981const type_base*
983
984const type_base_sptr
985peel_array_type(const type_base_sptr&);
986
987const type_base*
989
990const type_base*
992
993const type_base_sptr
994peel_qualified_type(const type_base_sptr&);
995
998
999type_base_sptr
1000peel_qualified_or_typedef_type(const type_base_sptr &type);
1001
1002type_base_sptr
1003peel_typedef_pointer_or_reference_type(const type_base_sptr);
1004
1005type_base*
1007
1008type_base*
1010 bool peel_qual_type);
1011
1012type_base*
1014 bool peel_qualified_type = true);
1015
1017clone_array(const array_type_def_sptr& array);
1018
1021
1022qualified_type_def_sptr
1023clone_qualified_type(const qualified_type_def_sptr& t);
1024
1025type_base_sptr
1026clone_array_tree(const type_base_sptr t);
1027
1028string
1029get_name(const type_or_decl_base*, bool qualified = true);
1030
1031string
1033 bool qualified = true);
1034
1036get_location(const type_base_sptr& type);
1037
1039get_location(const decl_base_sptr& decl);
1040
1041string
1042build_qualified_name(const scope_decl* scope, const string& name);
1043
1044string
1045build_qualified_name(const scope_decl* scope,
1046 const type_base_sptr& type);
1047
1050
1052get_type_scope(const type_base_sptr&);
1053
1055get_type_name(const type_base_sptr&,
1056 bool qualified = true,
1057 bool internal = false);
1058
1061 bool qualified = true,
1062 bool internal = false);
1063
1066 bool qualified = true,
1067 bool internal = false);
1068
1070get_name_of_pointer_to_type(const type_base& pointed_to_type,
1071 bool qualified = true,
1072 bool internal = false);
1073
1075get_name_of_reference_to_type(const type_base& pointed_to_type,
1076 bool lvalue_reference = false,
1077 bool qualified = true,
1078 bool internal = false);
1079
1082 bool internal = false);
1083
1085get_function_type_name(const function_type*, bool internal = false);
1086
1088get_function_type_name(const function_type&, bool internal = false);
1089
1092
1094get_method_type_name(const method_type_sptr&, bool internal = false);
1095
1097get_method_type_name(const method_type*, bool internal = false);
1098
1100get_method_type_name(const method_type&, bool internal = false);
1101
1102string
1103get_pretty_representation(const decl_base*, bool internal = false);
1104
1105string
1106get_pretty_representation(const type_base*, bool internal = false);
1107
1108string
1109get_pretty_representation(const type_or_decl_base*, bool internal = false);
1110
1111string
1113 bool internal = false);
1114
1115string
1116get_pretty_representation(const decl_base_sptr&, bool internal = false);
1117
1118string
1119get_pretty_representation(const type_base_sptr&, bool internal = false);
1120
1121string
1122get_pretty_representation(const function_type&, bool internal = false);
1123
1124string
1125get_pretty_representation(const function_type*, bool internal = false);
1126
1127string
1129 bool internal = false);
1130
1131string
1132get_pretty_representation(const method_type&, bool internal = false);
1133
1134string
1135get_pretty_representation(const method_type*, bool internal = false);
1136
1137string
1139 bool internal = false);
1140
1141string
1143 const string& indent,
1144 bool one_line,
1145 bool internal,
1146 bool qualified_name = true);
1147
1148string
1150 const string& indent,
1151 bool one_line,
1152 bool internal,
1153 bool qualified_name = true);
1154
1155string
1156get_class_or_union_flat_representation(const class_or_union_sptr& cou,
1157 const string& indent,
1158 bool one_line,
1159 bool internal,
1160 bool qualified_name = true);
1161
1162string
1164 const string& indent,
1165 bool one_line,
1166 bool internal,
1167 bool qualified_names);
1168
1169string
1171 const string& indent,
1172 bool one_line,
1173 bool internal,
1174 bool qualified_names);
1175
1176string
1178 const string& indent,
1179 bool one_line,
1180 bool qualified_names);
1181
1182string
1184 const string& indent,
1185 bool one_line,
1186 bool internal,
1187 bool qualified_name);
1188
1189string
1191
1193get_data_member(class_or_union *, const char*);
1194
1196get_data_member(type_base *clazz, const char* member_name);
1197
1198const location&
1200
1201const location&
1203
1205debug(const type_or_decl_base* artifact);
1206
1207type_base*
1208debug(const type_base* artifact);
1209
1210decl_base*
1211debug(const decl_base* artifact);
1212
1213bool
1215
1216void
1217debug_comp_stack(const environment& env);
1218
1219bool
1221
1222const decl_base*
1224
1225decl_base*
1227
1228decl_base_sptr
1229get_type_declaration(const type_base_sptr);
1230
1231bool
1232types_are_compatible(const type_base_sptr,
1233 const type_base_sptr);
1234
1235bool
1236types_are_compatible(const decl_base_sptr,
1237 const decl_base_sptr);
1238
1239const scope_decl*
1241 const scope_decl*);
1242
1243const scope_decl*
1244get_top_most_scope_under(const decl_base_sptr,
1245 const scope_decl*);
1246
1247const scope_decl*
1248get_top_most_scope_under(const decl_base_sptr,
1249 const scope_decl_sptr);
1250
1251void
1252fqn_to_components(const std::string&,
1253 std::list<string>&);
1254
1255string
1256components_to_type_name(const std::list<string>&);
1257
1260
1263
1265lookup_basic_type(const string&, const translation_unit&);
1266
1268lookup_basic_type(const type_decl&, const corpus&);
1269
1271lookup_basic_type(const string&, const corpus&);
1272
1275
1278
1280lookup_basic_type_per_location(const string&, const corpus&);
1281
1284
1287
1289lookup_class_type(const string&, const translation_unit&);
1290
1292lookup_class_type(const class_decl&, const corpus&);
1293
1296
1299
1302
1303bool
1305 const corpus&,
1307
1309lookup_class_types(const string&, const corpus&);
1310
1312lookup_union_types(const string&, const corpus&);
1313
1316
1318lookup_class_type_per_location(const string&, const corpus&);
1319
1321lookup_class_type(const string&, const corpus&);
1322
1324lookup_class_type_through_scopes(const std::list<string>&,
1325 const translation_unit&);
1326
1327union_decl_sptr
1329
1330union_decl_sptr
1332
1333union_decl_sptr
1335
1336union_decl_sptr
1337lookup_union_type_per_location(const string&, const corpus&);
1338
1339union_decl_sptr
1340lookup_union_type(const string&, const corpus&);
1341
1344
1346lookup_enum_type(const string&, const translation_unit&);
1347
1349lookup_enum_type(const enum_type_decl&, const corpus&);
1350
1352lookup_enum_type(const string&, const corpus&);
1353
1356
1359
1361lookup_enum_types(const string&, const corpus&);
1362
1365
1367lookup_enum_type_per_location(const string&, const corpus&);
1368
1371
1374
1376lookup_typedef_type(const interned_string& type_name,
1377 const translation_unit& tu);
1378
1380lookup_typedef_type(const string& type_name, const translation_unit& tu);
1381
1384
1387
1389lookup_typedef_type_per_location(const string&, const corpus &);
1390
1392lookup_typedef_type(const string&, const corpus&);
1393
1394type_base_sptr
1395lookup_class_or_typedef_type(const string&, const translation_unit&);
1396
1397type_base_sptr
1399
1400type_base_sptr
1401lookup_class_or_typedef_type(const string&, const corpus&);
1402
1403type_base_sptr
1404lookup_class_typedef_or_enum_type(const string&, const corpus&);
1405
1406qualified_type_def_sptr
1408
1409qualified_type_def_sptr
1410lookup_qualified_type(const string&, const translation_unit&);
1411
1412qualified_type_def_sptr
1414
1415qualified_type_def_sptr
1417
1420
1422lookup_pointer_type(const string&, const translation_unit&);
1423
1425lookup_pointer_type(const type_base_sptr& pointed_to_type,
1426 const translation_unit& tu);
1427
1430
1433
1436
1438lookup_reference_type(const string&, const translation_unit&);
1439
1441lookup_reference_type(const type_base_sptr& pointed_to_type,
1442 bool lvalue_reference,
1443 const translation_unit& tu);
1444
1447
1450
1453
1455lookup_array_type(const string&, const translation_unit&);
1456
1459
1462
1464lookup_function_type(const string&,
1465 const translation_unit&);
1466
1469 const translation_unit&);
1470
1473 const translation_unit&);
1474
1477 const translation_unit&);
1478
1481
1484
1487
1490
1491type_base_sptr
1492lookup_type(const string&, const translation_unit&);
1493
1494const type_base_sptr
1495lookup_type(const type_base_sptr, const translation_unit&);
1496
1497type_base_sptr
1498lookup_type(const interned_string&, const corpus&);
1499
1500type_base_sptr
1502
1503type_base_sptr
1504lookup_type(const type_base&, const corpus&);
1505
1506type_base_sptr
1507lookup_type(const type_base_sptr&, const corpus&);
1508
1509type_base_sptr
1510lookup_type_through_scopes(const std::list<string>&,
1511 const translation_unit&);
1512
1513type_base_sptr
1514lookup_type_through_translation_units(const string&, const corpus&);
1515
1516type_base_sptr
1517lookup_type_from_translation_unit(const string& type_name,
1518 const string& tu_path,
1519 const corpus& corp);
1520
1523 const corpus&);
1524
1525type_base_sptr
1526synthesize_type_from_translation_unit(const type_base_sptr&,
1528
1532
1533const type_base_sptr
1534lookup_type_in_scope(const string&,
1535 const scope_decl_sptr&);
1536
1537const type_base_sptr
1538lookup_type_in_scope(const std::list<string>&,
1539 const scope_decl_sptr&);
1540
1541const decl_base_sptr
1542lookup_var_decl_in_scope(const string&,
1543 const scope_decl_sptr&);
1544
1545const decl_base_sptr
1546lookup_var_decl_in_scope(const std::list<string>&,
1547 const scope_decl_sptr&);
1548
1549string
1550demangle_cplus_mangled_name(const string&);
1551
1552type_base_sptr
1553type_or_void(const type_base_sptr, const environment&);
1554
1555type_base_sptr
1556canonicalize(type_base_sptr);
1557
1558type_base*
1559type_has_non_canonicalized_subtype(type_base_sptr t);
1560
1561bool
1562type_has_sub_type_changes(type_base_sptr t_v1,
1563 type_base_sptr t_v2);
1564
1565void
1566keep_type_alive(type_base_sptr t);
1567
1568size_t
1569hash_type(const type_base *t);
1570
1571size_t
1573
1574size_t
1576
1577bool
1579
1580bool
1581is_non_canonicalized_type(const type_base_sptr&);
1582
1583bool
1584is_unique_type(const type_base_sptr&);
1585
1586bool
1588
1589/// For a given type, return its exemplar type.
1590///
1591/// For a given type, its exemplar type is either its canonical type
1592/// or the canonical type of the definition type of a given
1593/// declaration-only type. If the neither of those two types exist,
1594/// then the exemplar type is the given type itself.
1595///
1596/// @param type the input to consider.
1597///
1598/// @return the exemplar type.
1599type_base*
1600get_exemplar_type(const type_base* type);
1601
1602bool
1604
1605bool
1606types_have_similar_structure(const type_base_sptr& first,
1607 const type_base_sptr& second,
1608 bool indirect_type = false);
1609
1610bool
1612 const type_base* second,
1613 bool indirect_type = false);
1614
1615string
1617 bool is_anonymous,
1618 uint64_t size);
1619
1622 const regex::regex_t_sptr& r);
1623
1626 const regex::regex_t_sptr& regex);
1627} // end namespace ir
1628
1629using namespace abigail::ir;
1630
1631namespace suppr
1632{
1633class suppression_base;
1634
1635/// Convenience typedef for a shared pointer to a @ref suppression.
1636typedef shared_ptr<suppression_base> suppression_sptr;
1637
1638/// Convenience typedef for a vector of @ref suppression_sptr
1639typedef vector<suppression_sptr> suppressions_type;
1640
1641} // end namespace suppr
1642
1643namespace symtab_reader
1644{
1645
1646class symtab;
1647/// Convenience typedef for a shared pointer to a @ref symtab
1648typedef std::shared_ptr<symtab> symtab_sptr;
1649
1650} // end namespace symtab_reader
1651
1652void
1653dump(const decl_base_sptr, std::ostream&);
1654
1655void
1656dump(const decl_base_sptr);
1657
1658void
1659dump(const type_base_sptr, std::ostream&);
1660
1661void
1662dump(const type_base_sptr);
1663
1664void
1665dump(const var_decl_sptr, std::ostream&);
1666
1667void
1668dump(const var_decl_sptr);
1669
1670void
1671dump(const translation_unit&, std::ostream&);
1672
1673void
1674dump(const translation_unit&);
1675
1676void
1677dump(const translation_unit_sptr, std::ostream&);
1678
1679void
1681
1682void
1684
1685void
1687
1688void
1689dump_decl_location(const decl_base_sptr&);
1690
1691#ifndef ABG_ASSERT
1692/// This is a wrapper around the 'assert' glibc call. It allows for
1693/// its argument to have side effects, so that it keeps working when
1694/// the code of libabigail is compiled with the NDEBUG macro defined.
1695#define ABG_ASSERT(cond) do {({bool __abg_cond__ = bool(cond); assert(__abg_cond__); !!__abg_cond__;});} while (false)
1696#endif
1697
1698} // end namespace abigail
1699#endif // __ABG_IRFWD_H__
std::shared_ptr< symtab > symtab_sptr
Convenience typedef for a shared pointer to a symtab.
Definition: abg-fwd.h:1648
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:2519
Abstracts a class declaration.
Definition: abg-ir.h:4228
The base type of class_decl and union_decl.
Definition: abg-ir.h:4026
Abstract a class template.
Definition: abg-ir.h:3829
Abstraction of a group of corpora.
Definition: abg-corpus.h:356
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:1538
The abstraction for a data member context relationship. This relates a data member to its parent clas...
Definition: abg-ir.h:2954
Abstracts a declaration for an enum type.
Definition: abg-ir.h:2750
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:3111
Abstract a function template declaration.
Definition: abg-ir.h:3780
Abstraction of a function type.
Definition: abg-ir.h:3387
This abstracts the global scope of a given translation unit.
Definition: abg-ir.h:1952
The base class for the visitor type hierarchy used for traversing a translation unit.
Definition: abg-ir.h:4952
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:4553
Abstracts a member class template template.
Definition: abg-ir.h:4758
Abstract a member function template.
Definition: abg-ir.h:4703
Abstraction of the declaration of a method.
Definition: abg-ir.h:3924
Abstracts the type of a class member function.
Definition: abg-ir.h:3483
The abstraction of a namespace declaration.
Definition: abg-ir.h:2197
Abstracts non type template parameters.
Definition: abg-ir.h:3657
The abstraction of a pointer type.
Definition: abg-ir.h:2337
The abstraction of a pointer-to-member type.
Definition: abg-ir.h:2466
The abstraction of a qualified type.
Definition: abg-ir.h:2226
Abstracts a reference type.
Definition: abg-ir.h:2400
A declaration that introduces a scope.
Definition: abg-ir.h:1809
A type that introduces a scope.
Definition: abg-ir.h:2171
The base class of templates.
Definition: abg-ir.h:3539
Base class for a template parameter. Client code should use the more specialized type_template_parame...
Definition: abg-ir.h:3574
Abstracts a template template parameter.
Definition: abg-ir.h:3704
This is the abstraction of the set of relevant artefacts (types, variable declarations,...
Definition: abg-ir.h:686
An abstraction helper for type declarations.
Definition: abg-ir.h:1973
This abstracts a composition of types based on template type parameters. The result of the compositio...
Definition: abg-ir.h:3742
A basic type declaration that introduces no scope.
Definition: abg-ir.h:2108
The base class of both types and declarations.
Definition: abg-ir.h:1368
Abstracts a type template parameter.
Definition: abg-ir.h:3620
The abstraction of a typedef declaration.
Definition: abg-ir.h:2889
Abstracts a union type declaration.
Definition: abg-ir.h:4483
Abstracts a variable declaration.
Definition: abg-ir.h:3008
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:327
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:12616
bool is_non_canonicalized_type(const type_base *t)
Test if a given type is allowed to be non canonicalized.
Definition: abg-ir.cc:27808
shared_ptr< dm_context_rel > dm_context_rel_sptr
A convenience typedef for a shared pointer to dm_context_rel.
Definition: abg-fwd.h:248
bool get_member_function_is_dtor(const function_decl &f)
Test whether a member function is a destructor.
Definition: abg-ir.cc:6620
const type_base * peel_qualified_type(const type_base *type)
Return the leaf underlying type of a qualified type.
Definition: abg-ir.cc:7381
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:12103
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:27785
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:11967
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:6015
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:6320
weak_ptr< var_decl > var_decl_wptr
Convenience typedef for a weak pointer on a var_decl.
Definition: abg-fwd.h:256
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:11754
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:5809
pointer_type_def_sptr is_pointer_to_npaf_type(const type_base_sptr &t)
Test if we are looking at a pointer to a neither-a-pointer-to-an-array-nor-a-function type.
Definition: abg-ir.cc:11212
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:10090
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:13684
pointer_type_def_sptr is_pointer_to_array_type(const type_base_sptr &t)
Test if a type is a pointer to array type.
Definition: abg-ir.cc:11194
shared_ptr< class_tdecl > class_tdecl_sptr
Convenience typedef for a shared pointer on a class_tdecl.
Definition: abg-fwd.h:286
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:13846
void set_member_function_is_virtual(function_decl &f, bool is_virtual)
Set the virtual-ness of a member function.
Definition: abg-ir.cc:6845
ssize_t get_member_function_vtable_offset(const function_decl &f)
Get the vtable offset of a member function.
Definition: abg-ir.cc:6744
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:8850
qualified_type_def_sptr clone_qualified_type(const qualified_type_def_sptr &t)
Clone a qualifiend type.
Definition: abg-ir.cc:7683
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:11445
bool is_type(const type_or_decl_base &tod)
Test whether a declaration is a type.
Definition: abg-ir.cc:10541
scope_decl * is_scope_decl(decl_base *d)
Test if a declaration is a scope_decl.
Definition: abg-ir.cc:5679
bool is_anonymous_data_member(const decl_base &d)
Test if a decl is an anonymous data member.
Definition: abg-ir.cc:6038
bool is_template_parameter(const shared_ptr< decl_base > decl)
Tests whether a decl is a template parameter.
Definition: abg-ir.cc:10415
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:7290
bool has_scope(const decl_base &d)
Tests if a declaration has got a scope.
Definition: abg-ir.cc:5633
void set_member_function_vtable_offset(function_decl &f, ssize_t s)
Set the vtable offset of a member function.
Definition: abg-ir.cc:6777
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:13243
type_base * get_exemplar_type(const type_base *type)
For a given type, return its exemplar type.
Definition: abg-ir.cc:27879
shared_ptr< non_type_tparameter > non_type_tparameter_sptr
Convenience typedef for shared pointer to non_type_template_parameter.
Definition: abg-fwd.h:317
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:10791
void remove_decl_from_scope(decl_base_sptr decl)
Remove a given decl from its scope.
Definition: abg-ir.cc:8525
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:10155
array_type_def_sptr clone_array(const array_type_def_sptr &array)
Clone an array type.
Definition: abg-ir.cc:7616
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:28360
const ptr_to_mbr_type * is_ptr_to_mbr_type(const type_or_decl_base *t, bool look_through_qualifiers)
Test whether a type is a ptr_to_mbr_type.
Definition: abg-ir.cc:11369
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:5952
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:12978
string get_enum_flat_representation(const enum_type_decl &enum_type, const string &indent, bool one_line, bool qualified_names)
Get the flat representation of an instance of enum_type_decl type.
Definition: abg-ir.cc:9710
bool is_user_defined_type(const type_base *t)
Test if a type is user-defined.
Definition: abg-ir.cc:5713
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:11993
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:10140
shared_ptr< global_scope > global_scope_sptr
Convenience typedef for shared pointer on global_scope.
Definition: abg-fwd.h:296
bool is_class_type(const type_or_decl_base &t)
Test whether a type is a class.
Definition: abg-ir.cc:10823
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:14929
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
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:13268
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:11007
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:9332
bool is_anonymous_type(const type_base *t)
Test whether a declaration is a type.
Definition: abg-ir.cc:10592
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:13871
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:6224
type_decl * is_integral_type(const type_or_decl_base *t)
Test if a type is an integral type.
Definition: abg-ir.cc:10661
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:6280
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:13547
void set_member_function_is_dtor(function_decl &f, bool d)
Set the destructor-ness property of a member function.
Definition: abg-ir.cc:6648
const type_base_sptr peel_array_type(const type_base_sptr &type)
Return the leaf element type of an array.
Definition: abg-ir.cc:7339
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:12434
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:28023
shared_ptr< template_parameter > template_parameter_sptr
Convenience typedef for shared pointer to template parameter.
Definition: abg-fwd.h:311
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:11054
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:9972
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:5976
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:7477
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:6704
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:7032
namespace_decl_sptr is_namespace(const decl_base_sptr &d)
Tests if a declaration is a namespace declaration.
Definition: abg-ir.cc:11736
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:10643
decl_base * is_decl_slow(const type_or_decl_base *t)
Test if an ABI artifact is a declaration.
Definition: abg-ir.cc:10521
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:11625
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:11516
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:8736
typedef_decl_sptr is_typedef(const type_or_decl_base_sptr t)
Test whether a type is a typedef.
Definition: abg-ir.cc:10701
shared_ptr< template_tparameter > template_tparameter_sptr
Convenience typedef for a shared_ptr to template_tparameter.
Definition: abg-fwd.h:324
uint64_t get_var_size_in_bits(const var_decl_sptr &v)
Get the size of a given variable.
Definition: abg-ir.cc:6482
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:13714
string get_debug_representation(const type_or_decl_base *artifact)
Get the textual representation of a type for debugging purposes.
Definition: abg-ir.cc:9859
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:15012
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:7234
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:12143
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:13218
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:11814
bool is_typedef_of_maybe_qualified_class_or_union_type(const type_base *t)
Test if a type is a typedef of a class or union type, or a typedef of a qualified class or union type...
Definition: abg-ir.cc:11272
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:7579
vector< function_type_sptr > function_types_type
Convenience typedef fo a vector of function_type_sptr.
Definition: abg-fwd.h:210
reference_type_def * is_reference_type(type_or_decl_base *t, bool look_through_qualifiers)
Test whether a type is a reference_type_def.
Definition: abg-ir.cc:11309
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:13471
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:6733
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:8544
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:10773
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:27971
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:10384
const global_scope * get_global_scope(const decl_base &decl)
return the global scope as seen by a given declaration.
Definition: abg-ir.cc:8593
shared_ptr< var_decl > var_decl_sptr
Convenience typedef for a shared pointer on a var_decl.
Definition: abg-fwd.h:253
shared_ptr< ptr_to_mbr_type > ptr_to_mbr_type_sptr
Convenience typedef for a shared pointer to a ptr_to_mbr_type.
Definition: abg-fwd.h:236
const location & get_natural_or_artificial_location(const decl_base *decl)
Get the non-artificial (natural) location of a decl.
Definition: abg-ir.cc:10000
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:27706
bool is_template_decl(const decl_base_sptr &decl)
Tests whether a decl is a template.
Definition: abg-ir.cc:11896
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:12372
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
bool is_data_member_of_anonymous_class_or_union(const var_decl &d)
Test if a var_decl is a data member belonging to an anonymous type.
Definition: abg-ir.cc:6156
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:11408
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:12633
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:27643
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:12326
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:12549
bool get_data_member_is_laid_out(const var_decl &m)
Test whether a data member is laid out.
Definition: abg-ir.cc:6510
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:12180
type_base_sptr canonicalize(type_base_sptr t)
Compute the canonical type of a given type.
Definition: abg-ir.cc:15752
bool get_member_function_is_const(const function_decl &f)
Test whether a member function is const.
Definition: abg-ir.cc:6676
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:9082
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
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:14176
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:6395
uint64_t get_absolute_data_member_offset(const var_decl &m)
Get the absolute offset of a data member.
Definition: abg-ir.cc:6439
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:6534
var_decl * is_var_decl(const type_or_decl_base *tod)
Tests if a declaration is a variable declaration.
Definition: abg-ir.cc:11717
decl_base * is_decl(const type_or_decl_base *d)
Test if an ABI artifact is a declaration.
Definition: abg-ir.cc:10481
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:27681
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:12478
bool is_member_type(const type_base_sptr &t)
Tests if a type is a class member.
Definition: abg-ir.cc:5698
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:9554
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:8501
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:28314
bool is_npaf_type(const type_base_sptr &t)
Test if a type is a neither a pointer, an array nor a function type.
Definition: abg-ir.cc:10628
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:6333
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:6897
uint64_t get_data_member_offset(const var_decl &m)
Get the offset of a data member.
Definition: abg-ir.cc:6350
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:10341
bool get_member_function_is_virtual(const function_decl &f)
Test if a given member function is virtual.
Definition: abg-ir.cc:6807
const pointer_type_def * is_pointer_type(const type_or_decl_base *t, bool look_through_qualifiers)
Test whether a type is a pointer_type_def.
Definition: abg-ir.cc:11137
string get_class_or_enum_flat_representation(const type_base &coe, const string &indent, bool one_line, bool internal, bool qualified_name)
Get the flat representation of an instance of enum_type_decl type.
Definition: abg-ir.cc:9831
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:6196
location get_location(const type_base_sptr &type)
Get the location of the declaration of a given type.
Definition: abg-ir.cc:8816
pointer_type_def_sptr is_pointer_to_function_type(const type_base_sptr &t)
Test if a type is a pointer to function type.
Definition: abg-ir.cc:11177
weak_ptr< decl_base > decl_base_wptr
Convenience typedef for a weak pointer to a decl_base.
Definition: abg-fwd.h:178
var_decl_sptr has_fake_flexible_array_data_member(const class_decl &klass)
Test if the last data member of a class is an array with one element.
Definition: abg-ir.cc:10934
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:9159
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:11768
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:11576
bool is_union_type(const type_or_decl_base &t)
Test if a type is a union_decl.
Definition: abg-ir.cc:11103
const location & get_artificial_or_natural_location(const decl_base *decl)
Get the artificial location of a decl.
Definition: abg-ir.cc:10019
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:12248
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:7180
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:13502
shared_ptr< template_decl > template_decl_sptr
Convenience typedef for a shared pointer to template_decl.
Definition: abg-fwd.h:303
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:11852
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:12498
bool is_global_scope(const scope_decl &scope)
Tests whether if a given scope is the global scope.
Definition: abg-ir.cc:10286
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:6496
pointer_type_def_sptr is_pointer_to_ptr_to_mbr_type(const type_base_sptr &t)
Test if we are looking at a pointer to pointer to member type.
Definition: abg-ir.cc:11229
bool is_data_member(const var_decl &v)
Test if a var_decl is a data member.
Definition: abg-ir.cc:5847
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:28339
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:13451
const decl_base * get_type_declaration(const type_base *t)
Get the declaration for a given type.
Definition: abg-ir.cc:10174
var_decl_sptr has_flexible_array_data_member(const class_decl &klass)
Test if the last data member of a class is an array with non-finite data member.
Definition: abg-ir.cc:10864
shared_ptr< type_composition > type_composition_sptr
Convenience typedef for shared pointer to type_composition.
Definition: abg-fwd.h:340
void set_member_is_static(decl_base &d, bool s)
Sets the static-ness property of a class member.
Definition: abg-ir.cc:26106
array_type_def * is_array_type(const type_or_decl_base *type, bool look_through_qualifiers)
Test if a type is an array_type_def.
Definition: abg-ir.cc:11781
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:9252
weak_ptr< template_decl > template_decl_wptr
Convenience typedef for a weak pointer to template_decl.
Definition: abg-fwd.h:306
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:276
interned_string get_function_id_or_pretty_representation(const function_decl *fn)
Get the ID of a function, or, if the ID can designate several different functions,...
Definition: abg-ir.cc:9224
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:7658
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:13339
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:12910
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:7155
translation_unit * get_translation_unit(const decl_base &decl)
Return the translation unit a declaration belongs to.
Definition: abg-ir.cc:10257
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:10039
shared_ptr< namespace_decl > namespace_decl_sptr
Convenience typedef for a shared pointer on namespace_decl.
Definition: abg-fwd.h:281
string demangle_cplus_mangled_name(const string &mangled_name)
Demangle a C++ mangled name and return the resulting string.
Definition: abg-ir.cc:15086
bool is_unique_type(const type_base_sptr &t)
Test if a type is unique in the entire environment.
Definition: abg-ir.cc:27844
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:10208
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:8885
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:8637
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:7736
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:9060
bool is_at_template_scope(const shared_ptr< decl_base > decl)
Tests whether a given decl is at template scope.
Definition: abg-ir.cc:10406
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:13809
function_decl * is_function_decl(const type_or_decl_base *d)
Test whether a declaration is a function_decl.
Definition: abg-ir.cc:10429
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:27665
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:11546
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:11496
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:12286
bool is_typedef_ptr_or_ref_to_decl_only_class_or_union_type(const type_base *t)
Test if a type is a typedef, pointer or reference to a decl-only class/union.
Definition: abg-ir.cc:11249
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:12213
bool class_or_union_types_of_same_kind(const class_or_union *first, const class_or_union *second)
Test if two class or union types are of the same kind.
Definition: abg-ir.cc:11075
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:8782
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:11606
shared_ptr< function_tdecl > function_tdecl_sptr
Convenience typedef for a shared pointer on a function_tdecl.
Definition: abg-fwd.h:291
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:10740
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:7426
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:15116
bool is_at_global_scope(const decl_base &decl)
Tests whether a given declaration is at global scope.
Definition: abg-ir.cc:10314
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:5651
bool get_member_function_is_ctor(const function_decl &f)
Test whether a member function is a constructor.
Definition: abg-ir.cc:6561
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:6591
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:1639
shared_ptr< suppression_base > suppression_sptr
Convenience typedef for a shared pointer to a suppression.
Definition: abg-fwd.h:1636
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:4827
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:4967
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