mirror of https://github.com/acidanthera/audk.git
MdePkg: add RETURNS_TWICE attribute
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
c7c5a6c4f7
commit
2d94c38ba5
|
@ -218,6 +218,26 @@ VERIFY_SIZE_OF (__VERIFY_UINT32_ENUM_SIZE, 4);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
///
|
||||
/// Tell the code optimizer that the function will return twice.
|
||||
/// This prevents wrong optimizations which can cause bugs.
|
||||
///
|
||||
#ifndef RETURNS_TWICE
|
||||
#if defined (__GNUC__) || defined (__clang__)
|
||||
///
|
||||
/// Tell the code optimizer that the function will return twice.
|
||||
/// This prevents wrong optimizations which can cause bugs.
|
||||
///
|
||||
#define RETURNS_TWICE __attribute__((returns_twice))
|
||||
#else
|
||||
///
|
||||
/// Tell the code optimizer that the function will return twice.
|
||||
/// This prevents wrong optimizations which can cause bugs.
|
||||
///
|
||||
#define RETURNS_TWICE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// For symbol name in assembly code, an extra "_" is sometimes necessary
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue