Adjust to new alias analysis interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18957 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp
index dd8bb35..cde80ee 100644
--- a/lib/Analysis/IPA/GlobalsModRef.cpp
+++ b/lib/Analysis/IPA/GlobalsModRef.cpp
@@ -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);