Merge pull request #1176 from Shishpan/trunkFix

Fix for Revision 261498
This commit is contained in:
Dmitry Babokin
2016-02-24 22:29:36 +03:00

View File

@@ -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);