From 5f7d9c58458b8c6a675f747f811c54ab4e4f60c2 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 1 Mar 2019 17:15:58 -0500 Subject: @typeInfo for structs and opaque types is the bare name --- src/codegen.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/codegen.cpp') 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(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 errors = {0}; Error err = parse_h_file(import, &errors, buf_ptr(full_path), g, nullptr); -- cgit v1.2.3