Skip to content

Commit fe5eda1

Browse files
codypssparsecli
authored andcommitted
sparse{i,c}: use LLVM_CONFIG to find llc and lli
Some systems have multiple llvm versions installed, and have prefixed executables ("<exec>-<version>"). While we could require the user to specify a variable for each executable (LLC, LLI), using llvm-config --bindir to locate them and allowing them to override using LLVM_CONFIG makes much less work. Signed-off-by: Cody P Schafer <[email protected]> Signed-off-by: Christopher Li <[email protected]>
1 parent 2ea2697 commit fe5eda1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

sparsec

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ TMPFILE=`mktemp -t tmp.XXXXXX`".o"
3434

3535
$DIRNAME/sparse-llvm $SPARSEOPTS > $TMPLLVM
3636

37-
llc -o - $TMPLLVM | as -o $TMPFILE
37+
LLC=`"${LLVM_CONFIG:-llvm-config}" --bindir`/llc
38+
39+
$LLC -o - $TMPLLVM | as -o $TMPFILE
3840

3941
if [ $NEED_LINK -eq 1 ]; then
4042
if [ -z $OUTFILE ]; then

sparsei

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set +e
44

55
DIRNAME=`dirname $0`
6-
LLI=`llvm-config --bindir`/lli
6+
LLI=`"${LLVM_CONFIG:-llvm-config}" --bindir`/lli
77

88
if [ $# -eq 0 ]; then
99
echo "`basename $0`: no input files"

0 commit comments

Comments
 (0)