From bfad04d648925ae83d3d6eecdc76778a2ac2fe60 Mon Sep 17 00:00:00 2001 From: Anton Mitrokhin Date: Wed, 6 Aug 2014 11:56:35 +0400 Subject: [PATCH] fix for build fail after llvm commit 214781 --- ispc.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ispc.cpp b/ispc.cpp index b6d7b00a..0a0df702 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -57,10 +57,13 @@ #include #include #endif +#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5) // LLVM 3.6+ + #include +#endif #if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) // LLVM 3.5+ #include #include -#else +#else // LLVM 3.2, 3.3, 3.4 #include #include #endif @@ -656,8 +659,12 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : // Initialize TargetData/DataLayout in 3 steps. // 1. Get default data layout first std::string dl_string; - dl_string = m_targetMachine->getDataLayout()->getStringRepresentation(); +#if !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5) // LLVM 3.6+ + dl_string = m_targetMachine->getSubtargetImpl()->getDataLayout()->getStringRepresentation(); +#else + dl_string = m_targetMachine->getDataLayout()->getStringRepresentation(); +#endif // 2. Adjust for generic if (m_isa == Target::GENERIC) { // <16 x i1> vectors only need 16 bit / 2 byte alignment, so add @@ -677,6 +684,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : // This indicates if we are compiling for 32 bit platform // and can assume 32 bit runtime. // FIXME: all generic targets are handled as 64 bit, which is incorrect. + this->m_is32Bit = (getDataLayout()->getPointerSize() == 4); #if !defined(LLVM_3_2)