Changeset View
Changeset View
Standalone View
Standalone View
clang/include/clang/Basic/AttrDocs.td
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 251 Lines • ▼ Show 20 Lines | .. code-block:: c | |||||||||||
void escapingFunc(__attribute__((noescape)) BlockTy block) { | void escapingFunc(__attribute__((noescape)) BlockTy block) { | |||||||||||
g0 = block; // Not OK. | g0 = block; // Not OK. | |||||||||||
g1 = Block_copy(block); // Not OK either. | g1 = Block_copy(block); // Not OK either. | |||||||||||
} | } | |||||||||||
}]; | }]; | |||||||||||
} | } | |||||||||||
def MaybeUndefDocs : Documentation { | ||||||||||||
aaron.ballmanUnsubmitted Not Done ReplyInline Actions
aaron.ballman: | ||||||||||||
let Category = DocCatVariable; | ||||||||||||
Not Done ReplyInline ActionsI think this should be DocCatVariable temporarily, but we probably should add a new DocCatParameter category at some point and use that instead (in case you're feeling ambitious). aaron.ballman: I think this should be `DocCatVariable` temporarily, but we probably should add a new… | ||||||||||||
let Content = [{ | ||||||||||||
The ``maybe_undef`` attribute can be placed on a function parameter. It indicates | ||||||||||||
Not Done ReplyInline Actions
aaron.ballman: | ||||||||||||
that the parameter is allowed to use undef values. It informs the compiler | ||||||||||||
to insert a freeze LLVM IR instruction on the function parameter. | ||||||||||||
Not Done ReplyInline Actions
aaron.ballman: | ||||||||||||
Please note that this is an attribute that is used as an internal | ||||||||||||
implementation detail and not intended to be used by external users. | ||||||||||||
In languages HIP, CUDA etc., some functions have multi-threaded semantics and | ||||||||||||
it is enough for only one or some threads to provide defined arguments. | ||||||||||||
Depending on semantics, undef arguments in some threads don't produce | ||||||||||||
undefined results in the function call. Since, these functions accept undefined | ||||||||||||
arguments, ``maybe_undef`` attribute can be placed. | ||||||||||||
Sample usage: | ||||||||||||
.. code-block:: c | ||||||||||||
Not Done ReplyInline Actionsparam shouldn't be of void type, right? nhaehnle: `param` shouldn't be of void type, right? | ||||||||||||
void maybeundeffunc(int __attribute__((maybe_undef))param); | ||||||||||||
}]; | ||||||||||||
} | ||||||||||||
def CarriesDependencyDocs : Documentation { | def CarriesDependencyDocs : Documentation { | |||||||||||
let Category = DocCatFunction; | let Category = DocCatFunction; | |||||||||||
let Content = [{ | let Content = [{ | |||||||||||
The ``carries_dependency`` attribute specifies dependency propagation into and | The ``carries_dependency`` attribute specifies dependency propagation into and | |||||||||||
out of functions. | out of functions. | |||||||||||
When specified on a function or Objective-C method, the ``carries_dependency`` | When specified on a function or Objective-C method, the ``carries_dependency`` | |||||||||||
attribute means that the return value carries a dependency out of the function, | attribute means that the return value carries a dependency out of the function, | |||||||||||
▲ Show 20 Lines • Show All 6,366 Lines • Show Last 20 Lines |