Add "dump" method to IVUsersOneStride.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95022 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2010-02-01 22:51:23 +00:00
parent 5e280a306a
commit f7d848349e
2 changed files with 28 additions and 0 deletions

View File

@ -165,6 +165,11 @@ public:
void removeUser(IVStrideUse *User) {
Users.erase(User);
}
void print(raw_ostream &OS) const;
/// dump - This method is used for debugging.
void dump() const;
};
class IVUsers : public LoopPass {

View File

@ -386,3 +386,26 @@ void IVStrideUse::deleted() {
Parent->Users.erase(this);
// this now dangles!
}
void IVUsersOfOneStride::print(raw_ostream &OS) const {
OS << "IV Users of one stride:\n";
if (Stride)
OS << " Stride: " << *Stride << '\n';
OS << " Users:\n";
unsigned Count = 1;
for (ilist<IVStrideUse>::const_iterator
I = Users.begin(), E = Users.end(); I != E; ++I) {
const IVStrideUse &SU = *I;
OS << " " << Count++ << '\n';
OS << " Offset: " << *SU.getOffset() << '\n';
OS << " Instr: " << *SU << '\n';
}
}
void IVUsersOfOneStride::dump() const {
print(dbgs());
}