Skip to content

Commit 6bd0bb2

Browse files
author
martin
committed
Fix issues and warnings raised by doxygen
1 parent b57cca0 commit 6bd0bb2

17 files changed

+199
-145
lines changed

src/analyses/variable-sensitivity/abstract_enviroment.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,6 @@ abstract_object_pointert abstract_environmentt::abstract_object_factory(
343343

344344
bool abstract_environmentt::merge(const abstract_environmentt &env)
345345
{
346-
// Use the sharing_map's "iterative over all differences" functionality
347-
// This should give a significant performance boost
348-
// We can strip down to just the things that are in both
349-
350346
// for each entry in the incoming environment we need to either add it
351347
// if it is new, or merge with the existing key if it is not present
352348

src/analyses/variable-sensitivity/abstract_enviroment.h

+8-6
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ class abstract_environmentt
132132
/// \param top: does the type of the object start as top
133133
/// \param bottom: does the type of the object start as bottom in
134134
/// the two-value domain
135+
/// \param ns: the current variable namespace
135136
///
136137
/// \return The abstract object that has been created
137138
virtual abstract_object_pointert abstract_object_factory(
@@ -143,7 +144,8 @@ class abstract_environmentt
143144
/// For converting constants in the program
144145
///
145146
/// \param type: the type of the object whose state should be tracked
146-
/// \param expr: the starting value of the symbol
147+
/// \param e: the starting value of the symbol
148+
/// \param ns: the current variable namespace
147149
///
148150
/// \return The abstract object that has been created
149151
///
@@ -169,8 +171,6 @@ class abstract_environmentt
169171
///
170172
/// \param havoc_string: diagnostic string to track down havoc causing.
171173
///
172-
/// \return None
173-
///
174174
/// Set the domain to top
175175
virtual void havoc(const std::string &havoc_string);
176176

@@ -235,16 +235,18 @@ class abstract_environmentt
235235
/// the two-value domain
236236
/// \param bottom: does the type of the object start as bottom in
237237
/// the two-value domain
238-
/// \param expr: the starting value of the symbol if top and bottom
239-
/// are both false
238+
/// \param e: the starting value of the symbol if top and bottom
239+
/// are both false
240+
/// \param environment: the current environment (normally *this)
241+
/// \param ns: the current variable namespace
240242
///
241243
/// \return The abstract object that has been created
242244
abstract_object_pointert abstract_object_factory(
243245
const typet &type,
244246
bool top,
245247
bool bottom,
246248
const exprt &e,
247-
const abstract_environmentt &eviroment,
249+
const abstract_environmentt &environment,
248250
const namespacet &ns) const;
249251
};
250252

src/analyses/variable-sensitivity/abstract_object.h

+6
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ class abstract_objectt : public std::enable_shared_from_this<abstract_objectt>
149149
///
150150
/// \param expr: the expression to evaluate and find the result of it.
151151
/// This will be the symbol referred to be op0()
152+
/// \param operands: an abstract_object (pointer) that represent
153+
/// the possible values of each operand
154+
/// \param environment: the abstract environment in which the
155+
/// expression is being evaluated
156+
/// \param ns: the current variable namespace
152157
///
153158
/// \return Returns the abstract_object representing the result of
154159
/// this expression to the maximum precision available.
@@ -266,6 +271,7 @@ class abstract_objectt : public std::enable_shared_from_this<abstract_objectt>
266271
/// the sensitivity of the output and is the object compared
267272
/// against to choose whether this merge changed anything
268273
/// \param op2: the second abstract object to merge
274+
/// \param out_modifications: reference to a flag indicating modification
269275
///
270276
/// \return The merged abstract object with the same sensitivity as the
271277
/// first parameter. out_modifications will be true if the resulting

src/analyses/variable-sensitivity/array_abstract_object.h

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class array_abstract_objectt : public abstract_objectt
9898
/// \param env: the environment
9999
/// \param index: the expression used to access the specific value
100100
/// in the array
101+
/// \param ns: the current variable namespace
101102
///
102103
/// \return An abstract object representing the value in the array
103104
virtual abstract_object_pointert read_index(

src/analyses/variable-sensitivity/constant_abstract_value.h

+14
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ class constant_abstract_valuet : public abstract_valuet
3535
{
3636
}
3737

38+
/// Interface for transforms
39+
///
40+
/// \param expr: the expression to evaluate and find the result of it.
41+
/// This will be the symbol referred to be op0()
42+
/// \param operands: an abstract_object (pointer) that represent
43+
/// the possible values of each operand
44+
/// \param environment: the abstract environment in which the
45+
/// expression is being evaluated
46+
/// \param ns: the current variable namespace
47+
///
48+
/// \return Returns the abstract_object representing the result of
49+
/// this expression to the maximum precision available.
50+
///
51+
/// Uses the rewriter to constant fold expressions where possible.
3852
abstract_object_pointert expression_transform(
3953
const exprt &expr,
4054
const std::vector<abstract_object_pointert> &operands,

src/analyses/variable-sensitivity/constant_array_abstract_object.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class constant_array_abstract_objectt : public array_abstract_objectt
9393
/// \param env: the environment
9494
/// \param index: the expression used to access the specific value
9595
/// in the array
96+
/// \param ns: the namespace
9697
///
9798
/// \return An abstract object representing the value in the array
9899
abstract_object_pointert read_index(
@@ -139,10 +140,12 @@ class constant_array_abstract_objectt : public array_abstract_objectt
139140
/// object to TOP
140141
void make_top_internal() override;
141142

142-
/// Short hand method for creating a top element of the array
143+
/// Evaluates the index and tries to convert it to a constant integer
143144
///
144-
/// \param environment: the abstract environment
145+
/// \param index: the index expression showing where to access the array
146+
/// \param env: the abstract environment
145147
/// \param ns: the namespace
148+
/// \param out_index: the index if it can be converted to a constant
146149
///
147150
/// \return An abstract object pointer of type type().subtype() (i.e. the
148151
/// type of the array's values).
@@ -175,7 +178,7 @@ class constant_array_abstract_objectt : public array_abstract_objectt
175178

176179
/// Short hand method for creating a top element of the array
177180
///
178-
/// \param environment: the abstract environment
181+
/// \param env: the abstract environment
179182
/// \param ns: the namespace
180183
///
181184
/// \return An abstract object pointer of type type().subtype() (i.e. the

src/analyses/variable-sensitivity/constant_pointer_abstract_object.cpp

+13-79
Original file line numberDiff line numberDiff line change
@@ -14,46 +14,36 @@
1414
#include <util/std_expr.h>
1515
#include <util/std_types.h>
1616

17-
/// \param type: the type the abstract_object is representing
1817
constant_pointer_abstract_objectt::constant_pointer_abstract_objectt(
19-
const typet &t)
20-
: pointer_abstract_objectt(t)
18+
const typet &type)
19+
: pointer_abstract_objectt(type)
2120
{
22-
PRECONDITION(t.id() == ID_pointer);
21+
PRECONDITION(type.id() == ID_pointer);
2322
}
2423

25-
/// \param type: the type the abstract_object is representing
26-
/// \param top: is the abstract_object starting as top
27-
/// \param bottom: is the abstract_object starting as bottom
28-
///
29-
/// Start the abstract object at either top or bottom or neither
30-
/// Asserts if both top and bottom are true
3124
constant_pointer_abstract_objectt::constant_pointer_abstract_objectt(
32-
const typet &t,
33-
bool tp,
34-
bool bttm)
35-
: pointer_abstract_objectt(t, tp, bttm)
25+
const typet &type,
26+
bool top,
27+
bool bottom)
28+
: pointer_abstract_objectt(type, top, bottom)
3629
{
37-
PRECONDITION(t.id() == ID_pointer);
30+
PRECONDITION(type.id() == ID_pointer);
3831
}
3932

40-
/// \param old: the abstract object to copy from
4133
constant_pointer_abstract_objectt::constant_pointer_abstract_objectt(
4234
const constant_pointer_abstract_objectt &old)
4335
: pointer_abstract_objectt(old), value_stack(old.value_stack)
4436
{
4537
}
4638

47-
/// \param expr: the expression to use as the starting pointer for
48-
/// an abstract object
4939
constant_pointer_abstract_objectt::constant_pointer_abstract_objectt(
50-
const exprt &e,
40+
const exprt &expr,
5141
const abstract_environmentt &environment,
5242
const namespacet &ns)
53-
: pointer_abstract_objectt(e, environment, ns),
54-
value_stack(e, environment, ns)
43+
: pointer_abstract_objectt(expr, environment, ns),
44+
value_stack(expr, environment, ns)
5545
{
56-
PRECONDITION(e.type().id() == ID_pointer);
46+
PRECONDITION(expr.type().id() == ID_pointer);
5747
if(value_stack.is_top_value())
5848
{
5949
make_top();
@@ -63,14 +53,7 @@ constant_pointer_abstract_objectt::constant_pointer_abstract_objectt(
6353
clear_top();
6454
}
6555
}
66-
/// Set this abstract object to be the result of merging this
67-
/// abstract object. This calls the merge_constant_pointers if
68-
/// we are trying to merge a constant pointer we use the constant pointer
69-
/// constant pointer merge
70-
///
71-
/// \param other: the pointer being merged
72-
///
73-
/// \return Returns the result of the merge.
56+
7457
abstract_object_pointert
7558
constant_pointer_abstract_objectt::merge(abstract_object_pointert other) const
7659
{
@@ -87,14 +70,6 @@ constant_pointer_abstract_objectt::merge(abstract_object_pointert other) const
8770
}
8871
}
8972

90-
/// Merges two constant pointers. If they are pointing at the same
91-
/// value, we merge, otherwise we set to top.
92-
///
93-
/// \param other: the pointer being merged
94-
///
95-
/// \return Returns a new abstract object that is the result of the merge
96-
/// unless the merge is the same as this abstract object, in which
97-
/// case it returns this.
9873
abstract_object_pointert
9974
constant_pointer_abstract_objectt::merge_constant_pointers(
10075
const constant_pointer_abstract_pointert other) const
@@ -119,15 +94,6 @@ constant_pointer_abstract_objectt::merge_constant_pointers(
11994
}
12095
}
12196

122-
/// To try and find a constant expression for this abstract object
123-
///
124-
/// \return Returns an expression representing the value if it can.
125-
/// Returns a nil expression if it can be more than one value.
126-
/// Returns null_pointer expression if it must be null
127-
/// Returns an address_of_exprt with the value set to the
128-
/// result of to_constant called on whatever abstract object this
129-
/// pointer is pointing to.
130-
///
13197
exprt constant_pointer_abstract_objectt::to_constant() const
13298
{
13399
if(is_top() || is_bottom())
@@ -142,12 +108,6 @@ exprt constant_pointer_abstract_objectt::to_constant() const
142108
}
143109
}
144110

145-
/// Print the value of the pointer. Either NULL if nullpointer or
146-
/// ptr -> ( output of what the pointer is pointing to).
147-
///
148-
/// \param out: the stream to write to
149-
/// \param ai: ?
150-
/// \param ns: ?
151111
void constant_pointer_abstract_objectt::output(
152112
std::ostream &out,
153113
const ai_baset &ai,
@@ -191,15 +151,6 @@ void constant_pointer_abstract_objectt::output(
191151
}
192152
}
193153

194-
/// A helper function to dereference a value from a pointer. Providing
195-
/// the pointer can only be pointing at one thing, returns an abstract
196-
/// object representing that thing. If null or top will return top.
197-
///
198-
/// \param env: the environment
199-
/// \param ns: the namespace
200-
///
201-
/// \return An abstract object representing the value this pointer is pointing
202-
/// to
203154
abstract_object_pointert constant_pointer_abstract_objectt::read_dereference(
204155
const abstract_environmentt &env,
205156
const namespacet &ns) const
@@ -218,23 +169,6 @@ abstract_object_pointert constant_pointer_abstract_objectt::read_dereference(
218169
}
219170
}
220171

221-
/// A helper function to evaluate writing to a pointers value.
222-
/// If the pointer can only be pointing to one element that it overwrites
223-
/// that element (or merges if merging_write) with the new value.
224-
/// If don't know what we are pointing to, we delegate to the parent.
225-
///
226-
/// \param environment: the environment
227-
/// \param ns: the namespace
228-
/// \param stack: the remaining stack
229-
/// \param new_value: the value to write to the dereferenced pointer
230-
/// \param merging_write: is it a merging write (i.e. we aren't certain
231-
/// we are writing to this particular pointer therefore
232-
/// the value should be merged with whatever is already
233-
/// there or we are certain we are writing to this pointer
234-
/// so therefore the value can be replaced
235-
///
236-
/// \return A modified abstract object representing this pointer after it
237-
/// has been written to.
238172
sharing_ptrt<pointer_abstract_objectt>
239173
constant_pointer_abstract_objectt::write_dereference(
240174
abstract_environmentt &environment,

0 commit comments

Comments
 (0)