[cmake] Unbreak LLVM-Config.cmake / llvm_expand_dependencies.
authorPeter Zotov <whitequark@whitequark.org>
Thu, 18 Dec 2014 23:56:52 +0000 (23:56 +0000)
committerPeter Zotov <whitequark@whitequark.org>
Thu, 18 Dec 2014 23:56:52 +0000 (23:56 +0000)
commitf94eed608393f54389145b42a2f32c53f3b84274
treeeb3e753f5856f26613119e0b712aca36d313853f
parent824e011ad7b400ef79920ae9f84e5f55375720f2
[cmake] Unbreak LLVM-Config.cmake / llvm_expand_dependencies.

The algorithm for sorting libraries in topological order, as
previously implemented, had a few issues:
  * It didn't make any sense.
  * It didn't actually sort libraries in topological order.
  * It hung on some inputs, e.g. "LLVMipo".

This commit replaces the old algorithm with a straightforward port
from llvm-config.cpp.

llvm-svn: 224554
llvm/cmake/modules/LLVM-Config.cmake