MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / InsertBasicBlockAfter

Method InsertBasicBlockAfter

source/opt/function.cpp:204–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204BasicBlock* Function::InsertBasicBlockAfter(
205 std::unique_ptr<BasicBlock>&& new_block, BasicBlock* position) {
206 for (auto bb_iter = begin(); bb_iter != end(); ++bb_iter) {
207 if (&*bb_iter == position) {
208 new_block->SetParent(this);
209 ++bb_iter;
210 bb_iter = bb_iter.InsertBefore(std::move(new_block));
211 return &*bb_iter;
212 }
213 }
214 assert(false && "Could not find insertion point.");
215 return nullptr;
216}
217
218BasicBlock* Function::InsertBasicBlockBefore(
219 std::unique_ptr<BasicBlock>&& new_block, BasicBlock* position) {

Callers 5

splitEdgeMethod · 0.80
SplitBasicBlockMethod · 0.80
ApplyMethod · 0.80
ApplyMethod · 0.80
ApplyMethod · 0.80

Calls 2

SetParentMethod · 0.45
InsertBeforeMethod · 0.45

Tested by

no test coverage detected