diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-20 02:40:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-20 02:40:11 +0000 |
commit | 5635a88fcb596dea5631dd5643b307d744232aa0 (patch) | |
tree | 1d644a225f89286ed5742bf44fd66e66ed6354e4 /llvm/lib/Analysis/DataStructure/Printer.cpp | |
parent | e7a8e8677e4524b1ba36dfe13d561026e7f474d0 (diff) | |
download | bcm5719-llvm-5635a88fcb596dea5631dd5643b307d744232aa0.tar.gz bcm5719-llvm-5635a88fcb596dea5631dd5643b307d744232aa0.zip |
print out equiv class info.
llvm-svn: 20704
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/Printer.cpp')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/Printer.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Printer.cpp b/llvm/lib/Analysis/DataStructure/Printer.cpp index cf1a53ebe1c..e991bc51cc8 100644 --- a/llvm/lib/Analysis/DataStructure/Printer.cpp +++ b/llvm/lib/Analysis/DataStructure/Printer.cpp @@ -75,8 +75,22 @@ static std::string getCaption(const DSNode *N, const DSGraph *G) { OS << "\n"; } - for (unsigned i = 0, e = N->getGlobals().size(); i != e; ++i) { - WriteAsOperand(OS, N->getGlobals()[i], false, true, M); + EquivalenceClasses<GlobalValue*> *GlobalECs = 0; + if (G) GlobalECs = &G->getGlobalECs(); + + for (unsigned i = 0, e = N->getGlobalsList().size(); i != e; ++i) { + WriteAsOperand(OS, N->getGlobalsList()[i], false, true, M); + + // Figure out how many globals are equivalent to this one. + if (GlobalECs) { + EquivalenceClasses<GlobalValue*>::iterator I = + GlobalECs->findValue(N->getGlobalsList()[i]); + if (I != GlobalECs->end()) { + unsigned NumMembers = + std::distance(GlobalECs->member_begin(I), GlobalECs->member_end()); + if (NumMembers != 1) OS << " + " << (NumMembers-1) << " EC"; + } + } OS << "\n"; } |