2020-06-15 14:18:57 +00:00
|
|
|
(defconst cosmo-c-keywords-regex
|
|
|
|
(let (
|
2020-12-09 12:00:48 +00:00
|
|
|
|
2020-06-15 14:18:57 +00:00
|
|
|
(c99
|
|
|
|
'("inline"
|
|
|
|
"restrict"
|
|
|
|
"_Imaginary"
|
|
|
|
"_Bool"
|
|
|
|
"_Pragma"
|
|
|
|
"_Complex"))
|
|
|
|
|
2023-12-15 03:55:56 +00:00
|
|
|
(cuda
|
2024-01-29 05:57:40 +00:00
|
|
|
'("gridDim"
|
|
|
|
"blockIdx"
|
|
|
|
"blockDim"
|
|
|
|
"threadIdx"
|
|
|
|
"__device__"
|
2023-12-15 03:55:56 +00:00
|
|
|
"__forceinline__"
|
|
|
|
"__global__"
|
|
|
|
"__shared__"
|
|
|
|
"__host__"
|
|
|
|
"__constant__"))
|
|
|
|
|
2020-06-15 14:18:57 +00:00
|
|
|
(c11
|
|
|
|
'("_Atomic"
|
2022-12-11 22:30:50 +00:00
|
|
|
"alignas"
|
2020-06-15 14:18:57 +00:00
|
|
|
"_Alignas"
|
2022-12-11 22:30:50 +00:00
|
|
|
"alignof"
|
2020-06-15 14:18:57 +00:00
|
|
|
"_Alignof"
|
|
|
|
"_Noreturn"
|
|
|
|
"_Generic"
|
2022-12-11 22:30:50 +00:00
|
|
|
"thread_local"
|
2020-06-15 14:18:57 +00:00
|
|
|
"_Thread_local"
|
2022-12-11 22:30:50 +00:00
|
|
|
"static_assert"
|
2020-06-15 14:18:57 +00:00
|
|
|
"_Static_assert"
|
|
|
|
"_Complex_I"
|
|
|
|
"_Imaginary_I"))
|
|
|
|
|
|
|
|
(cosmo
|
2023-08-10 01:36:38 +00:00
|
|
|
'("__weak"
|
|
|
|
"__msabi"
|
2023-05-16 06:11:47 +00:00
|
|
|
"__funline"
|
2022-03-16 20:33:13 +00:00
|
|
|
"function"
|
2020-10-01 08:20:13 +00:00
|
|
|
"offsetof"
|
2023-06-09 13:41:34 +00:00
|
|
|
"_Microarchitecture"
|
2020-06-15 14:18:57 +00:00
|
|
|
"forcealignargpointer"
|
|
|
|
"textexit"
|
|
|
|
"externinline"
|
2021-11-12 23:12:18 +00:00
|
|
|
"dontinline"
|
2022-12-11 22:30:50 +00:00
|
|
|
"dontclone"
|
2020-06-15 14:18:57 +00:00
|
|
|
"donothing"
|
2022-12-11 22:30:50 +00:00
|
|
|
"notsan"
|
2020-06-15 14:18:57 +00:00
|
|
|
"printfesque"
|
|
|
|
"flattenout"
|
|
|
|
"mallocesque"
|
|
|
|
"vallocesque"
|
|
|
|
"null"
|
|
|
|
"paramsnonnull"
|
|
|
|
"returnspointerwithnoaliases"
|
|
|
|
"alignas"
|
|
|
|
"nosideeffect"
|
|
|
|
"decltype"
|
|
|
|
"forceinline"
|
|
|
|
"nocallersavedregisters"
|
Import C++ Standard Template Library
You can now use the hardest fastest and most dangerous language there is
with Cosmopolitan. So far about 75% of LLVM libcxx has been added. A few
breaking changes needed to be made to help this go smoothly.
- Rename nothrow to dontthrow
- Rename nodiscard to dontdiscard
- Add some libm functions, e.g. lgamma, nan, etc.
- Change intmax_t from int128 to int64 like everything else
- Introduce %jjd formatting directive for int128_t
- Introduce strtoi128(), strtou128(), etc.
- Rename bsrmax() to bsr128()
Some of the templates that should be working currently are std::vector,
std::string, std::map, std::set, std::deque, etc.
2022-03-22 12:51:41 +00:00
|
|
|
"dontthrow"
|
2023-06-03 15:12:13 +00:00
|
|
|
"dontoptimize"
|
2020-06-15 14:18:57 +00:00
|
|
|
"optimizesize"
|
|
|
|
"optimizespeed"
|
|
|
|
"alignof"
|
|
|
|
"relegated"
|
|
|
|
"antiquity"
|
|
|
|
"memcpyesque"
|
|
|
|
"libcesque"
|
2023-06-09 13:41:34 +00:00
|
|
|
"unrollloops"
|
|
|
|
"__artificial"
|
2020-06-15 14:18:57 +00:00
|
|
|
"returnstwice"
|
|
|
|
"returnsaligned"
|
|
|
|
"noprune"
|
|
|
|
"reallocesque"
|
|
|
|
"nullterminated"
|
2022-09-04 03:35:31 +00:00
|
|
|
"notpossible"
|
2020-06-15 14:18:57 +00:00
|
|
|
"privileged"
|
|
|
|
"hasatleast"
|
|
|
|
"nodebuginfo"
|
2020-12-05 20:20:41 +00:00
|
|
|
"wontreturn"
|
2023-07-26 20:54:49 +00:00
|
|
|
"dontubsan"
|
2023-02-13 06:16:34 +00:00
|
|
|
"nostackprotector"
|
2020-06-15 14:18:57 +00:00
|
|
|
"mayalias"
|
2023-06-09 13:41:34 +00:00
|
|
|
"dontinstrument"
|
2020-06-15 14:18:57 +00:00
|
|
|
"interruptfn"
|
2024-02-01 11:39:46 +00:00
|
|
|
"dontcallback"
|
2020-06-15 14:18:57 +00:00
|
|
|
"textstartup"
|
|
|
|
"warnifused"
|
|
|
|
"attributeallocsize"
|
|
|
|
"attributeallocalign"
|
2023-09-06 10:54:42 +00:00
|
|
|
"__wur"
|
2020-06-15 14:18:57 +00:00
|
|
|
"nointerpose"
|
|
|
|
"returnsnonnull"
|
|
|
|
"strftimeesque"
|
|
|
|
"firstclass"
|
|
|
|
"preinitarray"
|
|
|
|
"scanfesque"
|
|
|
|
"pureconst"
|
|
|
|
"thatispacked"
|
|
|
|
"strlenesque"
|
|
|
|
"textwindows"
|
2020-12-05 20:20:41 +00:00
|
|
|
"forcealign"
|
2020-06-15 14:18:57 +00:00
|
|
|
"typeof"
|
|
|
|
"textreal"
|
2021-02-24 04:23:19 +00:00
|
|
|
"texthead"
|
2020-06-15 14:18:57 +00:00
|
|
|
"autotype"
|
|
|
|
"_Section"
|
|
|
|
"_Vector_size"))
|
|
|
|
|
|
|
|
(gnu
|
2022-05-18 23:41:29 +00:00
|
|
|
'("__extension__"
|
|
|
|
"__inline"
|
2020-08-25 11:23:25 +00:00
|
|
|
"__thread"
|
2020-06-15 14:18:57 +00:00
|
|
|
"__alignof"
|
|
|
|
"__typeof"
|
|
|
|
"__restrict"
|
|
|
|
"__const__"
|
|
|
|
"__label__"
|
|
|
|
"__noinline__"
|
|
|
|
"__noclone__"
|
|
|
|
"__force_align_arg_pointer__"
|
|
|
|
"__always_inline__"
|
|
|
|
"__gnu_inline__"
|
|
|
|
"__alignof__"
|
|
|
|
"__asm__"
|
|
|
|
"__attribute__"
|
|
|
|
"__auto_type"
|
|
|
|
"__byte__"
|
|
|
|
"__complex__"
|
|
|
|
"__imag__"
|
|
|
|
"__may_alias__"
|
|
|
|
"__noreturn__"
|
|
|
|
"__packed__"
|
|
|
|
"__pointer__"
|
|
|
|
"__printf__"
|
|
|
|
"__real__"
|
|
|
|
"__restrict__"
|
|
|
|
"__scanf__"
|
|
|
|
"__strfmon__"
|
|
|
|
"__strftime__"
|
|
|
|
"__strong__"
|
|
|
|
"__target__"
|
|
|
|
"__transparent_union__"
|
|
|
|
"__typeof__"
|
|
|
|
"__volatile__"
|
|
|
|
"__word__"
|
|
|
|
"__alias__"
|
|
|
|
"__aligned__"
|
|
|
|
"__alloc_align__"
|
|
|
|
"__alloc_size__"
|
2020-12-09 12:00:48 +00:00
|
|
|
"__warn_if_not_aligned__"
|
2020-06-15 14:18:57 +00:00
|
|
|
"__artificial__"
|
|
|
|
"__assume_aligned__"
|
|
|
|
"__cold__"
|
|
|
|
"__constructor__"
|
|
|
|
"__destructor__"
|
|
|
|
"__copy__"
|
|
|
|
"__deprecated__"
|
|
|
|
"__error__"
|
|
|
|
"__warning__"
|
|
|
|
"__externally_visible__"
|
|
|
|
"__flatten__"
|
|
|
|
"__format__"
|
|
|
|
"__gnu_format__"
|
|
|
|
"__gnu_printf__"
|
|
|
|
"__gnu_scanf__"
|
|
|
|
"__format_arg__"
|
|
|
|
"__hot__"
|
|
|
|
"__ifunc__"
|
|
|
|
"__interrupt__"
|
|
|
|
"__interrupt_handler__"
|
|
|
|
"__leaf__"
|
|
|
|
"__no_caller_saved_registers__"
|
|
|
|
"__malloc__"
|
|
|
|
"__no_icf__"
|
|
|
|
"__no_instrument_function__"
|
|
|
|
"__no_profile_instrument_function__"
|
|
|
|
"__no_reorder__"
|
|
|
|
"__no_sanitize__"
|
|
|
|
"__no_sanitize_address__"
|
|
|
|
"__no_address_safety_analysis__"
|
|
|
|
"__no_sanitize_thread__"
|
2022-12-11 22:30:50 +00:00
|
|
|
"__no_stack_protector__"
|
2020-06-15 14:18:57 +00:00
|
|
|
"__leaf__"
|
|
|
|
"__no_sanitize_undefined__"
|
|
|
|
"__no_split_stack__"
|
|
|
|
"__no_stack_limit__"
|
|
|
|
"__noclone__"
|
|
|
|
"__noipa__"
|
|
|
|
"__nonnull__"
|
|
|
|
"__noplt__"
|
|
|
|
"__nothrow__"
|
|
|
|
"__optimize__"
|
|
|
|
"__pure__"
|
|
|
|
"__patchable_function_entry__"
|
|
|
|
"__returns_nonnull__"
|
|
|
|
"__returns_twice__"
|
|
|
|
"__section__"
|
|
|
|
"__sentinel__"
|
|
|
|
"__simd__"
|
2024-02-01 11:39:46 +00:00
|
|
|
"__vex"
|
|
|
|
"__avx2"
|
|
|
|
"__target_clones"
|
2020-06-15 14:18:57 +00:00
|
|
|
"__target_clones__"
|
|
|
|
"__unused__"
|
|
|
|
"__used__"
|
|
|
|
"__visibility__"
|
|
|
|
"__warn_unused_result__"
|
|
|
|
"__params_nonnull__"
|
|
|
|
"__weak__"
|
|
|
|
"__vector_size__"
|
2020-08-31 12:17:31 +00:00
|
|
|
"__ms_abi__"
|
2023-01-18 08:56:09 +00:00
|
|
|
"__sysv_abi__"
|
2022-03-16 20:33:13 +00:00
|
|
|
"__mode__"
|
|
|
|
"__seg_fs"
|
|
|
|
"__seg_gs"))
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
|
|
(clang
|
|
|
|
'("__optnone__"
|
2022-12-11 22:30:50 +00:00
|
|
|
"__nodebug__"
|
|
|
|
"musttail"
|
|
|
|
"__musttail__"))
|
2020-06-15 14:18:57 +00:00
|
|
|
|
|
|
|
)
|
|
|
|
(concat "\\_<"
|
2022-03-16 20:33:13 +00:00
|
|
|
(regexp-opt (append
|
2023-12-15 03:55:56 +00:00
|
|
|
cuda
|
2020-06-15 14:18:57 +00:00
|
|
|
c11
|
|
|
|
gnu
|
|
|
|
clang
|
|
|
|
cosmo))
|
|
|
|
"\\_>")))
|
|
|
|
|
|
|
|
(provide 'cosmo-c-keywords)
|