General implementation of an abstract_objectt which tracks the last written locations for a given abstract_objectt.
More...
#include <write_location_context.h>
+ Inheritance diagram for write_location_contextt:
+ Collaboration diagram for write_location_contextt:
Determine whether 'this' abstract_object has been modified in comparison to a previous 'before' state.
Construct the union of the location set of the current object, and a the provided location set.
Output a representation of the value of this abstract object.
Get the real type of the variable this abstract object is representing.
Find out if the abstract object is top.
Find out if the abstract object is bottom.
Converts to a constant expression if possible.
Try to resolve an expression with the maximum level of precision available.
Update the location context for an abstract object.
Start the abstract object at either top or bottom or neither Asserts if both top and bottom are true.
Construct an abstract object from the expression.
Verify the internal structure of an abstract_object is correct.
Converts to an invariant expression.
Update the merge location context for an abstract object.
Apply a visitor operation to all sub elements of this abstract_object.
Protected Member Functions
Create a new abstract object that is the result of merging this abstract object with a given abstract_object.
Base implementation of the meet operation: only used if no more precise abstraction can be used, can only result in {TOP, BOTTOM, one of the original objects}.
Helper function for
abstract_objectt::abstract_object_merge to perform any additional actions after the base abstract_object_merge has completed its actions but immediately prior to it returning.
A helper function to evaluate writing to a component of an abstract object.
Sets the last written locations for this context.
to_predicate implementation - derived classes will override
Create a new abstract object that is the result of the merge, unless the object would be unchanged, then would return itself.
To detect the cases where the base merge is sufficient to do a merge We can't do if this->
is_bottom() since we want the specific.
Helper function for base meet.
Helper function to decide if base meet implementation should be used.
Static Protected Member Functions
Internal helper function to format and output a given set of locations.
Additional Inherited Members
Dump all elements in m1 that are different or missing in m2.
Interface method for the meet operation.
Detailed Description
General implementation of an abstract_objectt which tracks the last written locations for a given abstract_objectt.
Instances of this class are constructed with an abstract_object_pointert, to which most operations are delegated, while at the same time this class handles the tracking of the 'last_written_location' information.
Instances of this class are best constructed via the templated version of this, 'context_abstract_objectt<T>' which provides the same constructors as the standard 'abstract_objectt' class.
Definition at line 34 of file write_location_context.h.
Member Typedef Documentation
◆ combine_fn
◆ write_location_context_ptrt
Constructor & Destructor Documentation
◆ write_location_contextt() [1/2]
◆ write_location_contextt() [2/2]
◆ ~write_location_contextt()
virtual write_location_contextt::~write_location_contextt
(
)
inlinevirtual
Member Function Documentation
◆ abstract_object_merge_internal()
Helper function for abstract_objectt::abstract_object_merge to perform any additional actions after the base abstract_object_merge has completed its actions but immediately prior to it returning.
As such, this function gives the ability to perform additional work for a merge.
For the dependency context, this additional work is the tracking of last_written_locations across the merge
- Parameters
-
other the object to merge with this
- Returns
- the result of the merge
Reimplemented from abstract_objectt.
Definition at line 163 of file write_location_context.cpp.
◆ combine()
◆ get_last_written_locations()
◆ get_location_union()
Construct the union of the location set of the current object, and a the provided location set.
- Parameters
-
locations the set of locations to be unioned with this context
- Returns
- the union of this objects location set, and 'locations'
Definition at line 235 of file write_location_context.cpp.
◆ has_been_modified()
Determine whether 'this' abstract_object has been modified in comparison to a previous 'before' state.
- Parameters
-
before the abstract_object_pointert to use as a reference to compare against
- Returns
- true if 'this' is considered to have been modified in comparison to 'before', false otherwise.
Reimplemented from context_abstract_objectt.
Definition at line 253 of file write_location_context.cpp.
◆ meet()
Base implementation of the meet operation: only used if no more precise abstraction can be used, can only result in {TOP, BOTTOM, one of the original objects}.
- Parameters
-
other pointer to the abstract object to meet
- Returns
- the resulting abstract object pointer
Reimplemented from abstract_objectt.
Definition at line 108 of file write_location_context.cpp.
◆ merge()
)
const
overrideprotectedvirtual
Create a new abstract object that is the result of merging this abstract object with a given abstract_object.
- Parameters
-
other the abstract object to merge with
widen_mode Indicates if this is a widening merge
- Returns
- the result of the merge, or 'this' if the merge would not change the current abstract object
Reimplemented from abstract_objectt.
Definition at line 79 of file write_location_context.cpp.
◆ mutable_clone()
inlineoverrideprotectedvirtual
◆ output()
void write_location_contextt::output
(
std::ostream &
out,
)
const
overridevirtual
Output a representation of the value of this abstract object.
- Parameters
-
out the stream to write to
ai the abstract interpreter that contains the abstract domain (that contains the object ... )
ns the current namespace
Reimplemented from context_abstract_objectt.
Definition at line 214 of file write_location_context.cpp.
◆ output_last_written_locations()
void write_location_contextt::output_last_written_locations
(
std::ostream &
out,
)
staticprotected
Internal helper function to format and output a given set of locations.
- Parameters
-
out the stream on which to output the locations
locations the set of locations to output
Definition at line 331 of file write_location_context.cpp.
◆ set_last_written_locations()
Sets the last written locations for this context.
- Parameters
-
locations the locations to set
Definition at line 200 of file write_location_context.cpp.
◆ update_location_context_internal()
◆ write()
)
const
overrideprotectedvirtual
A helper function to evaluate writing to a component of an abstract object.
More precise abstractions may override this to update what they are storing for a specific component.
- Parameters
-
environment the abstract environment
ns the current namespace
stack the remaining stack of expressions on the LHS to evaluate
specifier the expression uses to access a specific component
value the value we are trying to write to the component
merging_write if true, this and all future writes will be merged with the current value
- Returns
- the abstract_objectt representing the result of writing to a specific component.
Reimplemented from context_abstract_objectt.
Definition at line 35 of file write_location_context.cpp.
Member Data Documentation
◆ last_written_locations
locationst write_location_contextt::last_written_locations
private
The documentation for this class was generated from the following files: