aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/AliasAnalysis.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-12-05 21:03:28 +0000
committerDuncan Sands <baldrick@free.fr>2007-12-05 21:03:28 +0000
commit5d84afdc836fa28d840449108206e850617a2a15 (patch)
tree37ff8418f9a648c6360cb6800f1269c3ed311e1c /lib/Analysis/AliasAnalysis.cpp
parent8c24e74b02bea8681eac497075e6c27ef15aa2ea (diff)
Commit 44487 broke bootstrap of llvm-gcc-4.2. It is
not yet clear why, but in the meantime work around the problem by making less use of readnone/readonly info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44626 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/AliasAnalysis.cpp')
-rw-r--r--lib/Analysis/AliasAnalysis.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp
index 12ea937fa9..fe3f41a9ce 100644
--- a/lib/Analysis/AliasAnalysis.cpp
+++ b/lib/Analysis/AliasAnalysis.cpp
@@ -116,13 +116,17 @@ AliasAnalysis::getModRefInfo(StoreInst *S, Value *P, unsigned Size) {
AliasAnalysis::ModRefBehavior
AliasAnalysis::getModRefBehavior(CallSite CS,
std::vector<PointerAccessInfo> *Info) {
- if (CS.doesNotAccessMemory())
+ if (CS.doesNotAccessMemory() &&
+ // FIXME: workaround gcc bootstrap breakage
+ CS.getCalledFunction() && CS.getCalledFunction()->isDeclaration())
// Can't do better than this.
return DoesNotAccessMemory;
ModRefBehavior MRB = UnknownModRefBehavior;
if (Function *F = CS.getCalledFunction())
MRB = getModRefBehavior(F, CS, Info);
- if (MRB != DoesNotAccessMemory && CS.onlyReadsMemory())
+ if (MRB != DoesNotAccessMemory && CS.onlyReadsMemory() &&
+ // FIXME: workaround gcc bootstrap breakage
+ CS.getCalledFunction() && CS.getCalledFunction()->isDeclaration())
return OnlyReadsMemory;
return MRB;
}
@@ -130,11 +134,15 @@ AliasAnalysis::getModRefBehavior(CallSite CS,
AliasAnalysis::ModRefBehavior
AliasAnalysis::getModRefBehavior(Function *F,
std::vector<PointerAccessInfo> *Info) {
- if (F->doesNotAccessMemory())
+ if (F->doesNotAccessMemory() &&
+ // FIXME: workaround gcc bootstrap breakage
+ F->isDeclaration())
// Can't do better than this.
return DoesNotAccessMemory;
ModRefBehavior MRB = getModRefBehavior(F, CallSite(), Info);
- if (MRB != DoesNotAccessMemory && F->onlyReadsMemory())
+ if (MRB != DoesNotAccessMemory && F->onlyReadsMemory() &&
+ // FIXME: workaround gcc bootstrap breakage
+ F->isDeclaration())
return OnlyReadsMemory;
return MRB;
}