Base the implementation on the llvmdo script so that we only have to
[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 TOPDIR=`pwd | sed -e 's#\(.*/llvm\).*#\1#'`
5 if test -d "$TOPDIR" ; then
6   cd $TOPDIR
7   ./utils/llvmdo -dirs "include lib tools utils docs examples test projects" egrep -H -n "$*"
8 else
9   echo "Can't find LLVM top directory in $TOPDIR"
10 fi