mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Don't analyze arguments already marked 'nocapture'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61532 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3fa0de2727
commit
17da06ffbd
@ -56,6 +56,10 @@ public:
|
||||
/// it in its containing function.
|
||||
bool hasNoAliasAttr() const;
|
||||
|
||||
/// hasNoCaptureAttr - Return true if this argument has the nocapture
|
||||
/// attribute on it in its containing function.
|
||||
bool hasNoCaptureAttr() const;
|
||||
|
||||
/// hasSRetAttr - Return true if this argument has the sret attribute on it in
|
||||
/// its containing function.
|
||||
bool hasStructRetAttr() const;
|
||||
|
@ -263,7 +263,8 @@ bool FunctionAttrs::AddNoCaptureAttrs(const std::vector<CallGraphNode *> &SCC) {
|
||||
continue;
|
||||
|
||||
for (Function::arg_iterator A = F->arg_begin(), E = F->arg_end(); A!=E; ++A)
|
||||
if (isa<PointerType>(A->getType()) && !isCaptured(*F, A)) {
|
||||
if (isa<PointerType>(A->getType()) && !A->hasNoCaptureAttr() &&
|
||||
!isCaptured(*F, A)) {
|
||||
A->addAttr(Attribute::NoCapture);
|
||||
NumNoCapture++;
|
||||
Changed = true;
|
||||
|
@ -102,6 +102,13 @@ bool Argument::hasNoAliasAttr() const {
|
||||
return getParent()->paramHasAttr(getArgNo()+1, Attribute::NoAlias);
|
||||
}
|
||||
|
||||
/// hasNoCaptureAttr - Return true if this argument has the nocapture attribute
|
||||
/// on it in its containing function.
|
||||
bool Argument::hasNoCaptureAttr() const {
|
||||
if (!isa<PointerType>(getType())) return false;
|
||||
return getParent()->paramHasAttr(getArgNo()+1, Attribute::NoCapture);
|
||||
}
|
||||
|
||||
/// hasSRetAttr - Return true if this argument has the sret attribute on
|
||||
/// it in its containing function.
|
||||
bool Argument::hasStructRetAttr() const {
|
||||
|
Loading…
Reference in New Issue
Block a user