Utilize topological sort in CompilationGraph::Build().