summaryrefslogtreecommitdiffstats
path: root/lib/Analysis/IPA
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-02-05 23:36:27 +0000
committerOwen Anderson <resistor@mac.com>2009-02-05 23:36:27 +0000
commite79422096ea5319a365d160693d0957a2a4df75e (patch)
treed93b46314c3112a1a47533d2ea0236c878e18527 /lib/Analysis/IPA
parent32d9701d680e30c3cf102c0addfacf36ff827a48 (diff)
downloadexternal_llvm-e79422096ea5319a365d160693d0957a2a4df75e.zip
external_llvm-e79422096ea5319a365d160693d0957a2a4df75e.tar.gz
external_llvm-e79422096ea5319a365d160693d0957a2a4df75e.tar.bz2
Refactor my previous change to maintain the distinction between AliasAnalysis and BasicAliasAnalysis. This involves some wider changes because it
folds away some never-used methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63900 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA')
-rw-r--r--lib/Analysis/IPA/GlobalsModRef.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp
index a795ca6..2e9884a 100644
--- a/lib/Analysis/IPA/GlobalsModRef.cpp
+++ b/lib/Analysis/IPA/GlobalsModRef.cpp
@@ -117,7 +117,7 @@ namespace {
/// 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,
+ ModRefBehavior getModRefBehavior(Function *F,
std::vector<PointerAccessInfo> *Info) {
if (FunctionRecord *FR = getFunctionInfo(F)) {
if (FR->FunctionEffect == 0)
@@ -125,7 +125,23 @@ namespace {
else if ((FR->FunctionEffect & Mod) == 0)
return OnlyReadsMemory;
}
- return AliasAnalysis::getModRefBehavior(F, CS, Info);
+ return AliasAnalysis::getModRefBehavior(F, Info);
+ }
+
+ /// 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.
+ ModRefBehavior getModRefBehavior(CallSite CS,
+ std::vector<PointerAccessInfo> *Info) {
+ Function* F = CS.getCalledFunction();
+ if (!F) return AliasAnalysis::getModRefBehavior(CS, Info);
+ if (FunctionRecord *FR = getFunctionInfo(F)) {
+ if (FR->FunctionEffect == 0)
+ return DoesNotAccessMemory;
+ else if ((FR->FunctionEffect & Mod) == 0)
+ return OnlyReadsMemory;
+ }
+ return AliasAnalysis::getModRefBehavior(CS, Info);
}
virtual void deleteValue(Value *V);