Changeset View
Changeset View
Standalone View
Standalone View
llvm/docs/LangRef.rst
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 1,595 Lines • ▼ Show 20 Lines | ``noduplicate`` | ||||
duplicated by inlining. That implies that the function has | duplicated by inlining. That implies that the function has | ||||
internal linkage and only has one call site, so the original | internal linkage and only has one call site, so the original | ||||
call is dead after inlining. | call is dead after inlining. | ||||
``nofree`` | ``nofree`` | ||||
This function attribute indicates that the function does not, directly or | This function attribute indicates that the function does not, directly or | ||||
transitively, call a memory-deallocation function (``free``, for example) | transitively, call a memory-deallocation function (``free``, for example) | ||||
on a memory allocation which existed before the call. | on a memory allocation which existed before the call. | ||||
As a result, uncaptured pointers that are known to be dereferenceable | A ``nofree`` function is explicitly allowed to free memory which it (or a | ||||
prior to a call to a function with the ``nofree`` attribute are still | transitive callee) allocated or (if not ``nosync``) arrange for another | ||||
known to be dereferenceable after the call. The capturing condition is | thread to free memory on its behalf. | ||||
necessary in environments where the function might communicate the | |||||
pointer to another thread which then deallocates the memory. Alternatively, | As a result, perhaps surprisingly, a ``nofree`` function can return a | ||||
``nosync`` would ensure such communication cannot happen and even captured | pointer to a previously deallocated memory object. | ||||
pointers cannot be freed by the function. | |||||
As a result, any pointers passed to a call to a function with the ``nofree`` | |||||
A ``nofree`` function is explicitly allowed to free memory which it | attribute which is all of | ||||
allocated or (if not ``nosync``) arrange for another thread to free | a) uncaptured prior to the call, | ||||
memory on it's behalf. As a result, perhaps surprisingly, a ``nofree`` | b) known not to be captured by the call (e.g. only passed to ``nocapture`` | ||||
function can return a pointer to a previously deallocated memory object. | parameters), and | ||||
c) known to be dereferenceable prior to a call to a function with | |||||
nlopes: this sentence wasn't finished. | |||||
are still known to be dereferenceable after the call. | |||||
The capturing conditions are necessary in environments where the | |||||
function might communicate the pointer to another thread which then | |||||
deallocates the memory. Alternatively, ``nosync`` would ensure such | |||||
communication cannot happen in a well defined program and even captured | |||||
pointers cannot be freed or arranged to be freed by the function. | |||||
``noimplicitfloat`` | ``noimplicitfloat`` | ||||
This attributes disables implicit floating-point instructions. | This attributes disables implicit floating-point instructions. | ||||
``noinline`` | ``noinline`` | ||||
This attribute indicates that the inliner should never inline this | This attribute indicates that the inliner should never inline this | ||||
function in any situation. This attribute may not be used together | function in any situation. This attribute may not be used together | ||||
with the ``alwaysinline`` attribute. | with the ``alwaysinline`` attribute. | ||||
``nomerge`` | ``nomerge`` | ||||
This attribute indicates that calls to this function should never be merged | This attribute indicates that calls to this function should never be merged | ||||
▲ Show 20 Lines • Show All 20,380 Lines • Show Last 20 Lines |
this sentence wasn't finished.