aboutsummaryrefslogtreecommitdiffstats
path: root/utils/llvmgrep
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-08-11 21:53:27 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-08-11 21:53:27 +0000
commit1e75b7b01502c0660c419ea6cadb92d86cac354d (patch)
tree9c4256668683612918f662e1cd208a6ed8c8ae78 /utils/llvmgrep
parentb43ce5a148b0816fac693d74f8a69de0b6ca8f0d (diff)
downloadexternal_llvm-1e75b7b01502c0660c419ea6cadb92d86cac354d.zip
external_llvm-1e75b7b01502c0660c419ea6cadb92d86cac354d.tar.gz
external_llvm-1e75b7b01502c0660c419ea6cadb92d86cac354d.tar.bz2
Make llvmdo and llvmgrep invulnerable to where they are run from by getting
the llvm source root from the llvm-config command. The dependency now is that the correct llvm-config command is in the path. For most developers this is the case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/llvmgrep')
-rwxr-xr-xutils/llvmgrep3
1 files changed, 1 insertions, 2 deletions
diff --git a/utils/llvmgrep b/utils/llvmgrep
index e5a08ad..d4369c7 100755
--- a/utils/llvmgrep
+++ b/utils/llvmgrep
@@ -18,8 +18,7 @@
# details.
##===----------------------------------------------------------------------===##
-TOPDIR=`pwd | sed -e 's#\(.*/llvm[0-9]*\).*#\1#'`
-echo $TOPDIR
+TOPDIR=`llvm-config --src-root`
if test -d "$TOPDIR" ; then
cd $TOPDIR
case `uname -s` in