From c152efda47d8c90f540422bb374620b7fb1effbf Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Tue, 25 Jul 2006 19:12:06 +0000 Subject: Add a feature for debugging library dependency cycles, -why option. This implies -flat and will produce a list of all the symbols for each library that another library depends on. Run the output through c++filt for better readability. Also, don't generate a temporary file for storing the dependent library names. Perl can handle it in a %hash. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29273 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/GenLibDeps.pl | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'utils/GenLibDeps.pl') diff --git a/utils/GenLibDeps.pl b/utils/GenLibDeps.pl index ee8cc7aa2a..b14e5e07d8 100755 --- a/utils/GenLibDeps.pl +++ b/utils/GenLibDeps.pl @@ -10,12 +10,15 @@ # # Parse arguments... +my $FLAT = 0; +my $WHY = 0; while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) { shift; last if /^--$/; # Stop processing arguments on -- # List command line options here... if (/^-flat$/) { $FLAT = 1; next; } + if (/^-why/) { $WHY = 1; $FLAT = 1; next; } print "Unknown option: $_ : ignoring!\n"; } @@ -76,46 +79,54 @@ sub gen_one_entry { $lib_ns =~ s/(.*)\.[oa]/$1/; if ($FLAT) { print "$lib:"; + if ($WHY) { print "\n"; } } else { print "
$lib
\n"; } -- cgit v1.2.3