Author: resistor Date: Wed Aug 8 01:06:02 2007 New Revision: 40922 URL: http://llvm.org/viewvc/llvm-project?rev=40922&view=rev Log: A few more small cleanups.
Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=40922&r1=40921&r2=40922&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Wed Aug 8 01:06:02 2007 @@ -58,11 +58,11 @@ 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 @@ 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; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits