aboutsummaryrefslogtreecommitdiff
path: root/tools/bugpoint/ToolRunner.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-23 22:45:37 +0000
committerChris Lattner <sabre@nondot.org>2009-08-23 22:45:37 +0000
commit74382b7c699120fbec5cb5603c9cf4212eb37f06 (patch)
treec8c2c5b8879b256c428b0d35841b9cce1c2cc51c /tools/bugpoint/ToolRunner.cpp
parent983c592272eb59d39fd78c515e1f2701638879e0 (diff)
Prune #includes from llvm/Linker.h and llvm/System/Path.h,
forcing them down into various .cpp files. This change also: 1. Renames TimeValue::toString() and Path::toString() to ::str() for similarity with the STL. 2. Removes all stream insertion support for sys::Path, forcing clients to call .str(). 3. Removes a use of Config/alloca.h from bugpoint, using smallvector instead. 4. Weans llvm-db off <iostream> sys::Path really needs to be gutted, but I don't have the desire to do it at this point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79869 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ToolRunner.cpp')
-rw-r--r--tools/bugpoint/ToolRunner.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp
index 01afc20bad..e3e1cae4e5 100644
--- a/tools/bugpoint/ToolRunner.cpp
+++ b/tools/bugpoint/ToolRunner.cpp
@@ -13,11 +13,12 @@
#define DEBUG_TYPE "toolrunner"
#include "ToolRunner.h"
-#include "llvm/Config/config.h" // for HAVE_LINK_R
#include "llvm/System/Program.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FileUtilities.h"
+#include "llvm/Support/raw_ostream.h"
+#include "llvm/Config/config.h" // for HAVE_LINK_R
#include <fstream>
#include <sstream>
using namespace llvm;
@@ -232,7 +233,7 @@ AbstractInterpreter *AbstractInterpreter::createLLI(const char *Argv0,
std::string &Message,
const std::vector<std::string> *ToolArgs) {
std::string LLIPath =
- FindExecutable("lli", Argv0, (void *)(intptr_t)&createLLI).toString();
+ FindExecutable("lli", Argv0, (void *)(intptr_t)&createLLI).str();
if (!LLIPath.empty()) {
Message = "Found lli: " + LLIPath + "\n";
return new LLI(LLIPath, ToolArgs);
@@ -332,7 +333,7 @@ AbstractInterpreter *AbstractInterpreter::createCustom(
pos = ExecCommandLine.find_first_of(delimiters, lastPos);
}
- std::string CmdPath = sys::Program::FindProgramByName(Command).toString();
+ std::string CmdPath = sys::Program::FindProgramByName(Command).str();
if (CmdPath.empty()) {
Message =
std::string("Cannot find '") + Command +
@@ -407,7 +408,7 @@ int LLC::ExecuteProgram(const std::string &Bitcode,
GCCArgs.insert(GCCArgs.end(), gccArgs.begin(), gccArgs.end());
// Assuming LLC worked, compile the result with GCC and run it.
- return gcc->ExecuteProgram(OutputAsmFile.toString(), Args, GCC::AsmFile,
+ return gcc->ExecuteProgram(OutputAsmFile.str(), Args, GCC::AsmFile,
InputFile, OutputFile, GCCArgs,
Timeout, MemoryLimit);
}
@@ -419,7 +420,7 @@ LLC *AbstractInterpreter::createLLC(const char *Argv0,
const std::vector<std::string> *Args,
const std::vector<std::string> *GCCArgs) {
std::string LLCPath =
- FindExecutable("llc", Argv0, (void *)(intptr_t)&createLLC).toString();
+ FindExecutable("llc", Argv0, (void *)(intptr_t)&createLLC).str();
if (LLCPath.empty()) {
Message = "Cannot find `llc' in executable directory or PATH!\n";
return 0;
@@ -505,7 +506,7 @@ int JIT::ExecuteProgram(const std::string &Bitcode,
AbstractInterpreter *AbstractInterpreter::createJIT(const char *Argv0,
std::string &Message, const std::vector<std::string> *Args) {
std::string LLIPath =
- FindExecutable("lli", Argv0, (void *)(intptr_t)&createJIT).toString();
+ FindExecutable("lli", Argv0, (void *)(intptr_t)&createJIT).str();
if (!LLIPath.empty()) {
Message = "Found lli: " + LLIPath + "\n";
return new JIT(LLIPath, Args);
@@ -572,7 +573,7 @@ int CBE::ExecuteProgram(const std::string &Bitcode,
std::vector<std::string> GCCArgs(ArgsForGCC);
GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end());
- return gcc->ExecuteProgram(OutputCFile.toString(), Args, GCC::CFile,
+ return gcc->ExecuteProgram(OutputCFile.str(), Args, GCC::CFile,
InputFile, OutputFile, GCCArgs,
Timeout, MemoryLimit);
}
@@ -591,7 +592,7 @@ CBE *AbstractInterpreter::createCBE(const char *Argv0,
return 0;
}
- Message = "Found llc: " + LLCPath.toString() + "\n";
+ Message = "Found llc: " + LLCPath.str() + "\n";
GCC *gcc = GCC::create(Message, GCCArgs);
if (!gcc) {
errs() << Message << "\n";
@@ -757,7 +758,7 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType,
errs() << "Error making unique filename: " << ErrMsg << "\n";
exit(1);
}
- OutputFile = uniqueFilename.toString();
+ OutputFile = uniqueFilename.str();
std::vector<const char*> GCCArgs;
@@ -839,6 +840,6 @@ GCC *GCC::create(std::string &Message,
if (!RemoteClient.empty())
RemoteClientPath = sys::Program::FindProgramByName(RemoteClient);
- Message = "Found gcc: " + GCCPath.toString() + "\n";
+ Message = "Found gcc: " + GCCPath.str() + "\n";
return new GCC(GCCPath, RemoteClientPath, Args);
}