Marks each block that needs to maintain a clean stack. That is each block that has an outgoing path to a function return.
| 215 | /// Marks each block that needs to maintain a clean stack. That is each block that has an outgoing |
| 216 | /// path to a function return. |
| 217 | void markNeedsCleanStack(CFG& _cfg) |
| 218 | { |
| 219 | for (auto& functionInfo: _cfg.functionInfo | ranges::views::values) |
| 220 | for (CFG::BasicBlock* exit: functionInfo.exits) |
| 221 | util::BreadthFirstSearch<CFG::BasicBlock*>{{exit}}.run([&](CFG::BasicBlock* _block, auto _addChild) { |
| 222 | _block->needsCleanStack = true; |
| 223 | for (CFG::BasicBlock* entry: _block->entries) |
| 224 | _addChild(entry); |
| 225 | }); |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | std::unique_ptr<CFG> ControlFlowGraphBuilder::build( |