aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-03-24 20:07:16 +0000
committerNate Begeman <natebegeman@mac.com>2005-03-24 20:07:16 +0000
commit2daec457510247c8b931d3f4af8a32066e442dca (patch)
tree30886a98b43e6fc3326ffaabecc9aec0adb8c7f9
parent0d397bd437dd38a7b12b98e557daa8e237839a6c (diff)
Commit Gabor Greif's patch to use iterators in lowering intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20816 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/PowerPC/PPC32ISelSimple.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Target/PowerPC/PPC32ISelSimple.cpp b/lib/Target/PowerPC/PPC32ISelSimple.cpp
index f2b5cec2e1..4793e4b73c 100644
--- a/lib/Target/PowerPC/PPC32ISelSimple.cpp
+++ b/lib/Target/PowerPC/PPC32ISelSimple.cpp
@@ -1928,15 +1928,16 @@ void PPC32ISel::LowerUnknownIntrinsicFunctionCalls(Function &F) {
BB->getInstList().erase(CI);
break;
}
- default:
+ default: {
// All other intrinsic calls we must lower.
- Instruction *Before = CI->getPrev();
+ BasicBlock::iterator me(CI);
+ bool atBegin(BB->begin() == me);
+ if (!atBegin)
+ --me;
TM.getIntrinsicLowering().LowerIntrinsicCall(CI);
- if (Before) { // Move iterator to instruction after call
- I = Before; ++I;
- } else {
- I = BB->begin();
- }
+ // Move iterator to instruction after call
+ I = atBegin ? BB->begin() : ++me;
+ }
}
}