diff options
| author | gingerBill <bill@gingerbill.org> | 2023-07-19 13:37:56 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-07-19 13:37:56 +0100 |
| commit | 73f25ed182288eb311abc75cc4b69f1421bfd94a (patch) | |
| tree | 26ebf349c9f66ba3e0b61aac69c8fe7f4ed11696 /src/tilde_const.cpp | |
| parent | 533f6a552cc319b700061f61f9472c6d41cda46c (diff) | |
Add basic `switch` statement
Implement as naive if-else chain
Diffstat (limited to 'src/tilde_const.cpp')
| -rw-r--r-- | src/tilde_const.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tilde_const.cpp b/src/tilde_const.cpp index 75b66567e..7f6de50c7 100644 --- a/src/tilde_const.cpp +++ b/src/tilde_const.cpp @@ -123,3 +123,6 @@ gb_internal cgValue cg_const_value(cgProcedure *p, Type *type, ExactValue const gb_internal cgValue cg_const_int(cgProcedure *p, Type *type, i64 i) { return cg_const_value(p, type, exact_value_i64(i)); } +gb_internal cgValue cg_const_bool(cgProcedure *p, Type *type, bool v) { + return cg_value(tb_inst_bool(p->func, v), type); +} |