summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IPA/GlobalsModRef.cpp
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
commit98a3617fba41ff4b4dd9cdfb7f662e9adb91eaae (patch)
tree88b3b282acf64faa107ef4b59eee999c1283207a /llvm/lib/Analysis/IPA/GlobalsModRef.cpp
parenteff93e04018effd78ac738b1e2385a986accc8b0 (diff)
downloadbcm5719-llvm-98a3617fba41ff4b4dd9cdfb7f662e9adb91eaae.tar.gz
bcm5719-llvm-98a3617fba41ff4b4dd9cdfb7f662e9adb91eaae.zip
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. llvm-svn: 63900
Diffstat (limited to 'llvm/lib/Analysis/IPA/GlobalsModRef.cpp')
-rw-r--r--llvm/lib/Analysis/IPA/GlobalsModRef.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/IPA/GlobalsModRef.cpp b/llvm/lib/Analysis/IPA/GlobalsModRef.cpp
index a795ca675fe..2e9884aa01b 100644
--- a/llvm/lib/Analysis/IPA/GlobalsModRef.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud