This is an archive of the discontinued LLVM Phabricator instance.

[LangRef] Clarify that inaccessiblememonly functions are allowed noalias returns
ClosedPublic

Authored by reames on Jan 18 2022, 9:16 AM.

Details

Summary

Confusion over this point came up in a couple of recent changes (D117180, e20b32ff3). Current tone of discussion seems to be that we think inaccessiblememonly was always legal on allocation functions, so this change takes the form of a clarification instead of a change.

Diff Detail

Event Timeline

reames created this revision.Jan 18 2022, 9:16 AM
reames requested review of this revision.Jan 18 2022, 9:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2022, 9:16 AM
jdoerfert accepted this revision.Jan 18 2022, 9:53 AM

LG

llvm/docs/LangRef.rst
1643

Nit: why callee and not function? We could even say explicitly the function can write the memory it returns (before it returns it), e.g., calloc.

This revision is now accepted and ready to land.Jan 18 2022, 9:53 AM
nikic accepted this revision.Jan 18 2022, 10:43 AM

LGTM as well.

Bryce-MW accepted this revision.Jan 18 2022, 12:34 PM

It was ambiguous before because this is exactly what I thought it meant. Even though the memory becomes accessible after returning, it is not accessible during the call so it should be allowed to be modified. I think this clarification makes it a lot more clear.

This revision was landed with ongoing or failed builds.Jan 18 2022, 2:48 PM
This revision was automatically updated to reflect the committed changes.