summaryrefslogtreecommitdiff
path: root/utils/GenLibDeps.pl
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-08-01 08:09:03 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-08-01 08:09:03 +0000
commit9bf2e7f53dd967534c00214ff90fd333c259747b (patch)
tree3e6bdff4a5f2a8a40a840b62a1f27e8562170e77 /utils/GenLibDeps.pl
parent1a7d3263599ada35c850140f82770a263857572d (diff)
downloadllvm-9bf2e7f53dd967534c00214ff90fd333c259747b.tar.gz
llvm-9bf2e7f53dd967534c00214ff90fd333c259747b.tar.bz2
llvm-9bf2e7f53dd967534c00214ff90fd333c259747b.tar.xz
Fix a problem with use of undefined variables. Print an error message if
the first argument is omitted. Attempt to use a standard/default font. Make the generation of the DOT file readable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29429 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/GenLibDeps.pl')
-rwxr-xr-xutils/GenLibDeps.pl48
1 files changed, 39 insertions, 9 deletions
diff --git a/utils/GenLibDeps.pl b/utils/GenLibDeps.pl
index be7af22df4..9bb4752023 100755
--- a/utils/GenLibDeps.pl
+++ b/utils/GenLibDeps.pl
@@ -24,6 +24,9 @@ while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
# Give first option a name.
my $Directory = $ARGV[0];
+if (!defined($Directory)) {
+ die "First argument must be the directory containing LLVM libs\n";
+}
my $nmPath = $ARGV[1];
# Find the "dot" program
@@ -33,9 +36,9 @@ if (!$FLAT) {
die "Can't find 'dot'" if (! -x "$DotPath");
}
-if ($nmPath eq "") {
- chomp($nmPath=`which nm`);
- die "Can't find 'nm'" if (! -x "$nmPath");
+if (!defined($nmPath) || $nmPath eq "") {
+ chomp($nmPath=`which nm`);
+ die "Can't find 'nm'" if (! -x "$nmPath");
}
# Open the directory and read its contents, sorting by name and differentiating
@@ -145,9 +148,23 @@ if (!$FLAT) {
open DOT, "| $DotPath -Tgif > libdeps.gif";
- print DOT "digraph LibDeps {size=\"40,15\"; ratio=\"1.33333\"; margin=\"0.25\"; rankdir=\"LR\"; mclimit=\"50.0\"; ordering=\"out\"; center=\"1\";\n";
- print DOT "node [shape=\"box\",color=\"#000088\",fillcolor=\"#FFFACD\",fontcolor=\"#5577DD\",style=\"filled\",fontsize=\"24\"];\n";
- print DOT "edge [style=\"solid\",color=\"#000088\"];\n";
+ print DOT "digraph LibDeps {\n";
+ print DOT " size=\"40,15\"; \n";
+ print DOT " ratio=\"1.33333\"; \n";
+ print DOT " margin=\"0.25\"; \n";
+ print DOT " rankdir=\"LR\"; \n";
+ print DOT " mclimit=\"50.0\"; \n";
+ print DOT " ordering=\"out\"; \n";
+ print DOT " center=\"1\";\n";
+ print DOT "node [shape=\"box\",\n";
+ print DOT " color=\"#000088\",\n";
+ print DOT " fillcolor=\"#FFFACD\",\n";
+ print DOT " fontcolor=\"#3355BB\",\n";
+ print DOT " style=\"filled\",\n";
+ print DOT " fontname=\"sans\",\n";
+ print DOT " fontsize=\"24\"\n";
+ print DOT "];\n";
+ print DOT "edge [dir=\"forward\",style=\"solid\",color=\"#000088\"];\n";
}
# Print libraries first
@@ -159,9 +176,22 @@ if (!$FLAT) {
print DOT "}\n";
close DOT;
open DOT, "| $DotPath -Tgif > objdeps.gif";
- print DOT "digraph ObjDeps {size=\"40,15\"; ratio=\"1.33333\"; margin=\"0.25\"; rankdir=\"LR\"; mclimit=\"50.0\"; ordering=\"out\"; center=\"1\";\n";
- print DOT "node [shape=\"box\",color=\"#000088\",fillcolor=\"#FFFACD\",fontcolor=\"#5577DD\",style=\"filled\",fontsize=\"24\"];\n";
- print DOT "edge [style=\"solid\",color=\"#000088\"];\n";
+ print DOT "digraph ObjDeps {\n";
+ print DOT " size=\"8,10\";\n";
+ print DOT " margin=\"0.25\";\n";
+ print DOT " rankdir=\"LR\";\n";
+ print DOT " mclimit=\"50.0\";\n";
+ print DOT " ordering=\"out\";\n";
+ print DOT " center=\"1\";\n";
+ print DOT "node [shape=\"box\",\n";
+ print DOT " color=\"#000088\",\n";
+ print DOT " fillcolor=\"#FFFACD\",\n";
+ print DOT " fontcolor=\"#3355BB\",\n";
+ print DOT " fontname=\"sans\",\n";
+ print DOT " style=\"filled\",\n";
+ print DOT " fontsize=\"24\"\n";
+ print DOT "];\n";
+ print DOT "edge [dir=\"forward\",style=\"solid\",color=\"#000088\"];\n";
}
# Print objects second