Clarify the description of the noalias attribute
authorHal Finkel <hfinkel@anl.gov>
Fri, 21 Nov 2014 02:22:46 +0000 (02:22 +0000)
committerHal Finkel <hfinkel@anl.gov>
Fri, 21 Nov 2014 02:22:46 +0000 (02:22 +0000)
commit57ec3b54886b912b32b2f84b77ca6ec445e7aa24
tree30796f737d400d81e6406b148be7867193ca3976
parentd90eb5527c869d6f478b6706e3c5642feb9e6088
Clarify the description of the noalias attribute

The previous description of the noalias attribute did not accurately specify
the implemented semantics, and the terminology used differed unnecessarily
from that used by the C specification to define the semantics of restrict. For
the argument attribute, the semantics can be precisely specified in terms of
objects accessed through pointers based on the arguments, and this is now what
is done.

Saying that the semantics are 'slightly weaker' than that provided by C99
restrict is not really useful without further elaboration, so that has been
removed from the sentence.

noalias on a return value is really used to mean that the function is
malloc-like (and, in fact, we use this attribute to represent
__attribute__((malloc)) in Clang), and this is a stronger guarantee than that
provided by restrict (because it is a property of the pointed-to memory region,
not just a guarantee on object access). Clarifying this is relevant to fixing
(and was motivated by the discussion on) PR21556.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222497 91177308-0d34-0410-b5e6-96231b3b80d8
docs/LangRef.rst