Skip to content

Commit dcb81e9

Browse files
author
martin
committed
Reformat so that comments pass linting
1 parent ae07ad2 commit dcb81e9

12 files changed

+74
-75
lines changed

src/analyses/variable-sensitivity/abstract_enviroment.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,16 @@ bool abstract_environmentt::assign(
259259

260260
/// Function: abstract_object_pointert abstract_environmentt::write
261261
///
262-
/// \param lhs: the abstract object for the left hand side of the write (i.e. the one
263-
/// to update).
262+
/// \param lhs: the abstract object for the left hand side of the write
263+
/// (i.e. the one to update).
264264
/// \param rhs: the value we are trying to write to the left hand side
265-
/// \param remaining_stack: what is left of the stack before the rhs can replace or be
266-
/// merged with the rhs
265+
/// \param remaining_stack: what is left of the stack before the rhs can replace
266+
/// or be merged with the rhs
267267
/// \param ns: the namespace
268-
/// \param merge_write: Are we replacing the left hand side with the right hand side
269-
/// (e.g. we know for a fact that we are overwriting this object)
270-
/// or could the write in fact not take place and therefore we
268+
/// \param merge_write: Are we replacing the left hand side with the
269+
/// right hand side (e.g. we know for a fact that
270+
/// we are overwriting this object) or could the
271+
/// write in fact not take place and therefore we
271272
/// should merge to model the case where it did not.
272273
///
273274
/// \return A modified version of the rhs after the write has taken place
@@ -383,7 +384,8 @@ bool abstract_environmentt::assume(const exprt &expr, const namespacet &ns)
383384
///
384385
/// \param type: the type of the object whose state should be tracked
385386
/// \param top: does the type of the object start as top
386-
/// \param bottom: does the type of the object start as bottom in the two-value domain
387+
/// \param bottom: does the type of the object start as bottom in
388+
/// the two-value domain
387389
///
388390
/// \return The abstract object that has been created
389391
///
@@ -421,8 +423,10 @@ abstract_object_pointert abstract_environmentt::abstract_object_factory(
421423
///
422424
/// \param type: the type of the object whose state should be tracked
423425
/// \param top: does the type of the object start as top in the two-value domain
424-
/// \param bottom: does the type of the object start as bottom in the two-value domain
425-
/// \param expr: the starting value of the symbol if top and bottom are both false
426+
/// \param bottom: does the type of the object start as bottom in
427+
/// the two-value domain
428+
/// \param expr: the starting value of the symbol if top and bottom
429+
/// are both false
426430
///
427431
/// \return The abstract object that has been created
428432
///

src/analyses/variable-sensitivity/abstract_object.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,11 @@ abstract_object_pointert abstract_objectt::abstract_object_meet_internal(
178178
/// \param expr: the expression to evaluate and find the result of it. this will
179179
/// be the symbol referred to be op0()
180180
///
181-
/// \return Returns the abstract_object representing the result of this expression
182-
/// to the maximum precision available.
181+
/// \return Returns the abstract_object representing the result of
182+
/// this expression to the maximum precision available.
183183
///
184-
/// To try and resolve different expressions with the maximum level of precision available.
184+
/// To try and resolve different expressions with the maximum level
185+
/// of precision available.
185186
abstract_object_pointert abstract_objectt::expression_transform(
186187
const exprt &expr,
187188
const std::vector<abstract_object_pointert> &operands,

src/analyses/variable-sensitivity/abstract_value.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ abstract_valuet::abstract_valuet(const typet &type, bool top, bool bottom)
3636

3737
/// Function: abstract_valuet::abstract_valuet
3838
///
39-
/// \param expr: the expression to use as the starting pointer for an abstract object
39+
/// \param expr: the expression to use as the starting pointer for
40+
/// an abstract object
4041
/// \param environment: The environment this abstract object is being created in
4142
/// \param ns: the namespace
4243
///

src/analyses/variable-sensitivity/array_abstract_object.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ array_abstract_objectt::array_abstract_objectt(
3939

4040
/// Function: array_abstract_objectt::array_abstract_objectt
4141
///
42-
/// \param expr: the expression to use as the starting pointer for an abstract object
42+
/// \param expr: the expression to use as the starting pointer for
43+
/// an abstract object
4344
/// \param environment: the environment the abstract object is being created in
4445
/// \param ns: the namespace
4546
array_abstract_objectt::array_abstract_objectt(

src/analyses/variable-sensitivity/constant_array_abstract_object.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ constant_array_abstract_objectt::constant_array_abstract_objectt(
4242

4343
/// Function: constant_array_abstract_objectt::constant_array_abstract_objectt
4444
///
45-
/// \param expr: the expression to use as the starting pointer for an abstract object
45+
/// \param expr: the expression to use as the starting pointer for
46+
/// an abstract object
4647
/// \param environment: the environment the abstract object is being created in
4748
/// \param ns: the namespace
4849
constant_array_abstract_objectt::constant_array_abstract_objectt(
@@ -260,8 +261,8 @@ abstract_object_pointert constant_array_abstract_objectt::read_index(
260261
/// \param stack: the remaining stack of expressions on the LHS to evaluate
261262
/// \param index_expr: the expression uses to access a specific index
262263
/// \param value: the value we are trying to assign to that value in the array
263-
/// \param merging_write: Should this and all future writes be merged with the current
264-
/// value
264+
/// \param merging_write: Should this and all future writes be merged with the
265+
/// current value
265266
/// \return The array_abstract_objectt representing the result of writing
266267
/// to a specific index.
267268
///

src/analyses/variable-sensitivity/constant_pointer_abstract_object.cpp

Lines changed: 21 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
#include <util/std_expr.h>
1515
#include <util/std_types.h>
1616

17-
/// Function: constant_pointer_abstract_objectt::constant_pointer_abstract_objectt
18-
///
1917
/// \param type: the type the abstract_object is representing
2018
constant_pointer_abstract_objectt::constant_pointer_abstract_objectt(
2119
const typet &t)
@@ -24,8 +22,6 @@ constant_pointer_abstract_objectt::constant_pointer_abstract_objectt(
2422
PRECONDITION(t.id() == ID_pointer);
2523
}
2624

27-
/// Function: constant_pointer_abstract_objectt::constant_pointer_abstract_objectt
28-
///
2925
/// \param type: the type the abstract_object is representing
3026
/// \param top: is the abstract_object starting as top
3127
/// \param bottom: is the abstract_object starting as bottom
@@ -41,18 +37,15 @@ constant_pointer_abstract_objectt::constant_pointer_abstract_objectt(
4137
PRECONDITION(t.id() == ID_pointer);
4238
}
4339

44-
/// Function: constant_pointer_abstract_objectt::constant_pointer_abstract_objectt
45-
///
4640
/// \param old: the abstract object to copy from
4741
constant_pointer_abstract_objectt::constant_pointer_abstract_objectt(
4842
const constant_pointer_abstract_objectt &old)
4943
: pointer_abstract_objectt(old), value_stack(old.value_stack)
5044
{
5145
}
5246

53-
/// Function: constant_pointer_abstract_objectt::constant_pointer_abstract_objectt
54-
///
55-
/// \param expr: the expression to use as the starting pointer for an abstract object
47+
/// \param expr: the expression to use as the starting pointer for
48+
/// an abstract object
5649
constant_pointer_abstract_objectt::constant_pointer_abstract_objectt(
5750
const exprt &e,
5851
const abstract_environmentt &environment,
@@ -70,17 +63,14 @@ constant_pointer_abstract_objectt::constant_pointer_abstract_objectt(
7063
clear_top();
7164
}
7265
}
73-
74-
/// Function: constant_pointer_abstract_objectt::merge
75-
///
76-
/// \param other: the pointer being merged
77-
///
78-
/// \return Returns the result of the merge.
79-
///
8066
/// Set this abstract object to be the result of merging this
8167
/// abstract object. This calls the merge_constant_pointers if
8268
/// we are trying to merge a constant pointer we use the constant pointer
8369
/// constant pointer merge
70+
///
71+
/// \param other: the pointer being merged
72+
///
73+
/// \return Returns the result of the merge.
8474
abstract_object_pointert
8575
constant_pointer_abstract_objectt::merge(abstract_object_pointert other) const
8676
{
@@ -97,16 +87,14 @@ constant_pointer_abstract_objectt::merge(abstract_object_pointert other) const
9787
}
9888
}
9989

100-
/// Function: constant_pointer_abstract_objectt::merge_constant_pointers
90+
/// Merges two constant pointers. If they are pointing at the same
91+
/// value, we merge, otherwise we set to top.
10192
///
10293
/// \param other: the pointer being merged
10394
///
10495
/// \return Returns a new abstract object that is the result of the merge
10596
/// unless the merge is the same as this abstract object, in which
10697
/// case it returns this.
107-
///
108-
/// Merges two constant pointers. If they are pointing at the same
109-
/// value, we merge, otherwise we set to top.
11098
abstract_object_pointert
11199
constant_pointer_abstract_objectt::merge_constant_pointers(
112100
const constant_pointer_abstract_pointert other) const
@@ -131,7 +119,7 @@ constant_pointer_abstract_objectt::merge_constant_pointers(
131119
}
132120
}
133121

134-
/// Function: constant_pointer_abstract_objectt::to_constant
122+
/// To try and find a constant expression for this abstract object
135123
///
136124
/// \return Returns an expression representing the value if it can.
137125
/// Returns a nil expression if it can be more than one value.
@@ -140,7 +128,6 @@ constant_pointer_abstract_objectt::merge_constant_pointers(
140128
/// result of to_constant called on whatever abstract object this
141129
/// pointer is pointing to.
142130
///
143-
/// To try and find a constant expression for this abstract object
144131
exprt constant_pointer_abstract_objectt::to_constant() const
145132
{
146133
if(is_top() || is_bottom())
@@ -155,14 +142,12 @@ exprt constant_pointer_abstract_objectt::to_constant() const
155142
}
156143
}
157144

158-
/// Function: constant_pointer_abstract_objectt::output
145+
/// Print the value of the pointer. Either NULL if nullpointer or
146+
/// ptr -> ( output of what the pointer is pointing to).
159147
///
160148
/// \param out: the stream to write to
161149
/// \param ai: ?
162150
/// \param ns: ?
163-
///
164-
/// Print the value of the pointer. Either NULL if nullpointer or
165-
/// ptr -> ( output of what the pointer is pointing to).
166151
void constant_pointer_abstract_objectt::output(
167152
std::ostream &out,
168153
const ai_baset &ai,
@@ -206,17 +191,15 @@ void constant_pointer_abstract_objectt::output(
206191
}
207192
}
208193

209-
/// Function: constant_pointer_abstract_objectt::read_dereference
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.
210197
///
211198
/// \param env: the environment
212199
/// \param ns: the namespace
213200
///
214201
/// \return An abstract object representing the value this pointer is pointing
215202
/// to
216-
///
217-
/// A helper function to dereference a value from a pointer. Providing
218-
/// the pointer can only be pointing at one thing, returns an abstract
219-
/// object representing that thing. If null or top will return top.
220203
abstract_object_pointert constant_pointer_abstract_objectt::read_dereference(
221204
const abstract_environmentt &env,
222205
const namespacet &ns) const
@@ -235,25 +218,23 @@ abstract_object_pointert constant_pointer_abstract_objectt::read_dereference(
235218
}
236219
}
237220

238-
/// Function: constant_pointer_abstract_objectt::write_dereference
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.
239225
///
240226
/// \param environment: the environment
241227
/// \param ns: the namespace
242228
/// \param stack: the remaining stack
243229
/// \param new_value: the value to write to the dereferenced pointer
244230
/// \param merging_write: is it a merging write (i.e. we aren't certain
245231
/// we are writing to this particular pointer therefore
246-
/// the value should be merged with whatever is already there
247-
/// or we are certain we are writing to this pointer so
248-
/// therefore the value can be replaced
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
249235
///
250236
/// \return A modified abstract object representing this pointer after it
251237
/// has been written to.
252-
///
253-
/// A helper function to evaluate writing to a pointers value.
254-
/// If the pointer can only be pointing to one element that it overwrites
255-
/// that element (or merges if merging_write) with the new value.
256-
/// If don't know what we are pointing to, we delegate to the parent.
257238
sharing_ptrt<pointer_abstract_objectt>
258239
constant_pointer_abstract_objectt::write_dereference(
259240
abstract_environmentt &environment,

src/analyses/variable-sensitivity/pointer_abstract_object.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ pointer_abstract_objectt::pointer_abstract_objectt(
4040

4141
/// Function: pointer_abstract_objectt::pointer_abstract_objectt
4242
///
43-
/// \param expr: the expression to use as the starting pointer for an abstract object
43+
/// \param expr: the expression to use as the starting pointer for
44+
/// an abstract object
4445
pointer_abstract_objectt::pointer_abstract_objectt(
4546
const exprt &e,
4647
const abstract_environmentt &environment,
@@ -125,9 +126,9 @@ abstract_object_pointert pointer_abstract_objectt::read_dereference(
125126
/// pointing to
126127
/// \param merging_write: is it a merging write (i.e. we aren't certain
127128
/// we are writing to this particular pointer therefore
128-
/// the value should be merged with whatever is already there
129-
/// or we are certain we are writing to this pointer so
130-
/// therefore the value can be replaced
129+
/// the value should be merged with whatever is already
130+
/// there or we are certain we are writing to this pointer
131+
/// so therefore the value can be replaced
131132
///
132133
/// \return A modified abstract object representing this pointer after it
133134
/// has been written to.

src/analyses/variable-sensitivity/struct_abstract_object.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ struct_abstract_objectt::struct_abstract_objectt(
4141

4242
/// Function: struct_abstract_objectt::struct_abstract_objectt
4343
///
44-
/// \param expr: the expression to use as the starting pointer for an abstract object
44+
/// \param expr: the expression to use as the starting pointer for
45+
/// an abstract object
4546
struct_abstract_objectt::struct_abstract_objectt(
4647
const exprt &e,
4748
const abstract_environmentt &environment,

src/analyses/variable-sensitivity/union_abstract_object.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ union_abstract_objectt::union_abstract_objectt(
4040

4141
/// Function: union_abstract_objectt::union_abstract_objectt
4242
///
43-
/// \param expr: the expression to use as the starting pointer for an abstract object
44-
/// \param environment: the environment the abstract object is going to be evaluated in.
43+
/// \param expr: the expression to use as the starting pointer for
44+
/// an abstract object
45+
/// \param environment: the environment the abstract object is going
46+
/// to be evaluated in.
4547
union_abstract_objectt::union_abstract_objectt(
4648
const exprt &expr,
4749
const abstract_environmentt &environment,

src/analyses/variable-sensitivity/variable_sensitivity_domain.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ std::vector<irep_idt> variable_sensitivity_domaint::get_modified_symbols(
324324
/// Function: variable_sensitivity_domaint::transform_function_call
325325
///
326326
/// \param from: the location to transform from which is a function call
327-
/// \param to: the destination of the transform (potentially inside the function call)
327+
/// \param to: the destination of the transform
328+
/// (potentially inside the function call)
328329
/// \param ai: the abstract interpreter
329330
/// \param ns: the namespace of the current state
330331
///

0 commit comments

Comments
 (0)