Skip to content

Commit d6fe0ff

Browse files
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.
1 parent 926f095 commit d6fe0ff

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
@@ -68,3 +68,9 @@ void code_with_references_listt::append(code_with_references_listt &&other)
6868
{
6969
list.splice(list.end(), other.list);
7070
}
71+
72+
void code_with_references_listt::add_to_front(code_without_referencest code)
73+
{
74+
auto ptr = std::make_shared<code_without_referencest>(std::move(code));
75+
list.emplace_front(std::move(ptr));
76+
}

jbmc/src/java_bytecode/code_with_references.h

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

103103
void append(code_with_references_listt &&other);
104+
105+
void add_to_front(code_without_referencest code);
104106
};
105107

106108
#endif // CPROVER_JAVA_BYTECODE_CODE_WITH_REFERENCES_H

0 commit comments

Comments
 (0)