All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sparse{i,c}: use LLVM_CONFIG to find llc and lli
@ 2014-04-15 19:51 Cody P Schafer
  2014-04-15 22:28 ` Christopher Li
  0 siblings, 1 reply; 3+ messages in thread
From: Cody P Schafer @ 2014-04-15 19:51 UTC (permalink / raw)
  To: linux-sparse; +Cc: Cody P Schafer

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 <cody@linux.vnet.ibm.com>
---
 sparsec | 6 +++++-
 sparsei | 5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/sparsec b/sparsec
index 9c90b30..f8e7256 100755
--- a/sparsec
+++ b/sparsec
@@ -34,7 +34,11 @@ TMPFILE=`mktemp -t tmp.XXXXXX`".o"
 
 $DIRNAME/sparse-llvm $SPARSEOPTS > $TMPLLVM
 
-llc -o - $TMPLLVM | as -o $TMPFILE
+if [ -z "$LLVM_CONFIG" ]; then
+  LLVM_CONFIG=llvm-config
+fi
+
+`"$LLVM_CONFIG" --bindir`/llc -o - $TMPLLVM | as -o $TMPFILE
 
 if [ $NEED_LINK -eq 1 ]; then
 	if [ -z $OUTFILE ]; then
diff --git a/sparsei b/sparsei
index 4632154..7a2e0f1 100755
--- a/sparsei
+++ b/sparsei
@@ -3,7 +3,10 @@
 set +e
 
 DIRNAME=`dirname $0`
-LLI=`llvm-config --bindir`/lli
+if [ -z "$LLVM_CONFIG" ]; then
+    LLVM_CONFIG=llvm-config
+fi
+LLI=`"$LLVM_CONFIG" --bindir`/lli
 
 if [ $# -eq 0 ]; then
   echo "`basename $0`: no input files"
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sparse{i,c}: use LLVM_CONFIG to find llc and lli
  2014-04-15 19:51 [PATCH] sparse{i,c}: use LLVM_CONFIG to find llc and lli Cody P Schafer
@ 2014-04-15 22:28 ` Christopher Li
  2014-04-15 22:53   ` Cody P Schafer
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Li @ 2014-04-15 22:28 UTC (permalink / raw)
  To: Cody P Schafer; +Cc: Linux-Sparse

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

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"

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sparse{i,c}: use LLVM_CONFIG to find llc and lli
  2014-04-15 22:28 ` Christopher Li
@ 2014-04-15 22:53   ` Cody P Schafer
  0 siblings, 0 replies; 3+ messages in thread
From: Cody P Schafer @ 2014-04-15 22:53 UTC (permalink / raw)
  To: Christopher Li; +Cc: Linux-Sparse

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-15 22:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-15 19:51 [PATCH] sparse{i,c}: use LLVM_CONFIG to find llc and lli Cody P Schafer
2014-04-15 22:28 ` Christopher Li
2014-04-15 22:53   ` Cody P Schafer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.