Skip to content

Commit 2c9afc4

Browse files
add_to_front method for code_with_references_listt
This will make it easier to add declarations at the beggining of a list of codet after the rest of the code has been generated.
1 parent b89d99c commit 2c9afc4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

jbmc/src/java_bytecode/code_with_references.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,9 @@ void code_with_references_listt::append(code_with_references_listt &&other)
6363
{
6464
list.splice(list.end(), other.list);
6565
}
66+
67+
void code_with_references_listt::add_to_front(code_without_referencest code)
68+
{
69+
auto ptr = std::make_shared<code_without_referencest>(std::move(code));
70+
list.emplace_front(std::move(ptr));
71+
}

jbmc/src/java_bytecode/code_with_references.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ class code_with_references_listt
9999
void add(reference_allocationt ref);
100100

101101
void append(code_with_references_listt &&other);
102+
103+
void add_to_front(code_without_referencest code);
102104
};
103105

104106
#endif // CPROVER_JAVA_BYTECODE_CODE_WITH_REFERENCES_H

0 commit comments

Comments
 (0)