diff --git a/cbackend.cpp b/cbackend.cpp index 17a0c864..3552205a 100644 --- a/cbackend.cpp +++ b/cbackend.cpp @@ -3343,7 +3343,11 @@ void CWriter::printFunction(llvm::Function &F) { // print the basic blocks for (llvm::Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) { if (llvm::Loop *L = LI->getLoopFor(&*BB)) { +#if ISPC_LLVM_VERSION >= ISPC_LLVM_3_9 // LLVM 3.9+ + if (L->getHeader()->getIterator() == BB && L->getParentLoop() == 0) +#else if (L->getHeader() == BB && L->getParentLoop() == 0) +#endif printLoop(L); } else { printBasicBlock(&*BB);