mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 13:50:11 +01:00
util/macros: Add ATTRIBUTE_COLD
Reviewed-by: Mary Guillemard <mary@mary.zone> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37475>
This commit is contained in:
parent
7790f98487
commit
e7a62d5eff
2 changed files with 7 additions and 1 deletions
|
|
@ -1033,7 +1033,7 @@ endforeach
|
||||||
_attributes = [
|
_attributes = [
|
||||||
'const', 'flatten', 'malloc', 'pure', 'unused', 'warn_unused_result',
|
'const', 'flatten', 'malloc', 'pure', 'unused', 'warn_unused_result',
|
||||||
'weak', 'format', 'packed', 'returns_nonnull', 'alias', 'noreturn',
|
'weak', 'format', 'packed', 'returns_nonnull', 'alias', 'noreturn',
|
||||||
'optimize',
|
'optimize', 'cold',
|
||||||
]
|
]
|
||||||
foreach a : cc.get_supported_function_attributes(_attributes)
|
foreach a : cc.get_supported_function_attributes(_attributes)
|
||||||
pre_args += '-DHAVE_FUNC_ATTRIBUTE_@0@'.format(a.to_upper())
|
pre_args += '-DHAVE_FUNC_ATTRIBUTE_@0@'.format(a.to_upper())
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,12 @@ do { \
|
||||||
#define ATTRIBUTE_CONST
|
#define ATTRIBUTE_CONST
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_FUNC_ATTRIBUTE_COLD)
|
||||||
|
#define ATTRIBUTE_COLD __attribute__((__cold__))
|
||||||
|
#else
|
||||||
|
#define ATTRIBUTE_COLD
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_FUNC_ATTRIBUTE_FLATTEN
|
#ifdef HAVE_FUNC_ATTRIBUTE_FLATTEN
|
||||||
#define FLATTEN __attribute__((__flatten__))
|
#define FLATTEN __attribute__((__flatten__))
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue