• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2 // -*- Mode: C++ -*-
3 //
4 // Copyright (C) 2013-2022 Red Hat, Inc.
5 //
6 // Author: Dodji Seketeli
7 
8 /// @file
9 ///
10 /// This file contains the declarations of the entry points to
11 /// de-serialize an instance of @ref abigail::translation_unit from an
12 /// ABI Instrumentation file in libabigail native XML format.
13 
14 #ifndef __ABG_READER_H__
15 #define __ABG_READER_H__
16 
17 #include <istream>
18 #include "abg-corpus.h"
19 #include "abg-suppression.h"
20 #include "abg-fe-iface.h"
21 
22 namespace abigail
23 {
24 
25 namespace abixml
26 {
27 
28 using namespace abigail::ir;
29 
30 translation_unit_sptr
31 read_translation_unit_from_file(const std::string&	file_path,
32 				environment&		env);
33 
34 translation_unit_sptr
35 read_translation_unit_from_buffer(const std::string&	file_path,
36 				  environment&		env);
37 
38 translation_unit_sptr
39 read_translation_unit_from_istream(std::istream*	in,
40 				   environment&	env);
41 
42 translation_unit_sptr
43 read_translation_unit(fe_iface&);
44 
45  abigail::fe_iface_sptr
46 create_reader(const string& path, environment& env);
47 
48 fe_iface_sptr
49 create_reader(std::istream* in, environment& env);
50 
51 corpus_sptr
52 read_corpus_from_abixml(std::istream* in,
53 			environment&  env);
54 
55 corpus_sptr
56 read_corpus_from_abixml_file(const string& path,
57 			     environment&  env);
58 
59 corpus_group_sptr
60 read_corpus_group_from_input(fe_iface& ctxt);
61 
62 corpus_group_sptr
63 read_corpus_group_from_abixml(std::istream* in,
64 			      environment&  env);
65 
66 corpus_group_sptr
67 read_corpus_group_from_abixml_file(const string& path,
68 				   environment&  env);
69 
70 void
71 consider_types_not_reachable_from_public_interfaces(fe_iface& ctxt,
72 						    bool flag);
73 
74 #ifdef WITH_SHOW_TYPE_USE_IN_ABILINT
75 vector<type_base_sptr>*
76 get_types_from_type_id(fe_iface&, const string&);
77 
78 unordered_map<type_or_decl_base*, vector<type_or_decl_base*>>*
79 get_artifact_used_by_relation_map(fe_iface&);
80 #endif
81 }//end abixml
82 
83 #ifdef WITH_DEBUG_SELF_COMPARISON
84 bool
85 load_canonical_type_ids(fe_iface& ctxt,
86 			const string& file_path);
87 #endif
88 }//end namespace abigail
89 
90 #endif // __ABG_READER_H__
91