diff options
author | Dan Gohman <gohman@apple.com> | 2010-12-10 20:04:06 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-12-10 20:04:06 +0000 |
commit | 4a2a3eab2dcca16d61e16d3566eb936683ff9753 (patch) | |
tree | 72119d5313293f53e5b2840add594564b6b57129 /lib/Analysis | |
parent | 91d747569a87ed412622857521f0952d778f67fc (diff) | |
download | external_llvm-4a2a3eab2dcca16d61e16d3566eb936683ff9753.zip external_llvm-4a2a3eab2dcca16d61e16d3566eb936683ff9753.tar.gz external_llvm-4a2a3eab2dcca16d61e16d3566eb936683ff9753.tar.bz2 |
Use PartialAlias to do better noalias lint checking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121514 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/Lint.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Analysis/Lint.cpp b/lib/Analysis/Lint.cpp index 0cdb4b1..270aa45 100644 --- a/lib/Analysis/Lint.cpp +++ b/lib/Analysis/Lint.cpp @@ -232,10 +232,12 @@ void Lint::visitCallSite(CallSite CS) { // where nothing is known. if (Formal->hasNoAliasAttr() && Actual->getType()->isPointerTy()) for (CallSite::arg_iterator BI = CS.arg_begin(); BI != AE; ++BI) - Assert1(AI == BI || - !(*BI)->getType()->isPointerTy() || - AA->alias(*AI, *BI) != AliasAnalysis::MustAlias, - "Unusual: noalias argument aliases another argument", &I); + if (AI != BI && (*BI)->getType()->isPointerTy()) { + AliasAnalysis::AliasResult Result = AA->alias(*AI, *BI); + Assert1(Result != AliasAnalysis::MustAlias && + Result != AliasAnalysis::PartialAlias, + "Unusual: noalias argument aliases another argument", &I); + } // Check that an sret argument points to valid memory. if (Formal->hasStructRetAttr() && Actual->getType()->isPointerTy()) { |