================
@@ -1063,15 +1071,32 @@ static bool addArgumentAttrsFromCallsites(Function &F) {
return Changed;
}
-static bool addAccessAttr(Argument *A, Attribute::AttrKind R) {
- assert((R == Attribute::ReadOnly || R == Attribute::ReadNone ||
- R == Attribute::WriteOnly)
- && "Must be an access attribute.");
+static bool addAccessAttrs(Argument *A, ArgProperties Props) {
assert(A && "Argument must not be null.");
+ bool Changed = false;
+ if (!Props.IsFree) {
+ if (!A->hasAttribute(Attribute::NoFree)) {
+ ++NumNoFreeArg;
+ A->addAttr(Attribute::NoFree);
+ Changed = true;
+ }
+ }
----------------
steffenlarsen wrote:
Nit-picking;
```suggestion
if (!Props.IsFree && !A->hasAttribute(Attribute::NoFree)) {
++NumNoFreeArg;
A->addAttr(Attribute::NoFree);
Changed = true;
}
```
https://github.com/llvm/llvm-project/pull/201591
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits