diff options
| author | gingerBill <bill@gingerbill.org> | 2021-10-03 11:53:32 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-10-03 11:53:32 +0100 |
| commit | 2bdae52fed2ac0845ebb24348f3834dbc63f6d34 (patch) | |
| tree | 02b05813607d403681bbf41443eafcaa510e430b /src/checker.hpp | |
| parent | b3a66b3950283853ce99a7da71ad8f1850fba0d8 (diff) | |
Add @(init) attribute for procedures, allowing for procedures to be called at startup
These procedures will be called after global variables have been initialized as normal
Diffstat (limited to 'src/checker.hpp')
| -rw-r--r-- | src/checker.hpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/checker.hpp b/src/checker.hpp index 1b2ad0575..97631c547 100644 --- a/src/checker.hpp +++ b/src/checker.hpp @@ -99,14 +99,6 @@ struct DeferredProcedure { struct AttributeContext { - bool is_export; - bool is_static; - bool require_results; - bool require_declaration; - bool has_disabled_proc; - bool disabled_proc; - bool test; - bool set_cold; String link_name; String link_prefix; String link_section; @@ -115,6 +107,15 @@ struct AttributeContext { String deprecated_message; String warning_message; DeferredProcedure deferred_procedure; + bool is_export : 1; + bool is_static : 1; + bool require_results : 1; + bool require_declaration : 1; + bool has_disabled_proc : 1; + bool disabled_proc : 1; + bool test : 1; + bool init : 1; + bool set_cold : 1; u32 optimization_mode; // ProcedureOptimizationMode }; @@ -284,6 +285,7 @@ struct CheckerInfo { Array<Entity *> testing_procedures; + Array<Entity *> init_procedures; Array<Entity *> definitions; Array<Entity *> entities; |