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

Chris Lattner lattner at cs.uiuc.edu
Tue Dec 14 23:22:25 PST 2004



Changes in directory llvm/lib/Analysis/IPA:

GlobalsModRef.cpp updated: 1.8 -> 1.9
---
Log message:

Adjust to new alias analysis interfaces


---
Diffs of the changes:  (+8 -10)

Index: llvm/lib/Analysis/IPA/GlobalsModRef.cpp
diff -u llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.8 llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.9
--- llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.8	Tue Dec  7 02:11:24 2004
+++ llvm/lib/Analysis/IPA/GlobalsModRef.cpp	Wed Dec 15 01:22:13 2004
@@ -101,19 +101,17 @@
     }
     bool hasNoModRefInfoForCalls() const { return false; }
 
-    bool doesNotAccessMemory(Function *F) {
+    /// getModRefBehavior - Return the behavior of the specified function if
+    /// called from the specified call site.  The call site may be null in which
+    /// case the most generic behavior of this function should be returned.
+    virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS) {
       if (FunctionRecord *FR = getFunctionInfo(F))
         if (FR->FunctionEffect == 0)
-          return true;
-      return AliasAnalysis::doesNotAccessMemory(F);
+          return DoesNotAccessMemory;
+	else if ((FR->FunctionEffect & Mod) == 0)
+	  return OnlyReadsMemory;
+      return AliasAnalysis::getModRefBehavior(F, CS);    
     }
-    bool onlyReadsMemory(Function *F) {
-      if (FunctionRecord *FR = getFunctionInfo(F))
-        if ((FR->FunctionEffect & Mod) == 0)
-          return true;
-      return AliasAnalysis::onlyReadsMemory(F);
-    }
-
 
     virtual void deleteValue(Value *V);
     virtual void copyValue(Value *From, Value *To);






More information about the llvm-commits mailing list