diff options
| author | Dan Gohman <gohman@apple.com> | 2010-08-06 18:24:38 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-08-06 18:24:38 +0000 |
| commit | 30dd9ac0401726e553ae8f5e35cfba3db45bbcb5 (patch) | |
| tree | 71074a265fda7833e1eb92578a2c75b56e3668d5 /lib | |
| parent | 15f14849f6f97c4e13e8364a28bf149ee1db15cf (diff) | |
| download | external_llvm-30dd9ac0401726e553ae8f5e35cfba3db45bbcb5.zip external_llvm-30dd9ac0401726e553ae8f5e35cfba3db45bbcb5.tar.gz external_llvm-30dd9ac0401726e553ae8f5e35cfba3db45bbcb5.tar.bz2 | |
Implement a proper getModRefInfo for va_arg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110458 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Analysis/AliasAnalysis.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp index 0b15334..1f2528f 100644 --- a/lib/Analysis/AliasAnalysis.cpp +++ b/lib/Analysis/AliasAnalysis.cpp @@ -229,6 +229,23 @@ AliasAnalysis::getModRefInfo(const StoreInst *S, const Value *P, unsigned Size) return Mod; } +AliasAnalysis::ModRefResult +AliasAnalysis::getModRefInfo(const VAArgInst *V, const Value *P, unsigned Size) { + // If the va_arg address cannot alias the pointer in question, then the + // specified memory cannot be accessed by the va_arg. + if (!alias(V->getOperand(0), UnknownSize, P, Size)) + return NoModRef; + + // If the pointer is a pointer to constant memory, then it could not have been + // modified by this va_arg. + if (pointsToConstantMemory(P)) + return NoModRef; + + // Otherwise, a va_arg reads and writes. + return ModRef; +} + + AliasAnalysis::ModRefBehavior AliasAnalysis::getIntrinsicModRefBehavior(unsigned iid) { #define GET_INTRINSIC_MODREF_BEHAVIOR |
