mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
Add create_sentineled_str_lit
This commit is contained in:
parent
2242d3c3aa
commit
1184b1d560
@ -6291,6 +6291,11 @@ ZigValue *create_const_str_lit(CodeGen *g, Buf *str) {
|
||||
return const_val;
|
||||
}
|
||||
|
||||
ZigValue *create_sentineled_str_lit(CodeGen *g, Buf *str, ZigValue *sentinel) {
|
||||
ZigValue *array_val = create_const_str_lit(g, str)->data.x_ptr.data.ref.pointee;
|
||||
return create_const_slice(g, array_val, 0, buf_len(str), true, sentinel);
|
||||
}
|
||||
|
||||
void init_const_bigint(ZigValue *const_val, ZigType *type, const BigInt *bigint) {
|
||||
const_val->special = ConstValSpecialStatic;
|
||||
const_val->type = type;
|
||||
|
||||
@ -144,6 +144,7 @@ ScopeExpr *create_expr_scope(CodeGen *g, AstNode *node, Scope *parent);
|
||||
|
||||
void init_const_str_lit(CodeGen *g, ZigValue *const_val, Buf *str, bool move_str);
|
||||
ZigValue *create_const_str_lit(CodeGen *g, Buf *str);
|
||||
ZigValue *create_sentineled_str_lit(CodeGen *g, Buf *str, ZigValue *sentinel);
|
||||
|
||||
void init_const_bigint(ZigValue *const_val, ZigType *type, const BigInt *bigint);
|
||||
ZigValue *create_const_bigint(CodeGen *g, ZigType *type, const BigInt *bigint);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user