Skip to content

Commit

Permalink
Adding move constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDumbell committed Mar 12, 2019
1 parent 8ca4924 commit 9304733
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/goto-symex/goto_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ class goto_statet
unsigned atomic_section_id = 0;

/// Constructors
goto_statet() = default;
goto_statet &operator=(const goto_statet &other) = default;
goto_statet &operator=(goto_statet &&other) = default;
goto_statet(const goto_statet &other) = default;
goto_statet(goto_statet &&other) = default;

explicit goto_statet(const class goto_symex_statet &s);

explicit goto_statet(guard_managert &guard_manager)
Expand Down
10 changes: 10 additions & 0 deletions src/goto-symex/renaming_level.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ enum levelt
/// during symex to ensure static single assignment (SSA) form.
struct symex_renaming_levelt
{
symex_renaming_levelt() = default;
virtual ~symex_renaming_levelt() = default;
symex_renaming_levelt &
operator=(const symex_renaming_levelt &other) = default;
symex_renaming_levelt &operator=(symex_renaming_levelt &&other) = default;
symex_renaming_levelt(const symex_renaming_levelt &other) = default;
symex_renaming_levelt(symex_renaming_levelt &&other) = default;

/// Map identifier to ssa_exprt and counter
typedef std::map<irep_idt, std::pair<ssa_exprt, unsigned>> current_namest;
Expand Down Expand Up @@ -125,6 +131,10 @@ struct symex_level2t : public symex_renaming_levelt

symex_level2t() = default;
~symex_level2t() override = default;
symex_level2t &operator=(const symex_level2t &other) = default;
symex_level2t &operator=(symex_level2t &&other) = default;
symex_level2t(const symex_level2t &other) = default;
symex_level2t(symex_level2t &&other) = default;
};

/// Undo all levels of renaming
Expand Down
9 changes: 9 additions & 0 deletions src/goto-symex/symex_target.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ class symex_targett
pc(_goto_program.instructions.begin())
{
}

sourcet(sourcet &&other) noexcept
: thread_nr(other.thread_nr), function_id(other.function_id), pc(other.pc)
{
}

sourcet(const sourcet &other) = default;
sourcet &operator=(const sourcet &other) = default;
sourcet &operator=(sourcet &&other) = default;
};

enum class assignment_typet
Expand Down
5 changes: 5 additions & 0 deletions src/pointer-analysis/value_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ class value_sett
{
}

value_sett(value_sett &&other)
: location_number(other.location_number), values(std::move(other.values))
{
}

virtual ~value_sett() = default;

value_sett(const value_sett &other) = default;
Expand Down

0 comments on commit 9304733

Please sign in to comment.