Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
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 6,897 Lines • ▼ Show 20 Lines | |||||
The symbol used for ``thunk-extern`` is target specific: | The symbol used for ``thunk-extern`` is target specific: | ||||
* X86: ``__x86_return_thunk`` | * X86: ``__x86_return_thunk`` | ||||
As such, this function attribute is currently only supported on X86 targets. | As such, this function attribute is currently only supported on X86 targets. | ||||
}]; | }]; | ||||
} | } | ||||
def DebugTrampolineDocs : Documentation { | |||||
let Category = DocCatFunction; | |||||
let Content = [{ | |||||
aaron.ballman: No need to specify a heading, one is picked automatically because this attribute only has one… | |||||
The ``debug_trampoline`` attribute is intended as a hint for debuggers that this | |||||
function itself is not interesting, but it calls a function that might be. So, when | |||||
stepping in arrives at a function with this attribute, debuggers should transparently | |||||
step-in through it into the functions called by the annotated function (but not by | |||||
subsequent calls made by those functions), stopping at the first one its normal rules | |||||
for whether to stop says to stop at - or stepping out again if none qualify. Also, when | |||||
stepping out arrives at a function with this attribute, the debugger should continue | |||||
stepping out to its caller. | |||||
For example: | |||||
.. code-block:: c | |||||
int bar(void) { | |||||
return 42; | |||||
} | |||||
__attribute__((debug_trampoline)) | |||||
Not Done ReplyInline ActionsI'm sure there is a compelling reason here, but if I ever saw this happen in a debugger, I'd get very confused. erichkeane: I'm sure there is a compelling reason here, but if I ever saw this happen in a debugger, I'd… | |||||
The motivation is for compiler generated thunks that the user shouldn't be aware about. I could update this description/example to make the use case clearer. augusto2112: The motivation is for compiler generated thunks that the user shouldn't be aware about. I could… | |||||
int foo(void) { | |||||
return bar(); | |||||
} | |||||
int caller(void) { | |||||
return foo(); | |||||
} | |||||
Stepping into ``foo`` should step directly into ``bar`` instead, and stepping out of ``bar`` | |||||
should stop in ``caller``. | |||||
Functions with the ``debug_trampoline`` attribute can be chained together: | |||||
.. code-block:: c | |||||
int baz(void) { | |||||
return 42; | |||||
} | |||||
__attribute__((debug_trampoline)) | |||||
int bar(void) { | |||||
return baz(); | |||||
} | |||||
__attribute__((debug_trampoline)) | |||||
int foo(void) { | |||||
return bar(); | |||||
} | |||||
int caller(void) { | |||||
return foo(); | |||||
} | |||||
In this example, stepping into ``foo`` should step directly into ``baz``, and stepping out of | |||||
``baz`` should stop in ``caller``. | |||||
}]; | |||||
} | |||||
def ReadOnlyPlacementDocs : Documentation { | def ReadOnlyPlacementDocs : Documentation { | ||||
let Category = DocCatType; | let Category = DocCatType; | ||||
let Content = [{This attribute is attached to a structure, class or union declaration. | let Content = [{This attribute is attached to a structure, class or union declaration. | ||||
When attached to a record declaration/definition, it checks if all instances | When attached to a record declaration/definition, it checks if all instances | ||||
of this type can be placed in the read-only data segment of the program. If it | of this type can be placed in the read-only data segment of the program. If it | ||||
finds an instance that can not be placed in a read-only segment, the compiler | finds an instance that can not be placed in a read-only segment, the compiler | ||||
emits a warning at the source location where the type was used. | emits a warning at the source location where the type was used. | ||||
Show All 30 Lines | |||||
def WebAssemblyFuncrefDocs : Documentation { | def WebAssemblyFuncrefDocs : Documentation { | ||||
let Category = DocCatType; | let Category = DocCatType; | ||||
let Content = [{ | let Content = [{ | ||||
Clang supports the ``__funcref`` attribute for the WebAssembly target. | Clang supports the ``__funcref`` attribute for the WebAssembly target. | ||||
This attribute may be attached to a function pointer type, where it modifies | This attribute may be attached to a function pointer type, where it modifies | ||||
its underlying representation to be a WebAssembly ``funcref``. | its underlying representation to be a WebAssembly ``funcref``. | ||||
}]; | }]; | ||||
} | } | ||||
Spurious whitespace changes. aaron.ballman: Spurious whitespace changes. |
No need to specify a heading, one is picked automatically because this attribute only has one spelling.