[llvm-commits] CVS: llvm/lib/Analysis/IPA/IPModRef.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Nov 6 13:08:07 PST 2002


Changes in directory llvm/lib/Analysis/IPA:

IPModRef.cpp updated: 1.2 -> 1.3

---
Log message:

Give a back pointer to the IPModRef object to the FunctionModRefInfo object



---
Diffs of the changes:

Index: llvm/lib/Analysis/IPA/IPModRef.cpp
diff -u llvm/lib/Analysis/IPA/IPModRef.cpp:1.2 llvm/lib/Analysis/IPA/IPModRef.cpp:1.3
--- llvm/lib/Analysis/IPA/IPModRef.cpp:1.2	Wed Nov  6 12:38:18 2002
+++ llvm/lib/Analysis/IPA/IPModRef.cpp	Wed Nov  6 13:07:13 2002
@@ -44,9 +44,10 @@
 // This constructor computes a node numbering for the TD graph.
 // 
 FunctionModRefInfo::FunctionModRefInfo(const Function& func,
+                                       IPModRef& ipmro,
                                        const DSGraph& tdg,
                                        const DSGraph& ldg)
-  : F(func),
+  : F(func), IPModRefObj(ipmro), 
     funcTDGraph(tdg),
     funcLocalGraph(ldg),
     funcModRefInfo(tdg.getGraphSize())
@@ -76,7 +77,7 @@
 // Dummy function that will be replaced with one that inlines
 // the callee's BU graph into the caller's TD graph.
 // 
-const DSGraph* ResolveGraphForCallSite(const DSGraph& funcTDGraph,
+static const DSGraph* ResolveGraphForCallSite(const DSGraph& funcTDGraph,
                                        const CallInst& callInst)
 {
   return &funcTDGraph;                    // TEMPORARY
@@ -203,9 +204,9 @@
 {
   FunctionModRefInfo*& funcInfo = funcToModRefInfoMap[&func];
   assert (funcInfo != NULL || computeIfMissing);
-  if (funcInfo == NULL && computeIfMissing)
+  if (funcInfo == NULL)
     { // Create a new FunctionModRefInfo object
-      funcInfo = new FunctionModRefInfo(func,  // inserts into map
+      funcInfo = new FunctionModRefInfo(func, *this, // inserts into map
                               getAnalysis<TDDataStructures>().getDSGraph(func),
                           getAnalysis<LocalDataStructures>().getDSGraph(func));
       funcInfo->computeModRef(func);            // computes the mod/ref info
@@ -219,6 +220,7 @@
 void IPModRef::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.setPreservesAll();
   AU.addRequired<LocalDataStructures>();
+  AU.addRequired<BUDataStructures>();
   AU.addRequired<TDDataStructures>();
 }
 





More information about the llvm-commits mailing list