Remove dependency on the structure of ValueHolder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2001-07-14 06:11:26 +00:00
parent e545981a6a
commit 20a155f5ab

View File

@ -53,14 +53,13 @@ struct BasicBlockDCE {
};
template<class ValueSubclass, class ItemParentType, class DCEController>
static bool RemoveUnusedDefs(ValueHolder<ValueSubclass, ItemParentType> &Vals,
DCEController DCEControl) {
template<class Container, class DCEController>
static bool RemoveUnusedDefs(Container &Vals, DCEController DCEControl) {
bool Changed = false;
typedef ValueHolder<ValueSubclass, ItemParentType> Container;
int Offset = DCEController::EndOffs;
for (Container::iterator DI = Vals.begin(); DI != Vals.end()-Offset; ) {
for (typename Container::iterator DI = Vals.begin();
DI != Vals.end()-Offset; ) {
// Look for un"used" definitions...
if ((*DI)->use_empty() && DCEController::isDCEable(*DI)) {
// Bye bye