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 | f5c7ad8949c3d93378d2f43e721ebce7151a48e5 (patch) | |
tree | c6f1641485de1b98efb73d66bb731dbaa12b32b0 /lib/Analysis/DataStructure/Printer.cpp | |
parent | bf30e7268cc367bb1fca8cb752a3dcc503d87a76 (diff) |
print out equiv class info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20704 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/Printer.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/Printer.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/Analysis/DataStructure/Printer.cpp b/lib/Analysis/DataStructure/Printer.cpp index cf1a53ebe1..e991bc51cc 100644 --- a/lib/Analysis/DataStructure/Printer.cpp +++ b/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"; } |