#if HAVE_LLVM < 0x0305
#include <llvm/ADT/OwningPtr.h>
#endif
+#if HAVE_LLVM >= 0x0307
+#include <llvm/IR/LegacyPassManager.h>
+#else
#include <llvm/PassManager.h>
+#endif
#include <llvm/Support/CodeGen.h>
#include <llvm/Support/TargetSelect.h>
#include <llvm/Support/MemoryBuffer.h>
optimize(llvm::Module *mod, unsigned optimization_level,
const std::vector<llvm::Function *> &kernels) {
+#if HAVE_LLVM >= 0x0307
+ llvm::legacy::PassManager PM;
+#else
llvm::PassManager PM;
+#endif
+
// Add a function internalizer pass.
//
// By default, the function internalizer pass will look for a function