Skip to content

Commit f023fad

Browse files
Merge pull request diffblue#445 from diffblue/formatting-const-in-taint-summary-cpp
Formatting const in taint summary cpp
2 parents ca17b87 + 1a244ee commit f023fad

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

src/taint-analysis/taint_summary.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,17 @@ static exprt transform_external_objects(const exprt& e)
171171
/// \param instit: the point in the program to do the query
172172
/// \param [out] result: output
173173
static void collect_lvsa_access_paths(
174-
exprt const &query,
175-
namespacet const &ns,
174+
const exprt &query,
175+
const namespacet &ns,
176176
local_value_set_analysist &lvsa,
177-
instruction_iteratort const &instit,
177+
const instruction_iteratort &instit,
178178
std::set<exprt> &result)
179179
{
180180
TMPROF_BLOCK();
181181

182182
if(query.id() == ID_side_effect)
183183
{
184-
side_effect_exprt const &see = to_side_effect_expr(query);
184+
const side_effect_exprt &see = to_side_effect_expr(query);
185185
if(see.get_statement()==ID_nondet)
186186
{
187187
// TODO(marek-trtik): Add computation of a proper points-to set for NONDET
@@ -204,7 +204,7 @@ static void collect_lvsa_access_paths(
204204
}
205205

206206
assert(target.id()==ID_object_descriptor);
207-
exprt const transformed_object =
207+
const exprt transformed_object =
208208
transform_external_objects(
209209
to_object_descriptor_expr(target).object());
210210

@@ -244,10 +244,10 @@ static void collect_lvsa_access_paths(
244244
/// Call `collect_lvsa_access_paths` and use taint_object_numbering to convert
245245
/// the results from `exprt`s to the format required for `lvalue_numbers_sett`
246246
static void collect_lvsa_access_paths(
247-
exprt const& query_in,
248-
namespacet const& ns,
247+
const exprt &query_in,
248+
const namespacet &ns,
249249
local_value_set_analysist& lvsa,
250-
instruction_iteratort const& instit,
250+
const instruction_iteratort &instit,
251251
object_numberingt& taint_object_numbering,
252252
lvalue_numbers_sett& result,
253253
bool &singular)
@@ -269,11 +269,11 @@ static void collect_lvsa_access_paths(
269269
}
270270

271271
static void collect_lvsa_access_paths(
272-
exprt const& query_in,
272+
const exprt &query_in,
273273
namespacet const& ns,
274274
lvalue_numbers_sett &result,
275275
local_value_set_analysist& lvsa,
276-
instruction_iteratort const& instit,
276+
const instruction_iteratort &instit,
277277
object_numberingt& taint_object_numbering)
278278
{
279279
TMPROF_BLOCK();
@@ -511,12 +511,12 @@ numbered_lvalue_to_taint_mapt taint_algorithm_computing_summary_of_functiont::
511511

512512
void taint_algorithm_computing_summary_of_functiont::assign(
513513
numbered_lvalue_to_taint_mapt &map,
514-
taint_lvalue_numbert const lvalue,
514+
const taint_lvalue_numbert lvalue,
515515
const taint_sett &taint)
516516
{
517517
TMPROF_BLOCK();
518518

519-
auto const it = map.find(lvalue);
519+
const auto it = map.find(lvalue);
520520
if (it == map.end())
521521
{
522522
if(!taint.is_bottom())
@@ -528,12 +528,12 @@ void taint_algorithm_computing_summary_of_functiont::assign(
528528

529529
void taint_algorithm_computing_summary_of_functiont::maybe_assign(
530530
numbered_lvalue_to_taint_mapt &map,
531-
taint_lvalue_numbert const lvalue,
531+
const taint_lvalue_numbert lvalue,
532532
const taint_sett &taint)
533533
{
534534
TMPROF_BLOCK();
535535

536-
auto const it = map.find(lvalue);
536+
const auto it = map.find(lvalue);
537537
if (it == map.end())
538538
{
539539
if(!taint.is_bottom())
@@ -557,7 +557,7 @@ bool taint_algorithm_computing_summary_of_functiont::proper_subset(
557557
bool common_base=a.get_base()==b.get_base();
558558
for(auto a_it=a.cbegin(); a_it!=a.cend(); ++a_it)
559559
{
560-
auto const b_it=b.find(a_it->first);
560+
const auto b_it=b.find(a_it->first);
561561
if(b_it==b.cend())
562562
return false;
563563
// Necessarily equal?
@@ -603,7 +603,7 @@ void taint_algorithm_computing_summary_of_functiont::
603603
{
604604
std::size_t param_idx;
605605
{
606-
//std::string const caller = as_string(caller_ident);
606+
//const std::string caller = as_string(caller_ident);
607607
const std::string param_name=
608608
as_string(
609609
numbering->at(input.first).get(ID_identifier));
@@ -626,7 +626,7 @@ void taint_algorithm_computing_summary_of_functiont::
626626
*numbering);
627627

628628
lvalue_numbers_sett resolved_lvalues;
629-
for(auto const& lvalue : argument_lvalues)
629+
for(const auto &lvalue : argument_lvalues)
630630
{
631631
const auto it =
632632
summary->get_map_output_lvalues_to_param_indices().find(lvalue);
@@ -643,9 +643,9 @@ void taint_algorithm_computing_summary_of_functiont::
643643
}
644644

645645
taint_sett argument_taint;
646-
for(auto const &lvalue : resolved_lvalues)
646+
for(const auto &lvalue : resolved_lvalues)
647647
{
648-
auto const it = a.find(lvalue);
648+
const auto it = a.find(lvalue);
649649
if(it != a.cend())
650650
argument_taint |= it->second;
651651
}
@@ -784,7 +784,7 @@ void taint_algorithm_computing_summary_of_functiont::initialise_domain(
784784
}
785785
}
786786

787-
for(const auto lvaluenum : environment)
787+
for(const auto lvaluenum : environment)
788788
{
789789
const taint_lvaluet &lvalue=numbering->at(lvaluenum);
790790
// This is an output parameter to get_this passed by reference
@@ -855,10 +855,10 @@ void taint_algorithm_computing_summary_of_functiont::initialise_domain(
855855

856856
void taint_algorithm_computing_summary_of_functiont::handle_assignment(
857857
const code_assignt& asgn,
858-
numbered_lvalue_to_taint_mapt const& a,
858+
const numbered_lvalue_to_taint_mapt &a,
859859
const taint_summary_inputt &input,
860860
numbered_lvalue_to_taint_mapt& result,
861-
instruction_iteratort const& Iit,
861+
const instruction_iteratort &Iit,
862862
local_value_set_analysist &lvsa)
863863
{
864864
TMPROF_BLOCK();
@@ -972,7 +972,7 @@ numbered_lvalue_to_taint_mapt taint_algorithm_computing_summary_of_functiont::
972972
{
973973
TMPROF_BLOCK();
974974

975-
goto_programt::instructiont const& I=*Iit;
975+
const goto_programt::instructiont &I=*Iit;
976976
numbered_lvalue_to_taint_mapt result;
977977
// Take a cheap read-only view of the incoming domain:
978978
result.set_base(&a);

0 commit comments

Comments
 (0)