clover: Fix build with LLVM 3.4

Reported on IRC by lordheavy
This commit is contained in:
Tom Stellard 2013-06-27 09:41:34 -07:00
parent 191795eaf1
commit 0e990736f3
1 changed files with 6 additions and 6 deletions

View File

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