| 34 | #include <Common/Containers/TrivialStackVector.h> |
| 35 | |
| 36 | void IL::BasicBlock::CopyTo(BasicBlock *out) const { |
| 37 | out->count = count; |
| 38 | out->dirty = dirty; |
| 39 | out->data = data; |
| 40 | out->sourceSpan = sourceSpan; |
| 41 | out->flags = flags; |
| 42 | |
| 43 | // Preallocate |
| 44 | out->relocationTable.resize(relocationTable.size()); |
| 45 | |
| 46 | // Copy the relocation offsets |
| 47 | for (size_t i = 0; i < relocationTable.size(); i++) { |
| 48 | out->relocationTable[i] = out->relocationAllocator.Allocate(); |
| 49 | out->relocationTable[i]->offset = relocationTable[i]->offset; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | void IL::BasicBlock::IndexUsers() { |
| 54 | // Reindex the map |