diff options
author | Chris Lattner <sabre@nondot.org> | 2004-12-15 07:22:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-12-15 07:22:13 +0000 |
commit | 0af024c5d00c2a2d0e35ba33f4aaf4ed3fadfae2 (patch) | |
tree | 183ccfd2f3d2d48c09beecabf4615b8302797493 /lib/Analysis/IPA/GlobalsModRef.cpp | |
parent | 248e8ebeff834db9b78917b1531eeee7035eb113 (diff) |
Adjust to new alias analysis interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA/GlobalsModRef.cpp')
-rw-r--r-- | lib/Analysis/IPA/GlobalsModRef.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp index dd8bb35419..cde80eec78 100644 --- a/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/lib/Analysis/IPA/GlobalsModRef.cpp @@ -101,19 +101,17 @@ namespace { } 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); |