Make bugpoint pass -load arguments to LLI. This lets one use bugpoint with
authorDuncan Sands <baldrick@free.fr>
Tue, 17 Nov 2009 10:20:22 +0000 (10:20 +0000)
committerDuncan Sands <baldrick@free.fr>
Tue, 17 Nov 2009 10:20:22 +0000 (10:20 +0000)
programs that depend on native shared libraries.  Patch by Timo Lindfors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89087 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/ToolRunner.cpp

index 3e63d8050c4be5b3c905bf76234273c4c097be64..645776eafdb9d051d3d0c4071f10691bc7d5f956 100644 (file)
@@ -199,14 +199,15 @@ int LLI::ExecuteProgram(const std::string &Bitcode,
                         const std::vector<std::string> &SharedLibs,
                         unsigned Timeout,
                         unsigned MemoryLimit) {
-  if (!SharedLibs.empty())
-    throw ToolExecutionError("LLI currently does not support "
-                             "loading shared libraries.");
-
   std::vector<const char*> LLIArgs;
   LLIArgs.push_back(LLIPath.c_str());
   LLIArgs.push_back("-force-interpreter=true");
 
+  for (std::vector<std::string>::const_iterator i = SharedLibs.begin(), e = SharedLibs.end(); i != e; ++i) {
+    LLIArgs.push_back("-load");
+    LLIArgs.push_back((*i).c_str());
+  }
+
   // Add any extra LLI args.
   for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i)
     LLIArgs.push_back(ToolArgs[i].c_str());