Replace llvm::sys::Path with std::string.

In many cases this is straightforward. It makes the source LLVM 3.4 compatible without using #idef's.
This commit is contained in:
kai
2013-06-29 14:20:44 +02:00
parent 7194ccff0c
commit cf88271ab9
6 changed files with 38 additions and 56 deletions

View File

@@ -11,7 +11,7 @@
#include "mars.h"
#include "llvm/Support/Program.h"
int executeToolAndWait(llvm::sys::Path tool, std::vector<std::string> const & args, bool verbose)
int executeToolAndWait(const std::string &tool, std::vector<std::string> const &args, bool verbose)
{
// Construct real argument list.
// First entry is the tool itself, last entry must be NULL.
@@ -37,9 +37,10 @@ int executeToolAndWait(llvm::sys::Path tool, std::vector<std::string> const & ar
// Execute tool.
std::string errstr;
#if LDC_LLVM_VER >= 304
if (int status = llvm::sys::ExecuteAndWait(tool.str(), &realargs[0], NULL, NULL, 0, 0, &errstr))
if (int status = llvm::sys::ExecuteAndWait(tool, &realargs[0], NULL, NULL, 0, 0, &errstr))
#else
if (int status = llvm::sys::Program::ExecuteAndWait(tool, &realargs[0], NULL, NULL, 0, 0, &errstr))
llvm::sys::Path toolpath(tool);
if (int status = llvm::sys::Program::ExecuteAndWait(toolpath, &realargs[0], NULL, NULL, 0, 0, &errstr))
#endif
{
error("%s failed with status: %d", tool.c_str(), status);