diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-20 12:38:05 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-20 12:38:05 +0100 |
| commit | 5957d7f7bee7e5fac4035d47ecaaaad022adbfb8 (patch) | |
| tree | f8f38496e6691d4d5ea4317d7b7ae3811ab7e4c0 /src/parser.cpp | |
| parent | 35c102137f9a097584bf1af39e9809064293a0a3 (diff) | |
Implicit Parameter Passing based `context` system (replacing Thread Local Storage (TLS) approach)
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index d09db81d2..1b1bfcdaf 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -91,11 +91,12 @@ enum ProcTag { }; enum ProcCallingConvention { - ProcCC_Invalid = 0, - ProcCC_Odin = 1, - ProcCC_C = 2, - ProcCC_Std = 3, - ProcCC_Fast = 4, + ProcCC_Invalid = 0, + ProcCC_Odin = 1, + ProcCC_Contextless = 2, + ProcCC_C = 3, + ProcCC_Std = 4, + ProcCC_Fast = 5, }; enum VarDeclFlag { @@ -2070,14 +2071,18 @@ void parse_proc_tags(AstFile *f, u64 *tags, String *link_name, ProcCallingConven ELSE_IF_ADD_TAG(no_bounds_check) ELSE_IF_ADD_TAG(inline) ELSE_IF_ADD_TAG(no_inline) - // ELSE_IF_ADD_TAG(dll_import) - // ELSE_IF_ADD_TAG(dll_export) else if (tag_name == "cc_odin") { if (cc == ProcCC_Invalid) { cc = ProcCC_Odin; } else { syntax_error(tag_expr, "Multiple calling conventions for procedure type"); } + } else if (tag_name == "cc_contextless") { + if (cc == ProcCC_Invalid) { + cc = ProcCC_Contextless; + } else { + syntax_error(tag_expr, "Multiple calling conventions for procedure type"); + } } else if (tag_name == "cc_c") { if (cc == ProcCC_Invalid) { cc = ProcCC_C; |