Eliminate inappropriate use of FindProgramByName() from lli
authorAlp Toker <alp@nuanti.com>
Wed, 22 Jan 2014 21:52:35 +0000 (21:52 +0000)
committerAlp Toker <alp@nuanti.com>
Wed, 22 Jan 2014 21:52:35 +0000 (21:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199835 91177308-0d34-0410-b5e6-96231b3b80d8

15 files changed:
test/ExecutionEngine/MCJIT/remote/cross-module-a.ll
test/ExecutionEngine/MCJIT/remote/cross-module-sm-pic-a.ll
test/ExecutionEngine/MCJIT/remote/multi-module-a.ll
test/ExecutionEngine/MCJIT/remote/multi-module-sm-pic-a.ll
test/ExecutionEngine/MCJIT/remote/simpletest-remote.ll
test/ExecutionEngine/MCJIT/remote/stubs-remote.ll
test/ExecutionEngine/MCJIT/remote/test-common-symbols-remote.ll
test/ExecutionEngine/MCJIT/remote/test-data-align-remote.ll
test/ExecutionEngine/MCJIT/remote/test-fp-no-external-funcs-remote.ll
test/ExecutionEngine/MCJIT/remote/test-global-init-nonzero-remote.ll
test/ExecutionEngine/MCJIT/remote/test-ptr-reloc-remote.ll
test/Makefile
test/lit.cfg
test/lit.site.cfg.in
tools/lli/lli.cpp

index 094d362262c5c5fd3d5ebc915405fbaabacca95a..8331ecf93c2cc3893e12235635280a947f6b742f 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli_mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
+; RUN: %lli_mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
 
 declare i32 @FB()
 
index bdaa9a045c8f4b230bba4ad7c468fcad1d0b3ab2..589ba2f6d38269e68fd9646b6a987d86cbc283a7 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli_mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target -relocation-model=pic -code-model=small %s > /dev/null
+; RUN: %lli_mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext -relocation-model=pic -code-model=small %s > /dev/null
 ; XFAIL: mips, i686, i386, arm
 
 declare i32 @FB()
index 91d0387376ca6b1780e656a3ebaf640da2419c50..d04df322cb36d78dc34f2d09ce21dd645f5810d7 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli_mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
+; RUN: %lli_mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
 
 declare i32 @FB()
 
index 73228e458f0448a7056e90b57a3ad19743238f6c..9c2316959910efda099b0e519549bf5e78a67a10 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli_mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target -relocation-model=pic -code-model=small %s > /dev/null
+; RUN: %lli_mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext -relocation-model=pic -code-model=small %s > /dev/null
 ; XFAIL: mips, i686, i386, arm
 
 declare i32 @FB()
index d10a4117a0ddaaac95d991e38c15c17dbb771b3f..ddee861346d88b960435ef7530ee9c24403c2016 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
+; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
 
 define i32 @bar() {
        ret i32 0
index 97932bc389ac11e5e8a4806d031f2876360b4b2a..48b939bbe35b89fe4ea4ab393513731f0c5e4d14 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli_mcjit -remote-mcjit -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target %s
+; RUN: %lli_mcjit -remote-mcjit -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target%exeext %s
 ; XFAIL: *
 ; This test should fail until remote symbol resolution is supported.
 
index 63280895a9a3f264736e6188f9fe1c0bd863b0eb..e07178ed283e616ef0a8a63a8dad16de2730b23e 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli_mcjit -remote-mcjit -O0 -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target %s
+; RUN: %lli_mcjit -remote-mcjit -O0 -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target%exeext %s
 
 ; The intention of this test is to verify that symbols mapped to COMMON in ELF
 ; work as expected.
index 6b2b97bc2d7e4e310dc89decba176b5f464b6602..0c89598423194ee16e7e0e8ff590437d2ee80864 100644 (file)
@@ -1,4 +1,4 @@
-; RUN:  %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target %s
+; RUN:  %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target%exeext %s
 
 ; Check that a variable is always aligned as specified.
 
index a8a93a8dc3bf3debe7a0c28e969c278228af6b79..5ad71112ae87da0c6a59899375035fb561628e6c 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
+; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
 
 define double @test(double* %DP, double %Arg) {
        %D = load double* %DP           ; <double> [#uses=1]
index 4181fb08842c9e36a98145c1f9ae33bc27045c6b..b14d80b156a740a7a774222afcc58018c61f8a36 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null
+; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null
 
 @count = global i32 1, align 4
 
index 8b562972b5d18089f775f1c8d1412bdb9ae7f2d2..d62631ff50c62d1c5851d418a283a2df49d6b890 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target %s
+; RUN: %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target%exeext %s
 
 @.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1
 @ptr = global i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), align 4
index d3227dd5a347706eb4d0b25461df227c0aaec74f..e90370779c9ba7f1fbca4ab233ef47de94bc61f7 100644 (file)
@@ -125,6 +125,7 @@ lit.site.cfg: FORCE
        @$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
        @$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> lit.tmp
        @$(ECHOPATH) s=@SHLIBEXT@=$(SHLIBEXT)=g >> lit.tmp
+       @$(ECHOPATH) s=@EXEEXT@=$(EXEEXT)=g >> lit.tmp
        @$(ECHOPATH) s=@PYTHON_EXECUTABLE@=$(PYTHON)=g >> lit.tmp
        @$(ECHOPATH) s=@OCAMLOPT@=$(OCAMLOPT) -cc $(subst *,'\\\"',*$(subst =,"\\=",$(CXX_FOR_OCAMLOPT))*) -cclib -L$(LibDir) -I $(LibDir)/ocaml=g >> lit.tmp
        @$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp
index 251dbe0966c204d31a7515aca8a2de74c3b2d1ca..622f6ede1a126ec9ee3db97f07a0b64ffab59365 100644 (file)
@@ -188,6 +188,7 @@ else:
 config.substitutions.append( ('%ocamlopt', config.ocamlopt_executable) )
 config.substitutions.append( ('%llvmshlibdir', config.llvm_shlib_dir) )
 config.substitutions.append( ('%shlibext', config.llvm_shlib_ext) )
+config.substitutions.append( ('%exeext', config.llvm_exe_ext) )
 
 # For each occurrence of an llvm tool name as its own word, replace it
 # with the full path to the build directory holding that tool.  This
index b9520f908a5e83ec6a0e3f1cbb79f640ae11e5ec..4c0bb2e47d367a78f6d56a643386896a9f75c240 100644 (file)
@@ -9,6 +9,7 @@ config.llvm_obj_root = "@LLVM_BINARY_DIR@"
 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
 config.llvm_shlib_dir = "@SHLIBDIR@"
 config.llvm_shlib_ext = "@SHLIBEXT@"
+config.llvm_exe_ext = "@EXEEXT@"
 config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
 config.ocamlopt_executable = "@OCAMLOPT@"
index 2ee797930129e7fad19dd2a8803a2353b37532bb..e6d4087476fcc11d1ed93cebaf058be5f02d8556 100644 (file)
@@ -94,12 +94,11 @@ namespace {
   // execution. The child process will be executed and will communicate with
   // lli via stdin/stdout pipes.
   cl::opt<std::string>
-  MCJITRemoteProcess("mcjit-remote-process",
-            cl::desc("Specify the filename of the process to launch "
-                     "for remote MCJIT execution.  If none is specified,"
-                     "\n\tremote execution will be simulated in-process."),
-            cl::value_desc("filename"),
-            cl::init(""));
+  ChildExecPath("mcjit-remote-process",
+                cl::desc("Specify the filename of the process to launch "
+                         "for remote MCJIT execution.  If none is specified,"
+                         "\n\tremote execution will be simulated in-process."),
+                cl::value_desc("filename"), cl::init(""));
 
   // Determine optimization level.
   cl::opt<char>
@@ -663,18 +662,17 @@ int main(int argc, char **argv, char * const *envp) {
     // and send it to the target.
 
     OwningPtr<RemoteTarget> Target;
-    if (!MCJITRemoteProcess.empty()) { // Remote execution on a child process
+    if (!ChildExecPath.empty()) { // Remote execution on a child process
       if (!RemoteTarget::hostSupportsExternalRemoteTarget()) {
         errs() << "Warning: host does not support external remote targets.\n"
                << "  Defaulting to simulated remote execution\n";
         Target.reset(RemoteTarget::createRemoteTarget());
       } else {
-        std::string ChildEXE = sys::FindProgramByName(MCJITRemoteProcess);
-        if (ChildEXE == "") {
-          errs() << "Unable to find child target: '\''" << MCJITRemoteProcess << "\'\n";
+        if (!sys::fs::exists(ChildExecPath)) {
+          errs() << "Unable to find child target: '" << ChildExecPath << "'\n";
           return -1;
         }
-        Target.reset(RemoteTarget::createExternalRemoteTarget(ChildEXE));
+        Target.reset(RemoteTarget::createExternalRemoteTarget(ChildExecPath));
       }
     } else {
       // No child process name provided, use simulated remote execution.