diff options
author | Dale Johannesen <dalej@apple.com> | 2009-03-17 00:38:24 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2009-03-17 00:38:24 +0000 |
commit | 6b233395025069f63156ea2b524cdb708a14731f (patch) | |
tree | ce49eace8e9dacf8199c3f3ce7a52537782cec40 /lib/Transforms/Scalar/JumpThreading.cpp | |
parent | 89a66a96fed75796bc5e079217130b62105cb438 (diff) |
Fix a debug info dependency in jump threading.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r-- | lib/Transforms/Scalar/JumpThreading.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp index f96fc208ae..69d17993b5 100644 --- a/lib/Transforms/Scalar/JumpThreading.cpp +++ b/lib/Transforms/Scalar/JumpThreading.cpp @@ -432,10 +432,13 @@ bool JumpThreading::ProcessSwitchOnDuplicateCond(BasicBlock *PredBB, // If DESTBB *just* contains the switch, then we can forward edges from PREDBB // directly to their destination. This does not introduce *any* code size - // growth. + // growth. Skip debug info first. + BasicBlock::iterator BBI = DestBB->begin(); + while (isa<DbgInfoIntrinsic>(BBI)) + BBI++; // FIXME: Thread if it just contains a PHI. - if (isa<SwitchInst>(DestBB->begin())) { + if (isa<SwitchInst>(BBI)) { bool MadeChange = false; // Ignore the default edge for now. for (unsigned i = 1, e = DestSI->getNumSuccessors(); i != e; ++i) { |