Skip to content

Commit f5da5c7

Browse files
author
thk123
committed
Linting fixes
1 parent 85bec38 commit f5da5c7

12 files changed

+54
-56
lines changed

src/analyses/variable-sensitivity/abstract_enviroment.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Function: abstract_environmentt::eval
4343
abstract_object_pointert abstract_environmentt::eval(
4444
const exprt &expr, const namespacet &ns) const
4545
{
46-
if (bottom)
46+
if(bottom)
4747
return abstract_object_factory(expr.type(), ns, false, true);
4848

4949
typedef std::function<abstract_object_pointert(const exprt &)> eval_handlert;
@@ -198,9 +198,9 @@ bool abstract_environmentt::assign(
198198
// we will work through the relevant abstract objects
199199
exprt s = expr;
200200
std::stack<exprt> stactions; // I'm not a continuation, honest guv'
201-
while (s.id() != ID_symbol)
201+
while(s.id() != ID_symbol)
202202
{
203-
if (s.id() == ID_index || s.id() == ID_member || s.id() == ID_dereference)
203+
if(s.id() == ID_index || s.id() == ID_member || s.id() == ID_dereference)
204204
{
205205
stactions.push(s);
206206
s = s.op0();
@@ -248,7 +248,7 @@ bool abstract_environmentt::assign(
248248

249249
// Write the value for the root symbol back into the map
250250
assert(lhs_type==rhs_type);
251-
if (final_value->is_top())
251+
if(final_value->is_top())
252252
{
253253
map.erase(symbol_expr);
254254
}
@@ -404,11 +404,12 @@ bool abstract_environmentt::assume(const exprt &expr, const namespacet &ns)
404404

405405
exprt possibly_constant = res->to_constant();
406406

407-
if (possibly_constant.id()!=ID_nil) // I.E. actually a value
407+
if(possibly_constant.id()!=ID_nil) // I.E. actually a value
408408
{
409-
assert(possibly_constant.type().id()==ID_bool); // Should be of the right type
409+
// Should be of the right type
410+
assert(possibly_constant.type().id()==ID_bool);
410411

411-
if (possibly_constant.is_false())
412+
if(possibly_constant.is_false())
412413
{
413414
bool currently_bottom = is_bottom();
414415
make_bottom();
@@ -433,7 +434,7 @@ bool abstract_environmentt::assume(const exprt &expr, const namespacet &ns)
433434
* 5. compute the meet (not merge!) of the two abstract_objectt's
434435
* 6. assign the new value back to the environment.
435436
*/
436-
437+
437438
return false;
438439
}
439440

@@ -544,7 +545,7 @@ bool abstract_environmentt::merge(const abstract_environmentt &env)
544545
else
545546
{
546547
bool modified=false;
547-
for(const auto &entry:env.map)
548+
for(const auto &entry : env.map)
548549
{
549550
if(map.find(entry.first)!=map.end())
550551
{

src/analyses/variable-sensitivity/abstract_enviroment.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ class abstract_environmentt
6464

6565
// For the less havocy pointer we might need this, which can be applied
6666
// eagerly or lazily
67-
//virtual void havoc (std::string s, typet t);
67+
// virtual void havoc (std::string s, typet t);
6868

6969
bool verify() const;
7070

7171
protected:
7272
bool bottom;
7373

74-
// We may need to break out more of these cases into these
75-
virtual abstract_object_pointert eval_expression(
74+
// We may need to break out more of these cases into these
75+
virtual abstract_object_pointert eval_expression(
7676
const exprt &e, const namespacet &ns) const;
7777

7878
typedef symbol_exprt map_keyt;

src/analyses/variable-sensitivity/abstract_object.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ abstract_objectt::abstract_objectt(
9797
{}
9898

9999
abstract_objectt::~abstract_objectt()
100-
{
101-
102-
}
100+
{}
103101

104102
const typet &abstract_objectt::type() const
105103
{
@@ -125,7 +123,7 @@ Function: abstract_objectt::merge_state
125123
bool abstract_objectt::merge_state(
126124
const abstract_object_pointert op1, const abstract_object_pointert op2)
127125
{
128-
top=op1->top||op2->top;
126+
top=op1->top || op2->top;
129127
bottom=op1->bottom && op2->bottom;
130128

131129
assert(!(top && bottom));

src/analyses/variable-sensitivity/abstract_object.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@ class namespacet;
6161
\
6262
typedef sharing_ptrt<current_typet> current_type_ptrt; \
6363
typedef internal_sharing_ptrt<current_typet> this_ptrt; \
64-
/*Cast the supplied type to the current type to facilitate double dispatch*/ \
64+
/* Cast the supplied type to the current type to */ \
65+
/* facilitate double dispatch*/ \
6566
current_type_ptrt n=std::dynamic_pointer_cast<current_typet const>(op); \
6667
this_ptrt m=this_ptrt(new current_typet(*this)); \
67-
if (n!= NULL) \
68+
if(n!= NULL) \
6869
{ \
69-
out_any_modifications=m->merge_state(current_type_ptrt(new current_typet(*this)), n); \
70+
out_any_modifications= \
71+
m->merge_state(current_type_ptrt(new current_typet(*this)), n); \
7072
return m; \
7173
} \
7274
else \
@@ -95,14 +97,14 @@ class namespacet;
9597
*/
9698

9799
template<class T>
98-
using sharing_ptrt=std::shared_ptr<const T>;
100+
using sharing_ptrt=std::shared_ptr<const T>; // NOLINT(*)
99101

100102
typedef sharing_ptrt<class abstract_objectt> abstract_object_pointert;
101103

102104
class abstract_objectt
103105
{
104106
public:
105-
abstract_objectt(const typet &type);
107+
explicit abstract_objectt(const typet &type);
106108
abstract_objectt(const typet &type, bool top, bool bottom);
107109
abstract_objectt(const abstract_objectt &old);
108110
abstract_objectt(
@@ -133,7 +135,8 @@ class abstract_objectt
133135
virtual void output(
134136
std::ostream &out, const class ai_baset &ai, const namespacet &ns) const;
135137

136-
virtual abstract_objectt* clone() const // Macro is not used as this does not override
138+
// Macro is not used as this does not override
139+
virtual abstract_objectt* clone() const
137140
{
138141
typedef std::remove_const<std::remove_reference<decltype(*this)>::type
139142
>::type current_typet;

src/analyses/variable-sensitivity/array_abstract_object.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ sharing_ptrt<array_abstract_objectt> array_abstract_objectt::write_index(
162162
{
163163
return sharing_ptrt<array_abstract_objectt>(
164164
dynamic_cast<array_abstract_objectt*>(clone()));
165-
166165
}
167166
else
168167
{

src/analyses/variable-sensitivity/constant_abstract_value.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ bool constant_abstract_valuet::merge_state(
6262
constant_abstract_value_pointert op2)
6363
{
6464
bool parent_merge_change=abstract_objectt::merge_state(op1, op2);
65-
if (!is_top() && !is_bottom())
65+
if(!is_top() && !is_bottom())
6666
{
67-
if (op1->value==op2->value)
67+
if(op1->value==op2->value)
6868
{
6969
value=op1->value;
7070
return false;

src/analyses/variable-sensitivity/constant_abstract_value.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <analyses/variable-sensitivity/abstract_value.h>
1414
#include <util/std_expr.h>
1515

16-
class constant_abstract_valuet : public abstract_valuet
16+
class constant_abstract_valuet:public abstract_valuet
1717
{
1818
private:
1919
typedef sharing_ptrt<constant_abstract_valuet>
@@ -31,7 +31,7 @@ class constant_abstract_valuet : public abstract_valuet
3131
CLONE
3232
MERGE(abstract_valuet)
3333

34-
virtual exprt to_constant (void) const override;
34+
virtual exprt to_constant() const override;
3535

3636
virtual void output(
3737
std::ostream &out,

src/analyses/variable-sensitivity/constant_pointer_abstract_object.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class constant_pointer_abstract_objectt:public pointer_abstract_objectt
1818
typedef sharing_ptrt<constant_pointer_abstract_objectt>
1919
constant_pointer_abstract_pointert;
2020
public:
21-
constant_pointer_abstract_objectt(const typet &type);
21+
explicit constant_pointer_abstract_objectt(const typet &type);
2222

2323
constant_pointer_abstract_objectt(
2424
const typet &type,
@@ -57,9 +57,6 @@ class constant_pointer_abstract_objectt:public pointer_abstract_objectt
5757

5858
private:
5959
exprt value;
60-
61-
62-
6360
};
6461

6562
#endif // CPROVER_ANALYSES_VARIABLE_SENSITIVITY_CONSTANT_POINTER_ABSTRACT_OBJECT_H // NOLINT(*)

src/analyses/variable-sensitivity/full_struct_abstract_object.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,14 @@ Function: struct_abstract_objectt::write_component
182182
183183
\*******************************************************************/
184184

185-
sharing_ptrt<struct_abstract_objectt> full_struct_abstract_objectt::write_component(
186-
abstract_environmentt &environment,
187-
const namespacet &ns,
188-
const std::stack<exprt> &stack,
189-
const member_exprt &member_expr,
190-
const abstract_object_pointert value,
191-
bool merging_write) const
185+
sharing_ptrt<struct_abstract_objectt>
186+
full_struct_abstract_objectt::write_component(
187+
abstract_environmentt &environment,
188+
const namespacet &ns,
189+
const std::stack<exprt> &stack,
190+
const member_exprt &member_expr,
191+
const abstract_object_pointert value,
192+
bool merging_write) const
192193
{
193194
#ifdef DEBUG
194195
std::cout << "Writing component " << member_expr.get_component_name()

src/analyses/variable-sensitivity/full_struct_abstract_object.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Author: Thomas Kiley, [email protected]
66
77
\*******************************************************************/
88

9-
#ifndef CPROVER_ANALYSES_VARIABLE_SENSITIVITY_ONE_LEVEL_STRUCT_ABSTRACT_OBJECT_H
10-
#define CPROVER_ANALYSES_VARIABLE_SENSITIVITY_ONE_LEVEL_STRUCT_ABSTRACT_OBJECT_H
9+
#ifndef CPROVER_ANALYSES_VARIABLE_SENSITIVITY_FULL_STRUCT_ABSTRACT_OBJECT_H
10+
#define CPROVER_ANALYSES_VARIABLE_SENSITIVITY_FULL_STRUCT_ABSTRACT_OBJECT_H
1111

1212
#include <stack>
1313
#include <iosfwd>
@@ -24,8 +24,9 @@ class full_struct_abstract_objectt:public struct_abstract_objectt
2424

2525
full_struct_abstract_objectt(const typet &type, bool top, bool bottom);
2626

27-
explicit full_struct_abstract_objectt(const full_struct_abstract_objectt &old);
2827
explicit full_struct_abstract_objectt(
28+
const full_struct_abstract_objectt &old);
29+
full_struct_abstract_objectt(
2930
const exprt &expr,
3031
const abstract_environmentt &environment,
3132
const namespacet &ns);
@@ -64,7 +65,6 @@ class full_struct_abstract_objectt:public struct_abstract_objectt
6465
bool merge_state(
6566
const sharing_ptrt<full_struct_abstract_objectt> op1,
6667
const sharing_ptrt<full_struct_abstract_objectt> op2);
67-
6868
};
6969

70-
#endif // CPROVER_ANALYSES_VARIABLE_SENSITIVITY_ONE_LEVEL_STRUCT_ABSTRACT_OBJECT_H
70+
#endif // CPROVER_ANALYSES_VARIABLE_SENSITIVITY_FULL_STRUCT_ABSTRACT_OBJECT_H

0 commit comments

Comments
 (0)