[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Mar 21 12:21:02 PST 2005
Changes in directory llvm/lib/Analysis/DataStructure:
BottomUpClosure.cpp updated: 1.101 -> 1.102
---
Log message:
Fix a major problem where we didn't add call graph edges for call sites with
more than 1 callee. This fixes Analysis/DSGraph/FunctionPointerTable-const.ll
---
Diffs of the changes: (+10 -6)
BottomUpClosure.cpp | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.101 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.102
--- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.101 Sat Mar 19 22:29:39 2005
+++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp Mon Mar 21 14:20:49 2005
@@ -354,11 +354,11 @@
continue;
} else {
DSGraph *GI;
+ Instruction *TheCall = CS.getCallSite().getInstruction();
if (CalledFuncs.size() == 1) {
Function *Callee = CalledFuncs[0];
- ActualCallees.insert(std::make_pair(CS.getCallSite().getInstruction(),
- Callee));
+ ActualCallees.insert(std::make_pair(TheCall, Callee));
// Get the data structure graph for the called function.
GI = &getDSGraph(*Callee); // Graph to inline
@@ -378,12 +378,16 @@
std::cerr << " calls " << CalledFuncs.size()
<< " fns from site: " << CS.getCallSite().getInstruction()
<< " " << *CS.getCallSite().getInstruction();
- unsigned NumToPrint = CalledFuncs.size();
- if (NumToPrint > 8) NumToPrint = 8;
std::cerr << " Fns =";
+ unsigned NumPrinted = 0;
+
for (std::vector<Function*>::iterator I = CalledFuncs.begin(),
- E = CalledFuncs.end(); I != E && NumToPrint; ++I, --NumToPrint)
- std::cerr << " " << (*I)->getName();
+ E = CalledFuncs.end(); I != E; ++I) {
+ if (NumPrinted++ < 8) std::cerr << " " << (*I)->getName();
+
+ // Add the call edges to the call graph.
+ ActualCallees.insert(std::make_pair(TheCall, *I));
+ }
std::cerr << "\n";
// See if we already computed a graph for this set of callees.
More information about the llvm-commits
mailing list