summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-09-20 07:21:19 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-09-20 07:21:19 +0000
commit6707342ff6d06384addffe6c7fb2e97f93d453df (patch)
treec72c1ffcf232e0b6ea127348c663955324dd28e7 /llvm/utils
parentd59cebf87a16bf4cd286077cdc5de03f00d9cf64 (diff)
downloadbcm5719-llvm-6707342ff6d06384addffe6c7fb2e97f93d453df.tar.gz
bcm5719-llvm-6707342ff6d06384addffe6c7fb2e97f93d453df.zip
Fixed to actually work correctly and be the basis for other tools by
allowing the set of directories searched to be specified either by the LLVMDO_DIRS env var or by the -dirs "dirs..." command line option. llvm-svn: 16441
Diffstat (limited to 'llvm/utils')
-rwxr-xr-xllvm/utils/llvmdo48
1 files changed, 39 insertions, 9 deletions
diff --git a/llvm/utils/llvmdo b/llvm/utils/llvmdo
index 5127fc51b81..22c708b58e8 100755
--- a/llvm/utils/llvmdo
+++ b/llvm/utils/llvmdo
@@ -1,32 +1,62 @@
#!/bin/sh
# This is useful because it prints out all of the source files. Useful for
# greps.
+
+if test $# -lt 1 ; then
+ echo "Usage: llvmdo [-dirs "DIRNAMES..."] PROGRAM ARGS...";
+ exit 1;
+fi
+
+if test "$1" = "-dirs" ; then
+ LLVMDO_DIRS="$2";
+ shift ; shift
+elif test -z "$LLVMDO_DIRS" ; then
+ LLVMDO_DIRS="include lib tools test utils docs examples projects"
+fi
PROGRAM=`which $1`
-if [ ! -x "$PROGRAM" ]; then
+if test ! -x "$PROGRAM" ; then
echo "Can't execute $1"
exit 1
fi
shift;
ARGS="$*"
-TOPDIR=`pwd | sed -e 's#(.*/llvm).*#$1#'`
+TOPDIR=`pwd | sed -e 's#\(.*/llvm\).*#\1#'`
if test -d "$TOPDIR" ; then
cd $TOPDIR
- echo $TOPDIR
- find docs include lib tools utils projects -type f \
- \( -path '*/doxygen/*' -o -path '*/Burg/*' \) -prune -o \
- -name '*.[cdhyl]*' \
+ find $LLVMDO_DIRS -type f \
+ \( \
+ -path 'docs/doxygen/*' -o \
+ -path 'docs/CommandGuide/html/*' -o \
+ -path 'docs/CommandGuide/man/*' -o \
+ -path 'docs/CommandGuide/ps/*' -o \
+ -path 'docs/CommandGuide/man/*' -o \
+ -path 'docs/HistoricalNotes/*' -o \
+ -path 'utils/Burg/*' -o \
+ -path 'docs/img/*' -o \
+ -path '*/.libs/*' \
+ \) -prune -o \( \
+ -name '*.[cdhyltp]*' \
+ \! -name '.*' \
\! -name '*~' \
\! -name '#*' \
- \! -name '*.ll' \
- \! -name '*.lo' \
\! -name '*.d' \
\! -name '*.dir' \
+ \! -name '*.flc' \
+ \! -name '*.inc' \
+ \! -name '*.ll' \
+ \! -name '*.llx' \
+ \! -name '*.la' \
+ \! -name '*.lo' \
\! -name 'Sparc.burm.c' \
\! -name 'llvmAsmParser.cpp' \
\! -name 'llvmAsmParser.h' \
\! -name 'FileParser.cpp' \
\! -name 'FileParser.h' \
- -exec $PROGRAM $ARGS {} \;
+ \! -name 'StackerParser.h' \
+ \! -name 'StackerParser.cpp' \
+ -exec $PROGRAM $ARGS {} \; \
+ \)
else
echo "Can't find LLVM top directory in $TOPDIR"
fi
+
OpenPOWER on IntegriCloud