Instead of recursive helper method `topologicalSortImpl()`, sort's implementation is moved to `topologicalSort()` function's body directly. `llvm::ReversePostOrderTraversal` is used to create a traversal of blocks in reverse post order. Reviewed By: kiranchandramohan, rriddle Differential Revision: https://reviews.llvm.org/D88544