mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-24 07:35:04 +00:00
Recursively remove dead argument while removing llvm.dbg.declare intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65971 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4945c65784
commit
9adb01cbc3
@ -28,6 +28,7 @@
|
||||
#include "llvm/Pass.h"
|
||||
#include "llvm/ValueSymbolTable.h"
|
||||
#include "llvm/TypeSymbolTable.h"
|
||||
#include "llvm/Transforms/Utils/Local.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
#include "llvm/ADT/SmallPtrSet.h"
|
||||
using namespace llvm;
|
||||
@ -268,8 +269,8 @@ bool StripDebugInfo(Module &M) {
|
||||
if (Arg1->use_empty()) {
|
||||
if (Constant *C = dyn_cast<Constant>(Arg1))
|
||||
DeadConstants.push_back(C);
|
||||
if (Instruction *I = dyn_cast<Instruction>(Arg1))
|
||||
I->eraseFromParent();
|
||||
else
|
||||
RecursivelyDeleteTriviallyDeadInstructions(Arg1, NULL);
|
||||
}
|
||||
if (Arg2->use_empty())
|
||||
if (Constant *C = dyn_cast<Constant>(Arg2))
|
||||
|
Loading…
x
Reference in New Issue
Block a user