[LLVMdev] [RFC] Scoped no-alias metadata
Krzysztof Parzyszek
kparzysz at codeaurora.org
Mon Dec 3 11:30:31 PST 2012
On 12/2/2012 2:48 PM, Hal Finkel wrote:
>
> [...] As a result, we'll need to assign a unique identifier to each lifetime region (roughly a block in C99, although this may be only a partial block if a restrict pointer is declared in the middle of the block).
Whether restricted pointer is declared in the middle of a block or not,
does not matter from the standard's perspective. Although I don't think
it changes much in your proposal (other than possibly eliminating some
difficult cases that could otherwise appear).
---
"Let D be a declaration of an ordinary identifier that provides a means
of designating an object P as a restrict-qualified pointer to type T.
If D appears inside a block and does not have storage class extern, let
B denote the block. If D appears in the list of parameter declarations
of a function definition, let B denote the associated block. Otherwise,
let B denote the block of main (or the block of whatever function is
called at program startup in a freestanding environment)."
The above does not specify where in the block B, the declaration D
appears. At the same time, the section below applies to the entire block B:
"During each execution of B, let L be any lvalue that has &L based on P.
If L is used to access the value of the object X that it designates, and
X is also modified (by any means), then the following requirements
apply: T shall not be const-qualified. Every other lvalue used to access
the value of X shall also have its address based on P."
-Krzysztof
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
More information about the llvm-dev
mailing list