mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
[core.builtins] Improve docs for trap, likely, unlikely (#17491)
Based on: https://github.com/dlang/dmd/edit/master/changelog/druntime.expect-trap.dd
This commit is contained in:
parent
06e8c8d3dd
commit
2674d225aa
1 changed files with 5 additions and 2 deletions
|
@ -78,6 +78,8 @@ else version (DigitalMars)
|
|||
return val;
|
||||
}
|
||||
|
||||
/// Execute target dependent trap instruction, if supported.
|
||||
/// Otherwise, abort execution.
|
||||
pragma(inline, true)
|
||||
void trap()
|
||||
{
|
||||
|
@ -90,7 +92,8 @@ else version (DigitalMars)
|
|||
}
|
||||
}
|
||||
|
||||
/// Provide static branch hints
|
||||
/// Provide static branch and value hints for the LDC/GDC compilers.
|
||||
/// DMD ignores these hints.
|
||||
pragma(inline, true) bool likely(bool b) { return expect(b, true); }
|
||||
///
|
||||
/// ditto
|
||||
pragma(inline, true) bool unlikely(bool b) { return expect(b, false); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue