mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 18:31:04 +00:00
Consider debug info intrinsics pointing to null value as dead instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127922 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7b6747ed42
commit
9c5822a966
@ -211,7 +211,20 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB) {
|
||||
bool llvm::isInstructionTriviallyDead(Instruction *I) {
|
||||
if (!I->use_empty() || isa<TerminatorInst>(I)) return false;
|
||||
|
||||
// We don't want debug info removed by anything this general.
|
||||
// We don't want debug info removed by anything this general, unless
|
||||
// debug info is empty.
|
||||
if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(I)) {
|
||||
if (DDI->getAddress())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
} else if (DbgValueInst *DVI = dyn_cast<DbgValueInst>(I)) {
|
||||
if (DVI->getValue())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isa<DbgInfoIntrinsic>(I)) return false;
|
||||
|
||||
if (!I->mayHaveSideEffects()) return true;
|
||||
|
Loading…
Reference in New Issue
Block a user