[PATCH] D97924: [LangRef] clarify the semantics of nocapture

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 11:23:05 PST 2021


jdoerfert added a comment.

I would not interchange "capture" and "escape" in the text, it doesn't help. Stick with capture.

The volatile stuff should go in the pointer capture section.



================
Comment at: llvm/docs/LangRef.rst:2642
+results of operations such as :ref:`ptrtoint <i_ptrtoint>` and thus alters the
+final state.
+
----------------
I don't really like this text too much. Storing is only one way and I'm not sure why we need to talk about non-integral pointers at all.

@reames and me recently started a write up to define "capture", maybe we should share that.


================
Comment at: llvm/docs/LangRef.rst:2647
+A pointer that is passed as a :ref:`nocapture <nocapture>` argument isn't
+escaped by the function call.
+
----------------
The first thing is not true, e.g., it ignores ptr2int.


================
Comment at: llvm/docs/LangRef.rst:2653
+and another not tagged as arguments, and callee can escape the untagged
+pointer.
+
----------------
I honestly don't understand this. For me, the beginning reads like: "If the pointer is nocapture it is captured when ...." which is at least odd. I assume you want to say that nocapture applies to the use and not the value, if so, let's do that more explicitly.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97924/new/

https://reviews.llvm.org/D97924



More information about the llvm-commits mailing list