aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-06-06 00:39:39 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-06-06 00:39:39 -0400
commitd3693dca73dfc726aed32908691437abe614e5cf (patch)
tree167e2d8c24c6a653f05723716b796949a0eb5585 /src/codegen.cpp
parent76c8efd56c84c189a52d3dc559fff109d5d34ce4 (diff)
downloadzig-d3693dca73dfc726aed32908691437abe614e5cf.tar.gz
zig-d3693dca73dfc726aed32908691437abe614e5cf.zip
Pointer Reform: update @typeInfo
* add assertion for trying to do @typeInfo on global error set * remove TypeInfo.Slice * add TypeInfo.Pointer.Size with possible values - One - Many - Slice See #770
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index a977c34daf..7f95f335d1 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -6481,7 +6481,6 @@ static void define_builtin_compile_vars(CodeGen *g) {
const TypeTableEntryId id = type_id_at_index(i);
buf_appendf(contents, " %s,\n", type_id_name(id));
}
- buf_appendf(contents, " Slice,\n");
buf_appendf(contents, "};\n\n");
}
{
@@ -6494,7 +6493,6 @@ static void define_builtin_compile_vars(CodeGen *g) {
" Int: Int,\n"
" Float: Float,\n"
" Pointer: Pointer,\n"
- " Slice: Slice,\n"
" Array: Array,\n"
" Struct: Struct,\n"
" ComptimeFloat: void,\n"
@@ -6524,13 +6522,18 @@ static void define_builtin_compile_vars(CodeGen *g) {
" };\n"
"\n"
" pub const Pointer = struct {\n"
+ " size: Size,\n"
" is_const: bool,\n"
" is_volatile: bool,\n"
" alignment: u32,\n"
" child: type,\n"
- " };\n"
"\n"
- " pub const Slice = Pointer;\n"
+ " pub const Size = enum {\n"
+ " One,\n"
+ " Many,\n"
+ " Slice,\n"
+ " };\n"
+ " };\n"
"\n"
" pub const Array = struct {\n"
" len: usize,\n"