CBMC
linkingt Class Reference

#include <linking_class.h>

+ Collaboration diagram for linkingt:

Classes

struct  adjust_type_infot
 

Public Member Functions

 linkingt (symbol_table_baset &_main_symbol_table, message_handlert &_message_handler)
 
bool link (const symbol_table_baset &src_symbol_table)
 Merges the symbol table src_symbol_table into main_symbol_table, renaming symbols from src_symbol_table when necessary. More...
 

Public Attributes

rename_symbolt rename_main_symbol
 
rename_symbolt rename_new_symbol
 
casting_replace_symbolt object_type_updates
 

Protected Types

enum  renamingt { NO_RENAMING , RENAME_OLD , RENAME_NEW }
 

Protected Member Functions

renamingt needs_renaming_type (const symbolt &old_symbol, const symbolt &new_symbol)
 
renamingt needs_renaming_non_type (const symbolt &old_symbol, const symbolt &new_symbol)
 
renamingt needs_renaming (const symbolt &old_symbol, const symbolt &new_symbol)
 
std::unordered_map< irep_idt, irep_idtrename_symbols (const symbol_table_baset &, const std::unordered_set< irep_idt > &needs_to_be_renamed)
 
void copy_symbols (const symbol_table_baset &, const std::unordered_map< irep_idt, irep_idt > &)
 
void duplicate_non_type_symbol (symbolt &old_symbol, symbolt &new_symbol)
 
void duplicate_code_symbol (symbolt &old_symbol, symbolt &new_symbol)
 
void duplicate_object_symbol (symbolt &old_symbol, symbolt &new_symbol)
 
bool adjust_object_type (const symbolt &old_symbol, const symbolt &new_symbol, bool &set_to_new)
 
bool adjust_object_type_rec (const typet &type1, const typet &type2, adjust_type_infot &info)
 
void duplicate_type_symbol (symbolt &old_symbol, const symbolt &new_symbol)
 
std::string expr_to_string (const irep_idt &identifier, const exprt &expr) const
 
std::string type_to_string (const irep_idt &identifier, const typet &type) const
 
std::string type_to_string_verbose (const symbolt &symbol, const typet &type) const
 
std::string type_to_string_verbose (const symbolt &symbol) const
 
bool detailed_conflict_report_rec (const symbolt &old_symbol, const symbolt &new_symbol, const typet &type1, const typet &type2, unsigned depth, exprt &conflict_path)
 Returns true iff the conflict report on a particular branch of the tree of types was a definitive result, and not contingent on conflicts within a tag type. More...
 
void detailed_conflict_report (const symbolt &old_symbol, const symbolt &new_symbol, const typet &type1, const typet &type2)
 
void link_error (const symbolt &old_symbol, const symbolt &new_symbol, const std::string &msg)
 
void link_warning (const symbolt &old_symbol, const symbolt &new_symbol, const std::string &msg)
 
void show_struct_diff (const struct_typet &old_type, const struct_typet &new_type)
 
irep_idt rename (const symbol_table_baset &, const irep_idt &)
 

Protected Attributes

symbol_table_basetmain_symbol_table
 
namespacet ns
 
message_handlertmessage_handler
 
std::unordered_set< irep_idtrenamed_ids
 

Detailed Description

Definition at line 34 of file linking_class.h.

Member Enumeration Documentation

◆ renamingt

enum linkingt::renamingt
protected
Enumerator
NO_RENAMING 
RENAME_OLD 
RENAME_NEW 

Definition at line 55 of file linking_class.h.

Constructor & Destructor Documentation

◆ linkingt()

linkingt::linkingt ( symbol_table_baset _main_symbol_table,
message_handlert _message_handler 
)
inline

Definition at line 37 of file linking_class.h.

Member Function Documentation

◆ adjust_object_type()

bool linkingt::adjust_object_type ( const symbolt old_symbol,
const symbolt new_symbol,
bool &  set_to_new 
)
protected

Definition at line 1074 of file linking.cpp.

◆ adjust_object_type_rec()

bool linkingt::adjust_object_type_rec ( const typet type1,
const typet type2,
adjust_type_infot info 
)
protected

Definition at line 882 of file linking.cpp.

◆ copy_symbols()

void linkingt::copy_symbols ( const symbol_table_baset src_symbol_table,
const std::unordered_map< irep_idt, irep_idt > &  new_identifiers 
)
protected

Definition at line 1473 of file linking.cpp.

◆ detailed_conflict_report()

void linkingt::detailed_conflict_report ( const symbolt old_symbol,
const symbolt new_symbol,
const typet type1,
const typet type2 
)
inlineprotected

Definition at line 156 of file linking_class.h.

◆ detailed_conflict_report_rec()

