diff mbox

sparse{i,c}: use LLVM_CONFIG to find llc and lli

Message ID CANeU7Q=Vma64-WO8yCHueU71EewOMCDUrCDmB8iuQ4XaagS8aw@mail.gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Christopher Li April 15, 2014, 10:28 p.m. UTC
On Tue, Apr 15, 2014 at 12:51 PM, Cody P Schafer
<cody@linux.vnet.ibm.com> wrote:
> 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.

How about this minor incremental patch? It will use the default variable
to make the change smaller.

Chris

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

cody@linux.vnet.ibm.com April 15, 2014, 10:53 p.m. UTC | #1
On 04/15/2014 03:28 PM, Christopher Li wrote:
> On Tue, Apr 15, 2014 at 12:51 PM, Cody P Schafer
> <cody@linux.vnet.ibm.com> wrote:
>> 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.
>
> How about this minor incremental patch? It will use the default variable
> to make the change smaller.
>

Yep, should have remembered that I could just use a default value for 
the variable. Looks good.

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/sparsec b/sparsec
index f8e7256..9dc96c9 100755
--- a/sparsec
+++ b/sparsec
@@ -34,11 +34,9 @@  TMPFILE=`mktemp -t tmp.XXXXXX`".o"

 $DIRNAME/sparse-llvm $SPARSEOPTS > $TMPLLVM

-if [ -z "$LLVM_CONFIG" ]; then
-  LLVM_CONFIG=llvm-config
-fi
+LLC=`"${LLVM_CONFIG:-llvm-config}" --bindir`/llc

-`"$LLVM_CONFIG" --bindir`/llc -o - $TMPLLVM | as -o $TMPFILE
+$LLC -o - $TMPLLVM | as -o $TMPFILE

 if [ $NEED_LINK -eq 1 ]; then
        if [ -z $OUTFILE ]; then
diff --git a/sparsei b/sparsei
index 7a2e0f1..3431a9f 100755
--- a/sparsei
+++ b/sparsei
@@ -3,10 +3,7 @@ 
 set +e

 DIRNAME=`dirname $0`
-if [ -z "$LLVM_CONFIG" ]; then
-    LLVM_CONFIG=llvm-config
-fi
-LLI=`"$LLVM_CONFIG" --bindir`/lli
+LLI=`"${LLVM_CONFIG:-llvm-config}" --bindir`/lli

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