Reid Spencer | 2d67208 | 2004-06-19 20:32:55 +0000 | [diff] [blame] | 1 | #!/bin/sh |
Reid Spencer | 181e65d | 2004-09-20 08:09:36 +0000 | [diff] [blame^] | 2 | ##===- utils/llvmgrep - Counts Lines Of Code -----------------*- Script -*-===## |
| 3 | # |
| 4 | # The LLVM Compiler Infrastructure |
| 5 | # |
| 6 | # This file was developed by Reid Spencer and is distributed under the |
| 7 | # University of Illinois Open Source License. See LICENSE.TXT for details. |
| 8 | # |
| 9 | ##===----------------------------------------------------------------------===## |
| 10 | # |
| 11 | # This script searches your srcdir for an egrep style pattern. This can quickly |
| 12 | # help you build a list of the places you need to modify when changing a header |
| 13 | # or other "global" name. The only argument is the pattern you want to search |
| 14 | # for. It should be quoted to escape shell interpretation of the pattern's |
| 15 | # special characters. |
| 16 | # |
| 17 | # Note that the implementation is based on llvmdo. See that script for more |
| 18 | # details. |
| 19 | ##===----------------------------------------------------------------------===## |
| 20 | |
Reid Spencer | b27b78f | 2004-09-20 07:22:23 +0000 | [diff] [blame] | 21 | TOPDIR=`pwd | sed -e 's#\(.*/llvm\).*#\1#'` |
Reid Spencer | 2d67208 | 2004-06-19 20:32:55 +0000 | [diff] [blame] | 22 | if test -d "$TOPDIR" ; then |
| 23 | cd $TOPDIR |
Reid Spencer | b27b78f | 2004-09-20 07:22:23 +0000 | [diff] [blame] | 24 | ./utils/llvmdo -dirs "include lib tools utils docs examples test projects" egrep -H -n "$*" |
Reid Spencer | 23a354d | 2004-07-07 21:19:01 +0000 | [diff] [blame] | 25 | else |
| 26 | echo "Can't find LLVM top directory in $TOPDIR" |
Reid Spencer | 2d67208 | 2004-06-19 20:32:55 +0000 | [diff] [blame] | 27 | fi |