-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Add the 'initializes' attribute langref and support #84803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
2554c82
a9256bf
9150ece
206b707
eaf5ca0
52cc649
f7fddb0
3b5955a
6a1df7a
fe2e0a5
f73df04
63c45f6
dcc2b38
9723322
e70988d
9782c31
a924dd3
45cdc34
4eeba08
502e062
fac03b8
ea3e7c5
7630510
a604b4f
f941b24
e52fd9d
8e64fa9
9ae0fca
d4809ab
99d36cc
96191cd
645f577
2a8ea9a
37edecd
80306d7
67445fe
68643a5
46e8d87
714d02f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1621,6 +1621,31 @@ Currently, only the following parameter attributes are defined: | |||||
``readonly`` or a ``memory`` attribute that does not contain | ||||||
``argmem: write``. | ||||||
|
||||||
``initialized((Lo1,Hi1),...)`` | ||||||
This attribute indicates that the function initializes the ranges of the | ||||||
pointer parameter's memory, [%p+LoN, %p+HiN): there are no reads, and no | ||||||
special accesses (such as volatile access or untrackable capture) before | ||||||
the initialization write in the function. | ||||||
|
||||||
This attribute implies that the function initializes and does not read | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't use `This attribute only holds for the memory accessed via this pointer parameter. Other arbitrary accesses to the same memory via other pointers are allowed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||||||
before initialization through this pointer argument, even though it may | ||||||
read the memory before initialization that the pointer points to, such | ||||||
as through other arguments. | ||||||
|
||||||
Note that this attribute does not apply to the unwind edge: the | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is now redundant with the unwind comment above |
||||||
initializing function does not read the pointer before writing to it | ||||||
regardless of unwinding or not, but the memory may not actually be | ||||||
written to when unwinding happens. | ||||||
|
||||||
The ``writable`` or ``dereferenceable`` attribute does not imply the | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||||||
``initialized`` attribute, and ``initialized`` does not imply ``writeonly`` | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: "does not imply [the] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd separate this into two sentences. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||||||
since ``initialized`` allows reading from the pointer after writing. | ||||||
|
||||||
This attribute is a list of const ranges in ascending order with no | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/const/constant There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, done! |
||||||
overlapping or adjoining list elements. LoN/HiN are 64-bit ints, and | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't heard "adjoining" used in this context, I think "consecutive" is more commonly used. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||||||
negative values are allowed in case the argument points partway into | ||||||
an allocation. | ||||||
|
||||||
``dead_on_unwind`` | ||||||
At a high level, this attribute indicates that the pointer argument is dead | ||||||
if the call unwinds, in the sense that the caller will not depend on the | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.