aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-03-01 17:15:58 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-03-01 17:15:58 -0500
commit5f7d9c58458b8c6a675f747f811c54ab4e4f60c2 (patch)
tree94f2705efb79ed9d5670acb48b66bc97d7886bc6 /src/codegen.cpp
parenta7ddcabb5034f4fef90d266263611f6cfbe04f41 (diff)
downloadzig-5f7d9c58458b8c6a675f747f811c54ab4e4f60c2.tar.gz
zig-5f7d9c58458b8c6a675f747f811c54ab4e4f60c2.zip
@typeInfo for structs and opaque types is the bare name
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 1bf4f2ee54..b6a819ca2f 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -7123,7 +7123,8 @@ static void define_builtin_types(CodeGen *g) {
g->builtin_types.entry_i64 = get_int_type(g, true, 64);
{
- g->builtin_types.entry_c_void = get_opaque_type(g, nullptr, nullptr, "c_void");
+ g->builtin_types.entry_c_void = get_opaque_type(g, nullptr, nullptr, "c_void",
+ buf_create_from_str("c_void"));
g->primitive_type_table.put(&g->builtin_types.entry_c_void->name, g->builtin_types.entry_c_void);
}
@@ -7943,19 +7944,18 @@ void codegen_translate_c(CodeGen *g, Buf *full_path) {
Buf noextname = BUF_INIT;
os_path_extname(src_basename, &noextname, nullptr);
+ detect_libc(g);
+
+ init(g);
+
RootStruct *root_struct = allocate<RootStruct>(1);
root_struct->source_code = nullptr;
root_struct->path = full_path;
root_struct->di_file = ZigLLVMCreateFile(g->dbuilder, buf_ptr(src_basename), buf_ptr(src_dirname));
- ZigType *import = get_root_container_type(g, buf_ptr(&noextname), root_struct);
+ ZigType *import = get_root_container_type(g, buf_ptr(&noextname), &noextname, root_struct);
g->root_import = import;
- detect_libc(g);
-
- init(g);
-
-
ZigList<ErrorMsg *> errors = {0};
Error err = parse_h_file(import, &errors, buf_ptr(full_path), g, nullptr);