summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-08-08 06:06:02 +0000
committerOwen Anderson <resistor@mac.com>2007-08-08 06:06:02 +0000
commitb17ab030814fe2a49a9b509cc28d464810a16d0e (patch)
tree6f2d1b7e96adf4898fa4e52e79cb87ff3716610e /llvm/lib
parent103947125c0d6501f027c80eb81a7473241e28a4 (diff)
downloadbcm5719-llvm-b17ab030814fe2a49a9b509cc28d464810a16d0e.tar.gz
bcm5719-llvm-b17ab030814fe2a49a9b509cc28d464810a16d0e.zip
A few more small cleanups.
llvm-svn: 40922
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index 9397869ad31..1e3ca868c23 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -58,11 +58,11 @@ namespace {
void DeleteDeadInstructionChains(Instruction *I,
SetVector<Instruction*> &DeadInsts);
- // Find the base pointer that a pointer came from
- // Because this is used to find pointers that originate
- // from allocas, it is safe to ignore GEP indices, since
- // either the store will be in the alloca, and thus dead,
- // or beyond the end of the alloca, and thus undefined.
+ /// Find the base pointer that a pointer came from
+ /// Because this is used to find pointers that originate
+ /// from allocas, it is safe to ignore GEP indices, since
+ /// either the store will be in the alloca, and thus dead,
+ /// or beyond the end of the alloca, and thus undefined.
void TranslatePointerBitCasts(Value*& v) {
assert(isa<PointerType>(v->getType()) &&
"Translating a non-pointer type?");
@@ -113,10 +113,8 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) {
Value* pointer = 0;
if (StoreInst* S = dyn_cast<StoreInst>(BBI))
pointer = S->getPointerOperand();
- else if (FreeInst* F = dyn_cast<FreeInst>(BBI))
- pointer = F->getPointerOperand();
-
- assert(pointer && "Not a free or a store?");
+ else
+ pointer = cast<FreeInst>(BBI)->getPointerOperand();
StoreInst*& last = lastStore[pointer];
bool deletedStore = false;
OpenPOWER on IntegriCloud