From efe94a9a1289db274be326d6d66a19caeee86d33 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 6 Jan 2021 16:47:09 -0700 Subject: stage2: C backend: support unused Decls --- src/Compilation.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index 4efb845a82..8e2da5aec4 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -527,6 +527,10 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { if (options.root_pkg == null) break :blk false; + // If we are outputting .c code we must use Zig backend. + if (ofmt == .c) + break :blk false; + // If we are the stage1 compiler, we depend on the stage1 c++ llvm backend // to compile zig code. if (build_options.is_stage1) -- cgit v1.2.3