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

Method WhileEachSuccessorLabel

source/opt/basic_block.cpp:121–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121bool BasicBlock::WhileEachSuccessorLabel(
122 const std::function<bool(const uint32_t)>& f) const {
123 const auto br = &insts_.back();
124 switch (br->opcode()) {
125 case spv::Op::OpBranch:
126 return f(br->GetOperand(0).words[0]);
127 case spv::Op::OpBranchConditional:
128 case spv::Op::OpSwitch: {
129 bool is_first = true;
130 return br->WhileEachInId([&is_first, &f](const uint32_t* idp) {
131 if (!is_first) return f(*idp);
132 is_first = false;
133 return true;
134 });
135 }
136 default:
137 return true;
138 }
139}
140
141void BasicBlock::ForEachSuccessorLabel(
142 const std::function<void(uint32_t*)>& f) {

Callers 4

IsApplicableMethod · 0.80
IsApplicableMethod · 0.80

Calls 3

backMethod · 0.80
WhileEachInIdMethod · 0.80
opcodeMethod · 0.45

Tested by

no test coverage detected