mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 16:36:40 +00:00
Use PartialAlias to do better noalias lint checking.
llvm-svn: 121514
This commit is contained in:
parent
cbee92bb65
commit
98f5b2ae22
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user