Skip to content

Commit f281f88

Browse files
committed
Removed redundant get_pc() (there is pc())
1 parent 08f1a9e commit f281f88

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

src/path-symex/path_symex_state.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ path_symex_statet initial_state(
4141
return s;
4242
}
4343

44-
loc_reft path_symex_statet::get_pc() const
45-
{
46-
assert(current_thread<threads.size());
47-
return threads[current_thread].pc;
48-
}
49-
5044
void path_symex_statet::output(const threadt &thread, std::ostream &out) const
5145
{
5246
out << " PC: " << thread.pc << '\n';

src/path-symex/path_symex_state.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Author: Daniel Kroening, kroening@kroening.com
1212
#ifndef CPROVER_PATH_SYMEX_PATH_SYMEX_STATE_H
1313
#define CPROVER_PATH_SYMEX_PATH_SYMEX_STATE_H
1414

15+
#include <util/invariant.h>
16+
1517
#include "locs.h"
1618
#include "var_map.h"
1719
#include "path_symex_history.h"
@@ -111,11 +113,9 @@ struct path_symex_statet
111113
current_thread=_thread;
112114
}
113115

114-
loc_reft get_pc() const;
115-
116116
goto_programt::const_targett get_instruction() const
117117
{
118-
return locs[get_pc()].target;
118+
return locs[pc()].target;
119119
}
120120

121121
bool is_executable() const
@@ -145,6 +145,7 @@ struct path_symex_statet
145145

146146
loc_reft pc() const
147147
{
148+
PRECONDITION(current_thread<threads.size());
148149
return threads[current_thread].pc;
149150
}
150151

src/symex/path_search.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ path_searcht::resultt path_searcht::operator()(
6868
statet &state=tmp_queue.front();
6969

7070
// record we have seen it
71-
loc_data[state.get_pc().loc_number].visited=true;
71+
loc_data[state.pc().loc_number].visited=true;
7272

73-
debug() << "Loc: #" << state.get_pc().loc_number
73+
debug() << "Loc: #" << state.pc().loc_number
7474
<< ", queue: " << queue.size()
7575
<< ", depth: " << state.get_depth();
7676
for(const auto &s : queue)

0 commit comments

Comments
 (0)