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

Method InsertBasicBlockBefore

source/opt/function.cpp:218–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218BasicBlock* Function::InsertBasicBlockBefore(
219 std::unique_ptr<BasicBlock>&& new_block, BasicBlock* position) {
220 for (auto bb_iter = begin(); bb_iter != end(); ++bb_iter) {
221 if (&*bb_iter == position) {
222 new_block->SetParent(this);
223 bb_iter = bb_iter.InsertBefore(std::move(new_block));
224 return &*bb_iter;
225 }
226 }
227 assert(false && "Could not find insertion point.");
228 return nullptr;
229}
230
231bool Function::HasEarlyReturn() const {
232 auto post_dominator_analysis =

Callers 8

ApplyMethod · 0.80
ApplyMethod · 0.80
ForceRenderRedFunction · 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