the same string literal codegens to the same constant

this makes it so that you can send the same string literal
as a comptime slice and get the same type
This commit is contained in:
Andrew Kelley
2018-01-11 20:58:28 -05:00
parent 465e75bc5a
commit 3268276b58
6 changed files with 31 additions and 5 deletions

View File

@@ -87,6 +87,7 @@ CodeGen *codegen_create(Buf *root_src_path, const ZigTarget *target, OutType out
g->memoized_fn_eval_table.init(16);
g->exported_symbol_names.init(8);
g->external_prototypes.init(8);
g->string_literals_table.init(16);
g->is_test_build = false;
g->want_h_file = (out_type == OutTypeObj || out_type == OutTypeLib);
buf_resize(&g->global_asm, 0);