| author | |
| committer | |
| log | 1184b1d560c6a86b79bbda072478320431e09189 |
| tree | d2fe7ef895ddca513cfdda066ebc66b87bdf88f8 |
| parent | 2242d3c3aa7d15c13737ae124f78a8261693100b |
2 files changed, 6 insertions(+), 0 deletions(-)
src/stage1/analyze.cpp+5| ... | @@ -6291,6 +6291,11 @@ ZigValue *create_const_str_lit(CodeGen *g, Buf *str) { | ... | @@ -6291,6 +6291,11 @@ ZigValue *create_const_str_lit(CodeGen *g, Buf *str) { |
| 6291 | return const_val; | 6291 | return const_val; |
| 6292 | } | 6292 | } |
| 6293 | 6293 | ||
| 6294 | ZigValue *create_sentineled_str_lit(CodeGen *g, Buf *str, ZigValue *sentinel) { | ||
| 6295 | ZigValue *array_val = create_const_str_lit(g, str)->data.x_ptr.data.ref.pointee; | ||
| 6296 | return create_const_slice(g, array_val, 0, buf_len(str), true, sentinel); | ||
| 6297 | } | ||
| 6298 | |||
| 6294 | void init_const_bigint(ZigValue *const_val, ZigType *type, const BigInt *bigint) { | 6299 | void init_const_bigint(ZigValue *const_val, ZigType *type, const BigInt *bigint) { |
| 6295 | const_val->special = ConstValSpecialStatic; | 6300 | const_val->special = ConstValSpecialStatic; |
| 6296 | const_val->type = type; | 6301 | const_val->type = type; |
src/stage1/analyze.hpp+1| ... | @@ -144,6 +144,7 @@ ScopeExpr *create_expr_scope(CodeGen *g, AstNode *node, Scope *parent); | ... | @@ -144,6 +144,7 @@ ScopeExpr *create_expr_scope(CodeGen *g, AstNode *node, Scope *parent); |
| 144 | 144 | ||
| 145 | void init_const_str_lit(CodeGen *g, ZigValue *const_val, Buf *str, bool move_str); | 145 | void init_const_str_lit(CodeGen *g, ZigValue *const_val, Buf *str, bool move_str); |
| 146 | ZigValue *create_const_str_lit(CodeGen *g, Buf *str); | 146 | ZigValue *create_const_str_lit(CodeGen *g, Buf *str); |
| 147 | ZigValue *create_sentineled_str_lit(CodeGen *g, Buf *str, ZigValue *sentinel); | ||
| 147 | 148 | ||
| 148 | void init_const_bigint(ZigValue *const_val, ZigType *type, const BigInt *bigint); | 149 | void init_const_bigint(ZigValue *const_val, ZigType *type, const BigInt *bigint); |
| 149 | ZigValue *create_const_bigint(CodeGen *g, ZigType *type, const BigInt *bigint); | 150 | ZigValue *create_const_bigint(CodeGen *g, ZigType *type, const BigInt *bigint); |