CBMC
remove_instanceoft Class Reference
+ Collaboration diagram for remove_instanceoft:

Public Member Functions

 remove_instanceoft (symbol_table_baset &symbol_table, const class_hierarchyt &class_hierarchy, message_handlert &message_handler)
 
bool lower_instanceof (const irep_idt &function_identifier, goto_programt &)
 Replace every instanceof in the passed function body with an explicit class-identifier test. More...
 
bool lower_instanceof (const irep_idt &function_identifier, goto_programt &, goto_programt::targett)
 Replaces expressions like e instanceof A with e. More...
 

Protected Member Functions

bool lower_instanceof (const irep_idt &function_identifier, exprt &, goto_programt &, goto_programt::targett)
 Replaces an expression like e instanceof A with e. More...
 

Protected Attributes

symbol_table_basetsymbol_table
 
const class_hierarchytclass_hierarchy
 
namespacet ns
 
message_handlertmessage_handler
 

Detailed Description

Definition at line 22 of file remove_instanceof.cpp.

Constructor & Destructor Documentation

◆ remove_instanceoft()

remove_instanceoft::remove_instanceoft ( symbol_table_baset symbol_table,
const class_hierarchyt class_hierarchy,
message_handlert message_handler 
)
inline

Definition at line 25 of file remove_instanceof.cpp.

Member Function Documentation

◆ lower_instanceof() [1/3]

bool remove_instanceoft::lower_instanceof ( const irep_idt function_identifier,
exprt expr,
goto_programt goto_program,
goto_programt::targett  this_inst 
)
protected

Replaces an expression like e instanceof A with e.

@class_identifier == "A" or a big-or of similar expressions if we know of subtypes that also satisfy the given test.

Parameters
function_identifiername of the goto function goto_program
exprExpression to lower (the code or the guard of an instruction)
goto_programprogram the expression belongs to
this_instinstruction the expression is found at
Returns
true if any instanceof instructionw was replaced

Definition at line 101 of file remove_instanceof.cpp.

◆ lower_instanceof() [2/3]

bool remove_instanceoft::lower_instanceof ( const irep_idt function_identifier,
goto_programt goto_program 
)

Replace every instanceof in the passed function body with an explicit class-identifier test.

Extra auxiliary variables may be introduced into symbol_table.

Parameters
function_identifiername of the goto function goto_program
goto_programThe function body to work on.
Returns
true if one or more instanceof expressions have been replaced

Definition at line 278 of file remove_instanceof.cpp.

◆ lower_instanceof() [3/3]

bool remove_instanceoft::lower_instanceof ( const irep_idt function_identifier,
goto_programt goto_program,
goto_programt::targett  target 
)

Replaces expressions like e instanceof A with e.

@class_identifier == "A" or a big-or of similar expressions if we know of subtypes that also satisfy the given test. Does this for the code or guard at a specific instruction.

Parameters
function_identifiername of the goto function goto_program
goto_programprogram to process
targetinstruction to check for instanceof expressions
Returns
true if an instanceof has been replaced

Definition at line 239 of file remove_instanceof.cpp.

Member Data Documentation

◆ class_hierarchy

const class_hierarchyt& remove_instanceoft::class_hierarchy
protected

Definition at line 47 of file remove_instanceof.cpp.

◆ message_handler

message_handlert& remove_instanceoft::message_handler
protected

Definition at line 49 of file remove_instanceof.cpp.

◆ ns

namespacet remove_instanceoft::ns
protected

Definition at line 48 of file remove_instanceof.cpp.

◆ symbol_table

symbol_table_baset& remove_instanceoft::symbol_table
protected

Definition at line 46 of file remove_instanceof.cpp.


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