Commits

Anna Zaks committed 742c90fcc22
[DCE] Add unreachable code warning to DCE pass. This commit teaches DCE to warn about unreachable code. The general approach is to record the BasicBlocks that become unreachable as we are folding conditional branches. Later, when all the reachability info is available, we walk though these blocks and issue warnings on the ones that contain SIL instructions that correspond to user code. We determine if a SIL instruction corresponds to user code by looking at the SILLocations. TODO: - Note, that folding conditions is not as strong right now. Specifically, folding 'x == 0' for Ints is blocked by generics specialization. This limits the applicability of the warning on real code. - We need to extend this to other foldable terminators (not only conditional branch). - We could print a note telling the user which condition has been folded in order to get the unreachable code. Swift SVN r9506