From d6bacd0c7bf4c1dfc4f882e62250bd0ee63e9727 Mon Sep 17 00:00:00 2001 From: Dmitry Babokin Date: Wed, 25 May 2016 14:46:53 +0300 Subject: [PATCH] Fix for LLVM trunk - TargetMachine interface has changed and now requires Optional instead of just Reloc::Model. --- ispc.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ispc.cpp b/ispc.cpp index 0f6d9170..da86f981 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -1063,8 +1063,15 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic, boo // Create TargetMachine std::string triple = GetTripleString(); +#if ISPC_LLVM_VERSION <= ISPC_LLVM_3_8 llvm::Reloc::Model relocModel = m_generatePIC ? llvm::Reloc::PIC_ : llvm::Reloc::Default; +#else + llvm::Optional relocModel; + if (m_generatePIC) { + relocModel = llvm::Reloc::PIC_; + } +#endif std::string featuresString = m_attributes; llvm::TargetOptions options; #ifdef ISPC_ARM_ENABLED