Skip to content

irept-related fixes [blocks: #2035] #3606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/util/format_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Author: Daniel Kroening, [email protected]
#include "string2int.h"
#include "string_utils.h"

#include <map>
#include <ostream>
#include <stack>

Expand Down
8 changes: 6 additions & 2 deletions src/util/irep_hash_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ void irep_hash_container_baset::pack(

if(full)
{
packed.reserve(1 + 1 + sub.size() + named_sub.size());
// we pack: the irep id, the sub size, the subs, the named-sub size, and
// each of the named subs with their ids
packed.reserve(1 + 1 + sub.size() + 1 + named_sub.size() * 2);

packed.push_back(irep_id_hash()(irep.id()));

Expand All @@ -72,7 +74,9 @@ void irep_hash_container_baset::pack(
const std::size_t non_comment_count =
irept::number_of_non_comments(named_sub);

packed.reserve(1 + 1 + sub.size() + non_comment_count);
// we pack: the irep id, the sub size, the subs, the named-sub size, and
// each of the non-comment named subs with their ids
packed.reserve(1 + 1 + sub.size() + 1 + non_comment_count * 2);

packed.push_back(irep_id_hash()(irep.id()));

Expand Down
8 changes: 4 additions & 4 deletions src/util/merge_irep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ bool to_be_merged_irept::operator == (const to_be_merged_irept &other) const
const irept::named_subt &o_named_sub=other.get_named_sub();

if(sub.size()!=o_sub.size())
return true;
return false;
if(named_sub.size()!=o_named_sub.size())
return true;
return false;

{
irept::subt::const_iterator s_it=sub.begin();
Expand Down Expand Up @@ -148,7 +148,7 @@ const irept &merge_irept::merged(const irept &irep)
dest_named_sub[it->first]=merged(it->second); // recursive call
#endif

return *irep_store.insert(new_irep).first;
return *irep_store.insert(std::move(new_irep)).first;
}

void merge_full_irept::operator()(irept &irep)
Expand Down Expand Up @@ -185,5 +185,5 @@ const irept &merge_full_irept::merged(const irept &irep)
dest_named_sub[it->first]=merged(it->second); // recursive call
#endif

return *irep_store.insert(new_irep).first;
return *irep_store.insert(std::move(new_irep)).first;
}