diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-12-31 16:55:41 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-12-31 16:55:41 -0500 |
| commit | 39ee3bc0ecdfde43e6fa98ee454a0115b3cb7390 (patch) | |
| tree | fbf0005f5e8840006d6ce7c6bde29cd050dd42fe /src/ir.cpp | |
| parent | c8c65b0168ae18f8bd8bf8f38590109a30df73a8 (diff) | |
| parent | 950eb81304dedc01ef1500dd2da1458694306b00 (diff) | |
| download | zig-39ee3bc0ecdfde43e6fa98ee454a0115b3cb7390.tar.gz zig-39ee3bc0ecdfde43e6fa98ee454a0115b3cb7390.zip | |
Merge branch 'stage-2-cimport' of https://github.com/Vexu/zig into Vexu-stage-2-cimport
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 7cc1829341..e52f4fbbe0 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -13,7 +13,6 @@ #include "os.hpp" #include "range_set.hpp" #include "softfloat.hpp" -#include "translate_c.hpp" #include "util.hpp" #include <errno.h> @@ -23758,14 +23757,14 @@ static IrInstruction *ir_analyze_instruction_c_import(IrAnalyze *ira, IrInstruct clang_argv.append(nullptr); // to make the [start...end] argument work - AstNode *root_node; Stage2ErrorMsg *errors_ptr; size_t errors_len; + Stage2Ast *ast; const char *resources_path = buf_ptr(ira->codegen->zig_c_headers_dir); - if ((err = parse_h_file(ira->codegen, &root_node, &errors_ptr, &errors_len, - &clang_argv.at(0), &clang_argv.last(), TranslateModeImport, resources_path))) + if ((err = stage2_translate_c(&ast, &errors_ptr, &errors_len, + &clang_argv.at(0), &clang_argv.last(), resources_path))) { if (err != ErrorCCompileErrors) { ir_add_error_node(ira, node, buf_sprintf("C import failed: %s", err_str(err))); @@ -23816,7 +23815,7 @@ static IrInstruction *ir_analyze_instruction_c_import(IrAnalyze *ira, IrInstruct buf_sprintf("C import failed: unable to open output file: %s", strerror(errno))); return ira->codegen->invalid_instruction; } - ast_render(out_file, root_node, 4); + stage2_render_ast(ast, out_file); if (fclose(out_file) != 0) { ir_add_error_node(ira, node, buf_sprintf("C import failed: unable to write to output file: %s", strerror(errno))); |