bool linkingt::detailed_conflict_report_rec ( const symbolt old_symbol,
const symbolt new_symbol,
const typet type1,
const typet type2,
unsigned  depth,
exprt conflict_path 
)
protected

Returns true iff the conflict report on a particular branch of the tree of types was a definitive result, and not contingent on conflicts within a tag type.

Definition at line 200 of file linking.cpp.

◆ duplicate_code_symbol()

void linkingt::duplicate_code_symbol ( symbolt old_symbol,
symbolt new_symbol 
)
protected

Definition at line 561 of file linking.cpp.

◆ duplicate_non_type_symbol()

void linkingt::duplicate_non_type_symbol ( symbolt old_symbol,
symbolt new_symbol 
)
protected

Definition at line 1181 of file linking.cpp.

◆ duplicate_object_symbol()

void linkingt::duplicate_object_symbol ( symbolt old_symbol,
symbolt new_symbol 
)
protected

Definition at line 1089 of file linking.cpp.

◆ duplicate_type_symbol()

void linkingt::duplicate_type_symbol ( symbolt old_symbol,
const symbolt new_symbol 
)
protected

Definition at line 1225 of file linking.cpp.

◆ expr_to_string()

std::string linkingt::expr_to_string ( const irep_idt identifier,
const exprt expr 
) const
protected

Definition at line 120 of file linking.cpp.

◆ link()

bool linkingt::link ( const symbol_table_baset src_symbol_table)

Merges the symbol table src_symbol_table into main_symbol_table, renaming symbols from src_symbol_table when necessary.

Returns
True, iff linking failed with unresolvable conflicts.

Definition at line 1539 of file linking.cpp.

◆ link_error()

void linkingt::link_error ( const symbolt old_symbol,
const symbolt new_symbol,
const std::string &  msg 
)
protected

Definition at line 487 of file linking.cpp.

◆ link_warning()

void linkingt::link_warning ( const symbolt old_symbol,
const symbolt new_symbol,
const std::string &  msg 
)
protected

Definition at line 504 of file linking.cpp.

◆ needs_renaming()

renamingt linkingt::needs_renaming ( const symbolt old_symbol,
const symbolt new_symbol 
)
inlineprotected

Definition at line 68 of file linking_class.h.

◆ needs_renaming_non_type()

linkingt::renamingt linkingt::needs_renaming_non_type ( const symbolt old_symbol,
const symbolt new_symbol 
)
protected

Definition at line 546 of file linking.cpp.

◆ needs_renaming_type()

linkingt::renamingt linkingt::needs_renaming_type ( const symbolt old_symbol,
const symbolt new_symbol 
)
protected

Definition at line 1320 of file linking.cpp.

◆ rename()

irep_idt linkingt::rename ( const symbol_table_baset src_symbol_table,
const irep_idt id 
)
protected

Definition at line 522 of file linking.cpp.

◆ rename_symbols()

std::unordered_map< irep_idt, irep_idt > linkingt::rename_symbols ( const symbol_table_baset src_symbol_table,
const std::unordered_set< irep_idt > &  needs_to_be_renamed 
)
protected

Definition at line 1438 of file linking.cpp.

◆ show_struct_diff()

void linkingt::show_struct_diff ( const struct_typet old_type,
const struct_typet new_type 
)
protected

◆ type_to_string()

std::string linkingt::type_to_string ( const irep_idt identifier,
const typet type 
) const
protected

Definition at line 127 of file linking.cpp.

◆ type_to_string_verbose() [1/2]

std::string linkingt::type_to_string_verbose ( const symbolt symbol) const
inlineprotected

Definition at line 139 of file linking_class.h.

◆ type_to_string_verbose() [2/2]

std::string linkingt::type_to_string_verbose ( const symbolt symbol,
const typet type 
) const
protected

Definition at line 148 of file linking.cpp.

Member Data Documentation

◆ main_symbol_table

symbol_table_baset& linkingt::main_symbol_table
protected

Definition at line 186 of file linking_class.h.

◆ message_handler

message_handlert& linkingt::message_handler
protected

Definition at line 188 of file linking_class.h.

◆ ns

namespacet linkingt::ns
protected

Definition at line 187 of file linking_class.h.

◆ object_type_updates

casting_replace_symbolt linkingt::object_type_updates

Definition at line 52 of file linking_class.h.

◆ rename_main_symbol

rename_symbolt linkingt::rename_main_symbol

Definition at line 51 of file linking_class.h.

◆ rename_new_symbol

rename_symbolt linkingt::rename_new_symbol

Definition at line 51 of file linking_class.h.

◆ renamed_ids

std::unordered_set<irep_idt> linkingt::renamed_ids
protected

Definition at line 193 of file linking_class.h.


The documentation for this class was generated from the following files: