================
@@ -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.
----------------
philnik777 wrote:
We can, and apparently do so even at -O0 if unused:
https://godbolt.org/z/j8T5MjrWT
When used in some way it can still be removed by optimizations:
https://godbolt.org/z/qGPPjfKMo
https://github.com/llvm/llvm-project/pull/205881
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits