================
@@ -10253,3 +10253,52 @@ The attribute is also supported with blocks and in
Objective-C.
}
}];
}
+
+def ConstDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``const`` attribute can be applied to the declaration of a function to
signal that repeated calls to the function with the same argument values may be
safe to elide because the subsequent calls will always return the same value as
the initial call.
----------------
AaronBallman wrote:
I updated but not quite as strongly as saying all calls can be removed because
that gets a bit complicated and doesn't seem worth explaining here (e.g., if we
don't see the function body, we can't remove all calls, but if we do see the
function body, maybe we can remove all calls but that depends on inlining
behavior).
https://github.com/llvm/llvm-project/pull/205881
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits