libabigail
Loading...
Searching...
No Matches
abg-writer.cc File Reference

This file contains the definitions of the entry points to de-serialize an instance of abigail::translation_unit to an ABI Instrumentation file in libabigail native XML format. This native XML format is named "abixml". More...

#include "config.h"
#include <assert.h>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>
#include <memory>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <vector>
#include "abg-tools-utils.h"
#include "abg-ir-priv.h"
#include "abg-internal.h"
#include "abg-config.h"
#include "abg-corpus.h"
#include "abg-hash.h"
#include "abg-sptr-utils.h"
#include "abg-writer.h"
#include "abg-libxml-utils.h"
#include "abg-fwd.h"
Include dependency graph for abg-writer.cc:

Go to the source code of this file.

Namespaces

namespace  abigail
 Toplevel namespace for libabigail.
 
namespace  abigail::xml_writer
 The namespace for the native XML file format writer.
 

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*.
 
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.
 
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.
 
typedef unordered_map< type_base *, interned_stringtype_ptr_map
 A convenience typedef for a map that associates a pointer to type to a string.
 
typedef std::unordered_set< const type_base * > type_ptr_set_type
 

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.
 
template<>
bool annotate (const function_decl::parameter_sptr &parm, write_context &ctxt, unsigned indent)
 Annotate a function parameter in form of an ABIXML comment.
 
bool annotate (const function_type_sptr &function_type, write_context &ctxt, unsigned indent)
 Annotate a function type in form of an ABIXML comment.
 
template<>
bool annotate (const typedef_decl_sptr &typedef_decl, write_context &ctxt, unsigned indent)
 Annotate a typedef declaration in form of an ABIXML comment.
 
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.
 
void dump (const decl_base_sptr d, const bool annotate)
 Serialize a pointer to decl_base to stderr.
 
void dump (const decl_base_sptr d, std::ostream &o, const bool annotate)
 Serialize a pointer to decl_base to an output stream.
 
void dump (const translation_unit &t, const bool annotate)
 Serialize an instance of translation_unit to stderr.
 
void dump (const translation_unit &t, std::ostream &o, const bool annotate)
 Serialize a translation_unit to an output stream.
 
void dump (const translation_unit_sptr t, const bool annotate)
 Serialize a pointer to translation_unit to stderr.
 
void dump (const translation_unit_sptr t, std::ostream &o, const bool annotate)
 Serialize a pointer to translation_unit to an output stream.
 
void dump (const type_base_sptr t, const bool annotate)
 Serialize a pointer to type_base to stderr.
 
void dump (const type_base_sptr t, std::ostream &o, const bool annotate)
 Serialize a pointer to type_base to an output stream.
 
void dump (const var_decl_sptr v, const bool annotate)
 Serialize a pointer to var_decl to stderr.
 
void dump (const var_decl_sptr v, std::ostream &o, const bool annotate)
 Serialize a pointer to var_decl to an output stream.
 
void dump_decl_location (const decl_base &d)
 Serialize the source location of a decl to stderr for debugging purposes.
 
void dump_decl_location (const decl_base &d, ostream &o)
 Serialize the source location of a decl to an output stream for debugging purposes.
 
void dump_decl_location (const decl_base *d)
 Serialize the source location of a dcl to stderr for debugging purposes.
 
void dump_decl_location (const decl_base_sptr d)
 Serialize the source location of a decl to stderr for debugging purposes.
 
void dump_location (const location &l)
 Serialize a source location for debugging purposes.
 
void dump_location (const location &l, ostream &o)
 Serialize a source location to an output stream.
 
void set_annotate (write_context &ctxt, bool flag)
 Set the 'annotate' flag.
 
void set_ostream (write_context &ctxt, ostream &os)
 Set the new ostream.
 
void set_short_locs (write_context &ctxt, bool flag)
 Set the 'short-locs' flag.
 
void set_show_locs (write_context &ctxt, bool flag)
 Set the "show-locs" flag.
 
void set_type_id_style (write_context &ctxt, type_id_style_kind style)
 Set the 'type-id-style' property.
 
void set_write_architecture (write_context &ctxt, bool flag)
 Set the 'write-architecture' flag.
 
void set_write_comp_dir (write_context &ctxt, bool flag)
 Set the 'write-comp-dir' flag.
 
void set_write_corpus_path (write_context &ctxt, bool flag)
 Set the 'write-corpus-path' flag.
 
void set_write_default_sizes (write_context &ctxt, bool flag)
 Set the 'default-sizes' flag.
 
void set_write_elf_needed (write_context &ctxt, bool flag)
 Set the 'elf-needed' flag.
 
void set_write_parameter_names (write_context &ctxt, bool flag)
 Set the 'parameter-names' flag.
 
void set_write_undefined_symbols (write_context &ctxt, bool flag)
 Set the 'undefined-symbols' flag.
 
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'.
 
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'.
 
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.
 

Detailed Description

This file contains the definitions of the entry points to de-serialize an instance of abigail::translation_unit to an ABI Instrumentation file in libabigail native XML format. This native XML format is named "abixml".

Definition in file abg-writer.cc.