#include <llvm/PassManager.h>
#include <llvm/Support/TargetSelect.h>
#include <llvm/Support/MemoryBuffer.h>
+#if HAVE_LLVM < 0x0303
#include <llvm/Support/PathV1.h>
+#endif
#include <llvm/Transforms/IPO.h>
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
llvm::PassManager PM;
llvm::PassManagerBuilder Builder;
- llvm::sys::Path libclc_path =
- llvm::sys::Path(LIBCLC_LIBEXECDIR + processor +
- "-" + triple + ".bc");
-
+ std::string libclc_path = LIBCLC_LIBEXECDIR + processor + "-"
+ + triple + ".bc";
// Link the kernel with libclc
#if HAVE_LLVM < 0x0303
bool isNative;
llvm::Linker linker("clover", mod);
- linker.LinkInFile(libclc_path, isNative);
+ linker.LinkInFile(llvm::sys::Path(libclc_path), isNative);
mod = linker.releaseModule();
#else
std::string err_str;
llvm::SMDiagnostic err;
- llvm::Module *libclc_mod = llvm::ParseIRFile(libclc_path.str(), err,
+ llvm::Module *libclc_mod = llvm::ParseIRFile(libclc_path, err,
mod->getContext());
if (llvm::Linker::LinkModules(mod, libclc_mod,
llvm::Linker::DestroySource,