llvm.org GIT mirror llvm / 108b26d
clang-format GenericDomTreeConstruction.h, since the current formatting makes it look like their is a bug in the loop indentation, and there is not git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296569 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Berlin 3 years ago
1 changed file(s) with 13 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
170170 }
171171 }
172172 // Accounting for the virtual exit, see if we had any unreachable nodes
173 if (Total + 1 != N ) {
173 if (Total + 1 != N) {
174174 // Make another DFS pass over all other nodes to find the unreachable
175175 // blocks, and find the furthest paths we'll be able to make.
176176 // Note that this looks N^2, but it's really 2N worst case, if every node
193193 ConnectToExitBlock.insert(FurthestAway);
194194 N = ReverseDFSPass(DT, FurthestAway, N);
195195 }
196 // Finally, now everything should be visited, and anything with parent
197 // ==
198 // 0 should be connected to virtual exit.
199 for (auto *Node : ConnectToExitBlock) {
200 auto FindResult = DT.Info.find(Node);
201 assert(FindResult != DT.Info.end() &&
202 "Everything should have been visited by now");
203 if (FindResult->second.Parent == 0) {
204 FindResult->second.Parent = 1;
205 DT.addRoot(Node);
206 }
196 // Finally, now everything should be visited, and anything with parent ==
197 // 0 should be connected to virtual exit.
198 for (auto *Node : ConnectToExitBlock) {
199 auto FindResult = DT.Info.find(Node);
200 assert(FindResult != DT.Info.end() &&
201 "Everything should have been visited by now");
202 if (FindResult->second.Parent == 0) {
203 FindResult->second.Parent = 1;
204 DT.addRoot(Node);
207205 }
208206 }
209 } else {
210 N = DFSPass(DT, GraphTraits::getEntryNode(&F), N);
207 }
208 } else {
209 N = DFSPass(DT, GraphTraits::getEntryNode(&F), N);
211210 }
212211
213212 // When naively implemented, the Lengauer-Tarjan algorithm requires a separate