mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +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/Pass.h"
|
||||||
#include "llvm/ValueSymbolTable.h"
|
#include "llvm/ValueSymbolTable.h"
|
||||||
#include "llvm/TypeSymbolTable.h"
|
#include "llvm/TypeSymbolTable.h"
|
||||||
|
#include "llvm/Transforms/Utils/Local.h"
|
||||||
#include "llvm/Support/Compiler.h"
|
#include "llvm/Support/Compiler.h"
|
||||||
#include "llvm/ADT/SmallPtrSet.h"
|
#include "llvm/ADT/SmallPtrSet.h"
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
@ -268,8 +269,8 @@ bool StripDebugInfo(Module &M) {
|
|||||||
if (Arg1->use_empty()) {
|
if (Arg1->use_empty()) {
|
||||||
if (Constant *C = dyn_cast<Constant>(Arg1))
|
if (Constant *C = dyn_cast<Constant>(Arg1))
|
||||||
DeadConstants.push_back(C);
|
DeadConstants.push_back(C);
|
||||||
if (Instruction *I = dyn_cast<Instruction>(Arg1))
|
else
|
||||||
I->eraseFromParent();
|
RecursivelyDeleteTriviallyDeadInstructions(Arg1, NULL);
|
||||||
}
|
}
|
||||||
if (Arg2->use_empty())
|
if (Arg2->use_empty())
|
||||||
if (Constant *C = dyn_cast<Constant>(Arg2))
|
if (Constant *C = dyn_cast<Constant>(Arg2))
|
||||||
|
Loading…
Reference in New Issue
Block a user