diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-02-25 14:03:36 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-02-25 14:03:36 -0500 |
| commit | 0d4db8828a9efc05b5c3622098a8337de0b62d1e (patch) | |
| tree | f87768be86d630511e694ebd09173057c7b88a58 /src/ir.cpp | |
| parent | 525c2eaf5d49f537d4ccd48ab0c5bc1f52cc3204 (diff) | |
| download | zig-0d4db8828a9efc05b5c3622098a8337de0b62d1e.tar.gz zig-0d4db8828a9efc05b5c3622098a8337de0b62d1e.zip | |
`@cImport` works with `--cache on`
We pass -MD -MF args to clang when doing `@cImport`, which
gives us a complete list of files that the C code read from.
Then we add these to the cache. So even when using `@cImport`
Zig's caching system remains perfect. This is a proof of concept
for the mechanism that the self-hosted compiler will use to
watch and rebuild files.
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index ea2fcb289f..929f195586 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -18670,12 +18670,6 @@ static IrInstruction *ir_analyze_instruction_type_name(IrAnalyze *ira, IrInstruc } static IrInstruction *ir_analyze_instruction_c_import(IrAnalyze *ira, IrInstructionCImport *instruction) { - if (ira->codegen->enable_cache) { - ir_add_error(ira, &instruction->base, - buf_sprintf("TODO @cImport is incompatible with --cache on. The cache system currently is unable to detect subsequent changes in .h files.")); - return ira->codegen->invalid_instruction; - } - AstNode *node = instruction->base.source_node; assert(node->type == NodeTypeFnCallExpr); AstNode *block_node = node->data.fn_call_expr.params.at(0); |
