2023-08-28 23:46:50 -04:00
|
|
|
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
2023-08-21 20:30:13 -04:00
|
|
|
#pragma once
|
2023-08-21 23:02:20 -04:00
|
|
|
#include "gen.hpp"
|
2023-08-28 23:46:50 -04:00
|
|
|
#endif
|
2023-08-21 20:30:13 -04:00
|
|
|
|
2023-07-24 17:45:27 -04:00
|
|
|
#pragma region StaticData
|
2023-07-28 21:44:31 -04:00
|
|
|
|
2023-07-24 17:45:27 -04:00
|
|
|
// TODO : Convert global allocation strategy to use a slab allocation strategy.
|
|
|
|
global AllocatorInfo GlobalAllocator;
|
|
|
|
global Array<Arena> Global_AllocatorBuckets;
|
|
|
|
|
2023-11-22 14:23:21 -05:00
|
|
|
// TODO(Ed) : Make the code pool a dynamic arena
|
2023-07-24 17:45:27 -04:00
|
|
|
global Array< Pool > CodePools = { nullptr };
|
|
|
|
global Array< Arena > StringArenas = { nullptr };
|
|
|
|
|
|
|
|
global StringTable StringCache;
|
|
|
|
|
|
|
|
global Arena LexArena;
|
|
|
|
|
2023-07-24 20:59:20 -04:00
|
|
|
global AllocatorInfo Allocator_DataArrays = heap();
|
|
|
|
global AllocatorInfo Allocator_CodePool = heap();
|
|
|
|
global AllocatorInfo Allocator_Lexer = heap();
|
|
|
|
global AllocatorInfo Allocator_StringArena = heap();
|
|
|
|
global AllocatorInfo Allocator_StringTable = heap();
|
|
|
|
global AllocatorInfo Allocator_TypeTable = heap();
|
2023-07-28 21:44:31 -04:00
|
|
|
|
2023-07-24 17:45:27 -04:00
|
|
|
#pragma endregion StaticData
|
|
|
|
|
|
|
|
#pragma region Constants
|
2023-07-28 21:44:31 -04:00
|
|
|
|
2023-07-30 01:21:04 -04:00
|
|
|
global Code access_public;
|
|
|
|
global Code access_protected;
|
|
|
|
global Code access_private;
|
|
|
|
|
|
|
|
global CodeAttributes attrib_api_export;
|
|
|
|
global CodeAttributes attrib_api_import;
|
|
|
|
|
|
|
|
global Code module_global_fragment;
|
|
|
|
global Code module_private_fragment;
|
|
|
|
|
2023-08-04 16:12:13 -04:00
|
|
|
global Code fmt_newline;
|
|
|
|
|
2023-07-30 01:21:04 -04:00
|
|
|
global CodeParam param_varadic;
|
|
|
|
|
|
|
|
global CodePragma pragma_once;
|
|
|
|
|
|
|
|
global CodePreprocessCond preprocess_else;
|
|
|
|
global CodePreprocessCond preprocess_endif;
|
|
|
|
|
|
|
|
global CodeSpecifiers spec_const;
|
|
|
|
global CodeSpecifiers spec_consteval;
|
|
|
|
global CodeSpecifiers spec_constexpr;
|
|
|
|
global CodeSpecifiers spec_constinit;
|
|
|
|
global CodeSpecifiers spec_extern_linkage;
|
|
|
|
global CodeSpecifiers spec_final;
|
2023-08-21 21:40:23 -04:00
|
|
|
global CodeSpecifiers spec_forceinline;
|
2023-07-30 01:21:04 -04:00
|
|
|
global CodeSpecifiers spec_global;
|
|
|
|
global CodeSpecifiers spec_inline;
|
|
|
|
global CodeSpecifiers spec_internal_linkage;
|
|
|
|
global CodeSpecifiers spec_local_persist;
|
|
|
|
global CodeSpecifiers spec_mutable;
|
2023-09-11 23:22:53 -04:00
|
|
|
global CodeSpecifiers spec_noexcept;
|
2023-08-02 12:39:35 -04:00
|
|
|
global CodeSpecifiers spec_neverinline;
|
2023-07-30 01:21:04 -04:00
|
|
|
global CodeSpecifiers spec_override;
|
|
|
|
global CodeSpecifiers spec_ptr;
|
2023-08-07 03:10:45 -04:00
|
|
|
global CodeSpecifiers spec_pure;
|
2023-07-30 01:21:04 -04:00
|
|
|
global CodeSpecifiers spec_ref;
|
|
|
|
global CodeSpecifiers spec_register;
|
|
|
|
global CodeSpecifiers spec_rvalue;
|
|
|
|
global CodeSpecifiers spec_static_member;
|
|
|
|
global CodeSpecifiers spec_thread_local;
|
|
|
|
global CodeSpecifiers spec_virtual;
|
|
|
|
global CodeSpecifiers spec_volatile;
|
|
|
|
|
2024-12-03 15:19:39 -05:00
|
|
|
global CodeTypename t_empty;
|
|
|
|
global CodeTypename t_auto;
|
|
|
|
global CodeTypename t_void;
|
|
|
|
global CodeTypename t_int;
|
|
|
|
global CodeTypename t_bool;
|
|
|
|
global CodeTypename t_char;
|
|
|
|
global CodeTypename t_wchar_t;
|
|
|
|
global CodeTypename t_class;
|
|
|
|
global CodeTypename t_typename;
|
2023-07-24 17:45:27 -04:00
|
|
|
|
2024-12-04 15:00:37 -05:00
|
|
|
global Array(StringCached) PreprocessorDefines;
|
2023-11-21 20:09:14 -05:00
|
|
|
|
2023-07-24 17:45:27 -04:00
|
|
|
#ifdef GEN_DEFINE_LIBRARY_CODE_CONSTANTS
|
2024-12-03 15:19:39 -05:00
|
|
|
global CodeTypename t_b32;
|
2023-07-24 17:45:27 -04:00
|
|
|
|
2024-12-03 15:19:39 -05:00
|
|
|
global CodeTypename t_s8;
|
|
|
|
global CodeTypename t_s16;
|
|
|
|
global CodeTypename t_s32;
|
|
|
|
global CodeTypename t_s64;
|
2023-07-24 17:45:27 -04:00
|
|
|
|
2024-12-03 15:19:39 -05:00
|
|
|
global CodeTypename t_u8;
|
|
|
|
global CodeTypename t_u16;
|
|
|
|
global CodeTypename t_u32;
|
|
|
|
global CodeTypename t_u64;
|
2023-07-24 17:45:27 -04:00
|
|
|
|
2024-12-03 15:19:39 -05:00
|
|
|
global CodeTypename t_ssize;
|
|
|
|
global CodeTypename t_usize;
|
2023-07-24 17:45:27 -04:00
|
|
|
|
2024-12-03 15:19:39 -05:00
|
|
|
global CodeTypename t_f32;
|
|
|
|
global CodeTypename t_f64;
|
2023-07-24 17:45:27 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#pragma endregion Constants
|