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

Method KillDebugDeclares

source/opt/loop_unroller.cpp:628–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626}
627
628void LoopUnrollerUtilsImpl::KillDebugDeclares(BasicBlock* bb) {
629 // We cannot kill an instruction inside BasicBlock::ForEachInst()
630 // because it will generate dangling pointers. We use |to_be_killed|
631 // to kill them after the loop.
632 std::vector<Instruction*> to_be_killed;
633
634 bb->ForEachInst([&to_be_killed, this](Instruction* inst) {
635 if (context_->get_debug_info_mgr()->IsDebugDeclare(inst)) {
636 to_be_killed.push_back(inst);
637 }
638 });
639 for (auto* inst : to_be_killed) context_->KillInst(inst);
640}
641
642// Copy a given basic block, give it a new result_id, and store the new block
643// and the id mapping in the state. |preserve_instructions| is used to determine

Callers 3

RewriteDebugDeclaresMethod · 0.45
ProcessMethod · 0.45
TESTFunction · 0.45

Calls 5

IsDebugDeclareMethod · 0.80
get_debug_info_mgrMethod · 0.80
ForEachInstMethod · 0.45
push_backMethod · 0.45
KillInstMethod · 0.45

Tested by 1

TESTFunction · 0.36