mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Skip over debug info when trying to merge two return BBs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98491 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c69b4a5b8b
commit
ead138bc62
@ -26,6 +26,7 @@
|
||||
#include "llvm/Transforms/Utils/Local.h"
|
||||
#include "llvm/Constants.h"
|
||||
#include "llvm/Instructions.h"
|
||||
#include "llvm/IntrinsicInst.h"
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Attributes.h"
|
||||
#include "llvm/Support/CFG.h"
|
||||
@ -210,9 +211,13 @@ static bool MergeEmptyReturnBlocks(Function &F) {
|
||||
// Check for something else in the block.
|
||||
BasicBlock::iterator I = Ret;
|
||||
--I;
|
||||
if (!isa<PHINode>(I) || I != BB.begin() ||
|
||||
// Skip over debug info.
|
||||
while (isa<DbgInfoIntrinsic>(I) && I != BB.begin())
|
||||
--I;
|
||||
if (!isa<DbgInfoIntrinsic>(I) &&
|
||||
(!isa<PHINode>(I) || I != BB.begin() ||
|
||||
Ret->getNumOperands() == 0 ||
|
||||
Ret->getOperand(0) != I)
|
||||
Ret->getOperand(0) != I))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user