mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-30 04:35:00 +00:00
A few more small cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40922 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a141cfe5b2
commit
c182f17aed
@ -58,11 +58,11 @@ namespace {
|
|||||||
void DeleteDeadInstructionChains(Instruction *I,
|
void DeleteDeadInstructionChains(Instruction *I,
|
||||||
SetVector<Instruction*> &DeadInsts);
|
SetVector<Instruction*> &DeadInsts);
|
||||||
|
|
||||||
// Find the base pointer that a pointer came from
|
/// Find the base pointer that a pointer came from
|
||||||
// Because this is used to find pointers that originate
|
/// Because this is used to find pointers that originate
|
||||||
// from allocas, it is safe to ignore GEP indices, since
|
/// from allocas, it is safe to ignore GEP indices, since
|
||||||
// either the store will be in the alloca, and thus dead,
|
/// either the store will be in the alloca, and thus dead,
|
||||||
// or beyond the end of the alloca, and thus undefined.
|
/// or beyond the end of the alloca, and thus undefined.
|
||||||
void TranslatePointerBitCasts(Value*& v) {
|
void TranslatePointerBitCasts(Value*& v) {
|
||||||
assert(isa<PointerType>(v->getType()) &&
|
assert(isa<PointerType>(v->getType()) &&
|
||||||
"Translating a non-pointer type?");
|
"Translating a non-pointer type?");
|
||||||
@ -113,10 +113,8 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) {
|
|||||||
Value* pointer = 0;
|
Value* pointer = 0;
|
||||||
if (StoreInst* S = dyn_cast<StoreInst>(BBI))
|
if (StoreInst* S = dyn_cast<StoreInst>(BBI))
|
||||||
pointer = S->getPointerOperand();
|
pointer = S->getPointerOperand();
|
||||||
else if (FreeInst* F = dyn_cast<FreeInst>(BBI))
|
else
|
||||||
pointer = F->getPointerOperand();
|
pointer = cast<FreeInst>(BBI)->getPointerOperand();
|
||||||
|
|
||||||
assert(pointer && "Not a free or a store?");
|
|
||||||
|
|
||||||
StoreInst*& last = lastStore[pointer];
|
StoreInst*& last = lastStore[pointer];
|
||||||
bool deletedStore = false;
|
bool deletedStore = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user