add_to_front method for code_with_references_listt

This will make it easier to add declarations at the begginning of a list of
codet after the rest of the code has been generated.
This commit is contained in:
Romain Brenguier 2019-09-18 09:00:49 +01:00
parent 93aa152425
commit 5cd0c45842
2 changed files with 8 additions and 0 deletions

View File

@ -68,3 +68,9 @@ void code_with_references_listt::append(code_with_references_listt &&other)
{
list.splice(list.end(), other.list);
}
void code_with_references_listt::add_to_front(code_without_referencest code)
{
auto ptr = std::make_shared<code_without_referencest>(std::move(code));
list.emplace_front(std::move(ptr));
}

View File

@ -101,6 +101,8 @@ public:
void add(reference_allocationt ref);
void append(code_with_references_listt &&other);
void add_to_front(code_without_referencest code);
};
#endif // CPROVER_JAVA_BYTECODE_CODE_WITH_REFERENCES_H