Loading...
Searching...
No Matches
Go to the documentation of this file.
32 #define hint_has_attribute(x) __has_attribute(x)
34 #define hint_has_attribute(__x) 0
43#if hint_has_attribute(diagnose_if)
44 #define hint_diagnose_if(condition,message) \
45 _Pragma("clang diagnostic push") \
46 _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \
47 __attribute__((diagnose_if(condition,message,"error"))) \
48 _Pragma("clang diagnostic pop")
50 #define hint_diagnose_if(condition,message)
67 #define hint_has_declspec_attribute(__x) 1
68#elif defined(HINT_USE_DECLSPEC) && defined(__has_declspec_attribute)
69 #define hint_has_declspec_attribute(x) __has_declspec_attribute(x)
71 #define hint_has_declspec_attribute(__x) 0
79#if hint_has_declspec_attribute(empty_bases)
80 #define hint_empty_bases __declspec(empty_bases)
82 #define hint_empty_bases
109#if hint_has_attribute(const)
110 #define hint_const __attribute__((const))
127#if hint_has_attribute(pure)
128 #define hint_pure __attribute__((pure))
162#if hint_has_attribute(lifetimebound)
163 #define hint_lifetimebound [[clang::lifetimebound]]
165 #define hint_lifetimebound
176#if hint_has_attribute(noescape)
177 #define hint_noescape __attribute__((noescape))
179 #define hint_noescape
198#if hint_has_attribute(always_inline)
199 #define hint_inline inline __attribute__((always_inline))
201 #define hint_inline __forceinline
203 #define hint_inline inline
216#if hint_has_attribute(flatten)
217 #define hint_flatten __attribute__((flatten))
231#if hint_has_attribute(artificial)
232 #define hint_artificial __attribute__((artificial))
233#elif hint_has_attribute(__artificial__)
234 #define hint_artificial __attribute__((__artificial__))
236 #define hint_artificial
237 #warning "[[artificial]] is not supported"
248#if hint_has_attribute(noinline)
249 #define hint_noinline __attribute__((noinline))
251 #define hint_noinline
263#if hint_has_attribute(optnone)
264 #define hint_optnone __attribute__((optnone))
287#if hint_has_attribute(weak)
288 #define hint_weak __attribute__((weak))
307#if hint_has_attribute(internal_linkage)
308 #define hint_internal_linkage __attribute__((internal_linkage))
310 #define hint_internal_linkage
322#if __has_cpp_attribute(clang::preferred_name)
323 #define hint_preferred_name(x) [[clang::preferred_name(x)]]
325 #define hint_preferred_name(x)
346#if hint_has_attribute(__visibility__)
347 #define hint_visibility(...) __attribute__((__visibility__(__VA_ARGS__)))
349 #define hint_visibility(...)
350 #warning "[[visibility]] is not supported"
361#if hint_has_attribute(exclude_from_explicit_instantiation)
362 #define hint_exclude_from_explicit_instantiation __attribute__((exclude_from_explicit_instantiation))
364 #define hint_exclude_from_explicit_instantiation
365 #warning "[[exclude_from_explicit_instantiation]] is not supported"
381#define hint_hidden hint_visibility("hidden") hint_exclude_from_explicit_instantiation
401 #define hint_constinit constinit
402#elif hint_has_attribute(require_constant_initialization)
403 #define hint_constinit __attribute__((require_constant_initialization))
405 #define hint_constinit
416#if hint_has_attribute(uninitialized)
417 #define hint_uninitialized __attribute__((uninitialized))
419 #define hint_uninitialized
431#if __has_cpp_attribute(clang::reinitializes)
432 #define hint_reinitializes [[clang::reinitializes]]
434 #define hint_reinitializes
452#define hint_target(x) __attribute__((target(x)))
459#define hint_target_clones(...) __attribute__((target_clones(__VA_ARGS__)))
480#if hint_has_attribute(hot)
481 #define hint_hot __attribute__((hot))
494#if hint_has_attribute(cold)
495 #define hint_cold __attribute__((cold))
522#if hint_has_attribute(consumable)
523 #define hint_consumable(__x) __attribute__((consumable(__x)))
525 #define hint_consumable(__x)
536#if hint_has_attribute(callable_when)
537 #define hint_callable_when(...) __attribute__((callable_when(__VA_ARGS__)))
539 #define hint_callable_when(...)
551#if hint_has_attribute(param_typestate)
552 #define hint_param_typestate(...) __attribute__((param_typestate(__VA_ARGS__)))
554 #define hint_param_typestate(...)
572#if hint_has_attribute(return_typestate)
573 #define hint_return_typestate(...) __attribute__((return_typestate(__VA_ARGS__)))
575 #define hint_return_typestate(...)
587#define hint_moving hint_return_typestate("consumed") hint_param_typestate("unconsumed")
597#if hint_has_attribute(set_typestate)
598 #define hint_set_typestate(...) __attribute__((set_typestate(__VA_ARGS__)))
600 #define hint_set_typestate(...)
611#if hint_has_attribute(test_typestate)
612 #define hint_test_typestate(...) __attribute__((test_typestate(__VA_ARGS__)))
614 #define hint_test_typestate(...)
636#if hint_has_attribute(no_thread_safety_analysis)
637 #define hint_no_thread_safety_analysis __attribute__((no_thread_safety_analysis))
639 #define hint_no_thread_safety_analysis
650#if hint_has_attribute(lockable)
651 #define hint_lockable __attribute__((lockable))
653 #define hint_lockable
665#if hint_has_attribute(scoped_lockable)
666 #define hint_scoped_lockable __attribute__((scoped_lockable))
668 #define hint_scoped_lockable
678#if hint_has_attribute(guarded_var)
679 #define hint_guarded_var __attribute__((guarded_var))
681 #define hint_guarded_var
691#if hint_has_attribute(pt_guarded_var)
692 #define hint_pt_guarded_var __attribute__((pt_guarded_var))
694 #define hint_pt_guarded_var
704#if hint_has_attribute(guarded_by)
705 #define hint_guarded_by(x) __attribute__((guarded_by(x)))
707 #define hint_guarded_by(x)
717#if hint_has_attribute(pt_guarded_by)
718 #define hint_pt_guarded_by(x) __attribute__((pt_guarded_by(x)))
720 #define hint_pt_guarded_by(x)
732#if hint_has_attribute(acquired_before)
733 #define hint_acquired_before(...) __attribute__((acquired_before(__VA_ARGS__)))
735 #define hint_acquired_before(...)
747#if hint_has_attribute(acquired_after)
748 #define hint_acquired_after(...) __attribute__((acquired_after(__VA_ARGS__)))
750 #define hint_acquired_after(...)
764#if hint_has_attribute(exclusive_lock_function)
765 #define hint_exclusive_lock_function(...) __attribute__((exclusive_lock_function(__VA_ARGS__)))
767 #define hint_exclusive_lock_function(...)
784#if hint_has_attribute(shared_trylock_function)
785 #define hint_shared_trylock_function(...) __attribute__((shared_trylock_function(__VA_ARGS__)))
787 #define hint_shared_trylock_function(...)
800#if hint_has_attribute(unlock_function)
801 #define hint_unlock_function(...) __attribute__((unlock_function(__VA_ARGS__)))
803 #define hint_unlock_function(...)
815#if hint_has_attribute(lock_returned)
816 #define hint_lock_returned(__x) __attribute__((lock_returned(__x)))
818 #define hint_lock_returned(__x)
829#if hint_has_attribute(locks_excluded)
830 #define hint_locks_excluded(...) __attribute__((locks_excluded(__VA_ARGS__)))
832 #define hint_locks_excluded(...)
843#if hint_has_attribute(exclusive_locks_required)
844 #define hint_exclusive_locks_required(...) __attribute__((exclusive_locks_required(__VA_ARGS__)))
846 #define hint_exclusive_locks_required(...)
857#if hint_has_attribute(shared_locks_required)
858 #define hint_shared_locks_required(...) __attribute__((shared_locks_required(__VA_ARGS__)))
860 #define hint_shared_locks_required(...)
895#if __has_cpp_attribute(clang::acquire_handle)
896 #define hint_acquire_handle(__x) [[clang::acquire_handle(__x)]]
898 #define hint_acquire_handle(__x)
905#if __has_cpp_attribute(clang::release_handle)
906 #define hint_release_handle(__x) [[clang::release_handle(__x)]]
908 #define hint_release_handle(__x)
915#if __has_cpp_attribute(clang::use_handle)
916 #define hint_use_handle(__x) [[clang::use_handle(__x)]]
918 #define hint_use_handle(__x)
934#if hint_has_attribute(aligned)
935 #define hint_align(x) __attribute__((aligned(x)))
937 #define hint_align(x)
944#if hint_has_attribute(assume_aligned)
945 #define hint_assume_aligned(x) __attribute__((assume_aligned(x)))
947 #define hint_assume_aligned(x)
958#if hint_has_attribute(align_value)
959 #define hint_align_value(x) __attribute__((align_value(x)))
961 #define hint_align_value(x)
983#if hint_has_attribute(malloc)
984 #define hint_malloc __attribute__((malloc))
1001#if hint_has_attribute(alloc_align)
1002 #define hint_alloc_align(N) __attribute__((alloc_align(N)))
1004 #define hint_alloc_align(__N)
1015#if hint_has_attribute(alloc_size)
1016 #define hint_alloc_size(N) __attribute__((alloc_size(N)))
1018 #define hint_alloc_size(__N)
1042#if hint_has_attribute(null_terminated_string_arg)
1043 #define hint_null_terminated_string_arg(x) __attribute__((null_terminated_string_arg(x)))
1045 #define hint_null_terminated_string_arg(x)
1071#if hint_has_attribute(callback)
1072 #define hint_callback(...) __attribute__((callback(__VA_ARGS__)))
1074 #define hint_callback(...)
1087#if hint_has_attribute(noreturn)
1088#define hint_noreturn __attribute__((noreturn))
1090#define hint_noreturn
1111#if hint_has_attribute(returns_nonnull)
1112 #define hint_returns_nonnull __attribute__((returns_nonnull))
1114 #define hint_returns_nonnull
1127#if hint_has_attribute(nonnull)
1128 #define hint_nonnull(...) __attribute__((nonnull(__VA_ARGS__)))
1130 #define hint_nonnull(...)
1160#define hint_Nonnull _Nonnull
1161#define hint_Nullable _Nullable
1162#define hint_Null_unspecified _Null_unspecified
1165#define hint_Nullable
1166#define hint_Null_unspecified
1213#define hint_host __host__
1214#define hint_device __device__
1215#define hint_global __global__
1222#define hint_hd hint_host hint_device
1288#if hint_has_attribute(nonblocking)
1289 #define hint_nonblocking [[clang::nonblocking]]
1290 #define hint_blocking [[clang::blocking]]
1291 #define hint_nonallocating [[clang::nonallocating]]
1292 #define hint_allocating [[clang::allocating]]
1293 #define hint_noalloc(x) [[clang::nonallocating(x)]]
1294 #define hint_noblock(x) [[clang::nonblocking(x)]]
1296 #define hint_nonblocking
1297 #define hint_blocking
1298 #define hint_nonallocating
1299 #define hint_allocating
1300 #define hint_noalloc(__x)
1301 #define hint_noblock(__x)
1308#define hint_constexpr constexpr
1312#define hint_constexpr
1313#define hint_inline inline
1316#define hint_lifetimebound
1317#define hint_noescape
1318#define hint_reinitializes
1319#define hint_artificial