libabigail
|
The namespace for the native XML file format writer. More...
Typedefs | |
typedef unordered_map< class_tdecl_sptr, string, class_tdecl_hash > | class_tmpl_shared_ptr_map |
typedef unordered_map< function_tdecl_sptr, string, function_tdecl_hash > | fn_tmpl_shared_ptr_map |
typedef std::unordered_set< function_type * > | fn_type_ptr_set_type |
A convenience typedef for a set of function type*. More... | |
typedef std::unordered_map< const type_base *, interned_string, non_canonicalized_type_hash, non_canonicalized_type_equal > | nc_type_ptr_istr_map_type |
A map meant to carry non canonicalized types as key. More... | |
typedef std::unordered_set< const type_base *, non_canonicalized_type_hash, non_canonicalized_type_equal > | nc_type_ptr_set_type |
A set meant to carry non canonicalized types. More... | |
typedef unordered_map< type_base *, interned_string > | type_ptr_map |
A convenience typedef for a map that associates a pointer to type to a string. More... | |
typedef std::unordered_set< const type_base * > | type_ptr_set_type |
typedef shared_ptr< write_context > | write_context_sptr |
A convenience typedef for a shared pointer to write_context. More... | |
Enumerations | |
enum | type_id_style_kind { SEQUENCE_TYPE_ID_STYLE , HASH_TYPE_ID_STYLE } |
The style of type id the XML writer will output. More... | |
Functions | |
template<> | |
bool | annotate (const elf_symbol_sptr &sym, write_context &ctxt, unsigned indent) |
Annotate an elf symbol in form of an ABIXML comment, effectively writing out its demangled form. More... | |
template<> | |
bool | annotate (const function_decl::parameter_sptr &parm, write_context &ctxt, unsigned indent) |
Annotate a function parameter in form of an ABIXML comment. More... | |
bool | annotate (const function_type_sptr &function_type, write_context &ctxt, unsigned indent) |
Annotate a function type in form of an ABIXML comment. More... | |
template<> | |
bool | annotate (const typedef_decl_sptr &typedef_decl, write_context &ctxt, unsigned indent) |
Annotate a typedef declaration in form of an ABIXML comment. More... | |
write_context_sptr | create_write_context (const environment &env, ostream &default_output_stream) |
Create a write_context object that can be used to emit abixml files. More... | |
void | set_annotate (write_context &ctxt, bool flag) |
Set the 'annotate' flag. More... | |
template<typename OPTS > | |
void | set_common_options (write_context &ctxt, const OPTS &opts) |
A convenience generic function to set common options (usually used by Libabigail tools) from a generic options carrying-object, into a given write_context. More... | |
void | set_ostream (write_context &ctxt, ostream &os) |
Set the new ostream. More... | |
void | set_short_locs (write_context &ctxt, bool flag) |
Set the 'short-locs' flag. More... | |
void | set_show_locs (write_context &ctxt, bool flag) |
Set the "show-locs" flag. More... | |
void | set_type_id_style (write_context &ctxt, type_id_style_kind style) |
Set the 'type-id-style' property. More... | |
void | set_write_architecture (write_context &ctxt, bool flag) |
Set the 'write-architecture' flag. More... | |
void | set_write_comp_dir (write_context &ctxt, bool flag) |
Set the 'write-comp-dir' flag. More... | |
void | set_write_corpus_path (write_context &ctxt, bool flag) |
Set the 'write-corpus-path' flag. More... | |
void | set_write_default_sizes (write_context &ctxt, bool flag) |
Set the 'default-sizes' flag. More... | |
void | set_write_elf_needed (write_context &ctxt, bool flag) |
Set the 'elf-needed' flag. More... | |
void | set_write_parameter_names (write_context &ctxt, bool flag) |
Set the 'parameter-names' flag. More... | |
void | set_write_undefined_symbols (write_context &ctxt, bool flag) |
Set the 'undefined-symbols' flag. More... | |
bool | write_corpus (write_context &ctxt, const corpus_sptr &corpus, unsigned indent, bool member_of_group) |
Serialize an ABI corpus to a single native xml document. The root note of the resulting XML document is 'abi-corpus'. More... | |
bool | write_corpus_group (write_context &ctxt, const corpus_group_sptr &group, unsigned indent) |
Serialize an ABI corpus group to a single native xml document. The root note of the resulting XML document is 'abi-corpus-group'. More... | |
bool | write_corpus_to_archive (const corpus &corp, const bool annotate=false) |
bool | write_corpus_to_archive (const corpus &corp, const string &path, const bool annotate=false) |
bool | write_corpus_to_archive (const corpus_sptr corp, const bool annotate=false) |
bool | write_translation_unit (write_context &ctxt, const translation_unit &tu, const unsigned indent, bool is_last) |
Serialize a translation unit to an output stream. More... | |
The namespace for the native XML file format writer.
It contains utilities to serialize ABI artifacts from the ir namespace into the native XML format.
typedef unordered_map<class_tdecl_sptr, string, class_tdecl_hash> class_tmpl_shared_ptr_map |
Definition at line 218 of file abg-writer.cc.
typedef unordered_map<function_tdecl_sptr, string, function_tdecl_hash> fn_tmpl_shared_ptr_map |
Definition at line 208 of file abg-writer.cc.
typedef std::unordered_set<function_type*> fn_type_ptr_set_type |
A convenience typedef for a set of function type*.
Definition at line 198 of file abg-writer.cc.
typedef std::unordered_map<const type_base*, interned_string, non_canonicalized_type_hash, non_canonicalized_type_equal> nc_type_ptr_istr_map_type |
A map meant to carry non canonicalized types as key.
Those types make the function is_non_canonicalized_type return true.
Definition at line 195 of file abg-writer.cc.
typedef std::unordered_set<const type_base*, non_canonicalized_type_hash, non_canonicalized_type_equal> nc_type_ptr_set_type |
A set meant to carry non canonicalized types.
Those types make the function is_non_canonicalized_type return true.
Definition at line 186 of file abg-writer.cc.
typedef unordered_map<type_base*, interned_string> type_ptr_map |
A convenience typedef for a map that associates a pointer to type to a string.
Definition at line 112 of file abg-writer.cc.
typedef std::unordered_set<const type_base*> type_ptr_set_type |
Definition at line 177 of file abg-writer.cc.
typedef shared_ptr<write_context> write_context_sptr |
A convenience typedef for a shared pointer to write_context.
Definition at line 36 of file abg-writer.h.
enum type_id_style_kind |
The style of type id the XML writer will output.
Definition at line 27 of file abg-writer.h.
bool annotate | ( | const elf_symbol_sptr & | sym, |
write_context & | ctxt, | ||
unsigned | indent | ||
) |
Annotate an elf symbol in form of an ABIXML comment, effectively writing out its demangled form.
sym | the symbol, whose name should be demangled. |
ctxt | the context of the parsing. |
indent | the amount of white space to indent to. |
Definition at line 1036 of file abg-writer.cc.
bool annotate | ( | const function_decl::parameter_sptr & | parm, |
write_context & | ctxt, | ||
unsigned | indent | ||
) |
Annotate a function parameter in form of an ABIXML comment.
parm | the function parameter to annotate. |
ctxt | the context of the parsing. |
indent | the amount of white space to indent to. |
Definition at line 1186 of file abg-writer.cc.
bool annotate | ( | const function_type_sptr & | function_type, |
write_context & | ctxt, | ||
unsigned | indent | ||
) |
Annotate a function type in form of an ABIXML comment.
function_type | the function type to annotate. |
ctxt | the context of the parsing. |
indent | the amount of white space to indent to. |
skip_first_parm | if true, do not serialize the first parameter of the function decl. |
Definition at line 1103 of file abg-writer.cc.
bool annotate | ( | const typedef_decl_sptr & | typedef_decl, |
write_context & | ctxt, | ||
unsigned | indent | ||
) |
Annotate a typedef declaration in form of an ABIXML comment.
typedef_decl | the typedef to annotate. |
ctxt | the context of the parsing. |
indent | the amount of white space to indent to. |
Definition at line 1067 of file abg-writer.cc.
write_context_sptr create_write_context | ( | const environment & | env, |
ostream & | default_output_stream | ||
) |
Create a write_context object that can be used to emit abixml files.
env | the environment for the write_context object to use. |
default_output_stream | the default output stream to use. |
Definition at line 2212 of file abg-writer.cc.
void set_annotate | ( | write_context & | ctxt, |
bool | flag | ||
) |
Set the 'annotate' flag.
When this flag is set then the XML writer annotates ABI artifacts with a human readable description.
ctxt | the context to set this flag on to. |
flag | the new value of the 'annotate' flag. |
Definition at line 2241 of file abg-writer.cc.
void set_common_options | ( | write_context & | ctxt, |
const OPTS & | opts | ||
) |
A convenience generic function to set common options (usually used by Libabigail tools) from a generic options carrying-object, into a given write_context.
ctxt | the the write_context to consider. |
opts | the option-carrying object to set the options from. It must contain data members named: annotate, and show_locs, at very least. |
Definition at line 86 of file abg-writer.h.
void set_ostream | ( | write_context & | ctxt, |
ostream & | os | ||
) |
Set the new ostream.
The ostream refers to the object, writers should stream new output to.
ctxt | the context to set this to. |
os | the new ostream |
Definition at line 2252 of file abg-writer.cc.
void set_short_locs | ( | write_context & | ctxt, |
bool | flag | ||
) |
Set the 'short-locs' flag.
When this flag is set then the XML writer will emit only file names rather than full paths.
ctxt | the context to set this flag on to. |
flag | the new value of the 'short-locs' flag. |
Definition at line 2300 of file abg-writer.cc.
void set_show_locs | ( | write_context & | ctxt, |
bool | flag | ||
) |
Set the "show-locs" flag.
When this flag is set then the XML writer emits location (/// information (file name, line and column) for the ABI artifacts that it emits.
ctxt | the write_context to set the option for. |
flag | the new value of the option. |
Definition at line 2229 of file abg-writer.cc.
void set_type_id_style | ( | write_context & | ctxt, |
type_id_style_kind | style | ||
) |
Set the 'type-id-style' property.
This property controls the kind of type ids used in XML output.
ctxt | the context to set this property on. |
style | the new value of the 'type-id-style' property. |
Definition at line 2362 of file abg-writer.cc.
void set_write_architecture | ( | write_context & | ctxt, |
bool | flag | ||
) |
Set the 'write-architecture' flag.
When this flag is set then the XML writer will emit architecture information
ctxt | the context to set this flag on to. |
flag | the new value of the 'write-architecture' flag. |
Definition at line 2264 of file abg-writer.cc.
void set_write_comp_dir | ( | write_context & | ctxt, |
bool | flag | ||
) |
Set the 'write-comp-dir' flag.
When this flag is set then the XML writer will emit compilation dir information
ctxt | the context to set this flag on to. |
flag | the new value of the 'write-comp-dir' flag. |
Definition at line 2288 of file abg-writer.cc.
void set_write_corpus_path | ( | write_context & | ctxt, |
bool | flag | ||
) |
Set the 'write-corpus-path' flag.
When this flag is set then the XML writer will emit corpus-path information
ctxt | the context to set this flag on to. |
flag | the new value of the 'write-corpus-path' flag. |
Definition at line 2276 of file abg-writer.cc.
void set_write_default_sizes | ( | write_context & | ctxt, |
bool | flag | ||
) |
Set the 'default-sizes' flag.
When this flag is set then the XML writer will emit default size-in-bits attributes for pointer type definitions, reference type definitions, function declarations and function types even when they are equal to the default address size of the translation unit.
ctxt | the context to set this flag on to. |
flag | the new value of the 'default-sizes' flag. |
Definition at line 2351 of file abg-writer.cc.
void set_write_elf_needed | ( | write_context & | ctxt, |
bool | flag | ||
) |
Set the 'elf-needed' flag.
When this flag is set then the XML writer will emit corpus get_needed() (DT_NEEDED) information.
ctxt | the context to set this flag on to. |
flag | the new value of the 'elf-needed' flag. |
Definition at line 2324 of file abg-writer.cc.
void set_write_parameter_names | ( | write_context & | ctxt, |
bool | flag | ||
) |
Set the 'parameter-names' flag.
When this flag is set then the XML writer will emit the names of function parameters.
ctxt | the context to set this flag on to. |
flag | the new value of the 'parameter-names' flag. |
Definition at line 2312 of file abg-writer.cc.
void set_write_undefined_symbols | ( | write_context & | ctxt, |
bool | flag | ||
) |
Set the 'undefined-symbols' flag.
When this flag is set then the XML writer will emit corpus information about the undefined function and variable symbols.
ctxt | the context to set this flag on to. |
flag | the new value of the 'undefined-symbols' flag. |
Definition at line 2336 of file abg-writer.cc.
bool write_corpus | ( | write_context & | ctxt, |
const corpus_sptr & | corpus, | ||
unsigned | indent, | ||
bool | member_of_group | ||
) |
Serialize an ABI corpus to a single native xml document. The root note of the resulting XML document is 'abi-corpus'.
Note: If either corpus is null or corpus does not contain serializable content (i.e. corpus.is_empty()), nothing is emitted to the ctxt's output stream.
ctxt | the write context to use. |
corpus | the corpus to serialize. |
indent | the number of white space indentation to use. |
Definition at line 4675 of file abg-writer.cc.
bool write_corpus_group | ( | write_context & | ctxt, |
const corpus_group_sptr & | group, | ||
unsigned | indent | ||
) |
Serialize an ABI corpus group to a single native xml document. The root note of the resulting XML document is 'abi-corpus-group'.
ctxt | the write context to use. |
group | the corpus group to serialize. |
indent | the number of white space indentation to use. |
Definition at line 4823 of file abg-writer.cc.
bool write_translation_unit | ( | write_context & | ctxt, |
const translation_unit & | tu, | ||
const unsigned | indent, | ||
bool | is_last | ||
) |
Serialize a translation unit to an output stream.
ctxt | the context of the serialization. It contains e.g, the output stream to serialize to. |
tu | the translation unit to serialize. |
indent | how many indentation spaces to use during the serialization. |
is_last | If true, it means the TU to emit is the last one of the corpus. If this is the case, all the remaining referenced types that were not emitted are going to be emitted here, irrespective of if they belong to this TU or not. This is quite a hack. Ideally, we should have a pass that walks all the TUs, detect their non-emitted referenced types, before hand. Then, when we start emitting the TUs, we know for each TU which non-emitted referenced type should be emitted. As we don't yet have such a pass, we do our best for now. |
Definition at line 2557 of file abg-writer.cc.