[PATCH] D86233: [LangRef] Define mustprogress attribute
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 25 11:28:39 PDT 2020
nikic added inline comments.
================
Comment at: llvm/docs/LangRef.rst:1963
+ Standard <http://eel.is/c++draft/intro.progress>`_. This attribute does
+ not apply transitively to callees. This is implied by `willreturn`.
----------------
jdoerfert wrote:
> ```
> This attribute indicates that the function is required to return, unwind,
> or interact with the environment in an observable way e.g. via a
> volatile memory access, I/O, or other synchronization.
> The ``mustprogress`` attribute is intended to model the
> requirements of the first section of `[intro.progress] of the C++
> Standard <http://eel.is/c++draft/intro.progress>`_. This attribute does
> not apply transitively to callees, that means a callee might not make progress.
> Note that `willreturn` implies `mustprogress`.
> ```
Some notes from my side:
* I'm not sure how to interpret the "does not apply to callees" part. If mustprogress function A calls not-mustprogress function B and B goes into an infinite loop, then A will not return, unwind or interact with the environment, thus violating the mustprogress contract. Now, the callee does not necessarily have to be mustprogress in general, but I believe it needs to progress for any invocation from a mustprogress function -- or not?
* I would explicitly state that violating the progress requirement results in undefined behavior.
* It may be worthwhile to explicitly mention that a non-interacting loop inside a mustprogress function can thus be assumed to terminate and may be removed. That would help clarify the practical effect setting this attribute has.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86233/new/
https://reviews.llvm.org/D86233
More information about the llvm-commits
mailing list