Don't include libtool "object" files
[oota-llvm.git] / utils / llvmgrep
1 #!/bin/sh
2 # This is useful because it prints out all of the source files.  Useful for
3 # greps.
4 PATTERN="$*"
5 TOPDIR=`pwd | sed -e 's#(.*/llvm).*#$1#'`
6 if test -d "$TOPDIR" ; then
7   cd $TOPDIR
8   find docs include lib tools utils examples projects -type f \
9       \( -path '*/doxygen/*' -o -path '*/Burg/*' \) -prune -o \
10       -name '*.[cdhylt]*' \
11       \! -name '*~' \
12       \! -name '#*' \
13       \! -name '*.ll' \
14       \! -name '*.lo' \
15       \! -name '*.d' \
16       \! -name '*.dir' \
17       \! -name 'Sparc.burm.c' \
18       \! -name 'llvmAsmParser.cpp' \
19       \! -name 'llvmAsmParser.h' \
20       \! -name 'FileParser.cpp' \
21       \! -name 'FileParser.h' \
22       -exec egrep -H -n "$PATTERN" {} \;
23 else
24   echo "Can't find LLVM top directory in $TOPDIR"
25 fi