stage2: fix AstGen for some struct syntaxes
* AstGen: fix not emitting `struct_init_empty` when an explicit type is
present in struct initialization syntax.
* AstGen: these two syntaxes now lower to identical ZIR:
- `var a = A{ .b = c };`
- `var a = @as(A, .{ .b = c });`
* Zir: clarify `auto_enum_tag` in the doc comments.
* LLVM Backend: fix lowering of function return types when the type has
0 bits.
This commit is contained in:
@@ -563,8 +563,13 @@ pub const DeclGen = struct {
|
||||
}
|
||||
}
|
||||
|
||||
const llvm_ret_ty = if (!return_type.hasCodeGenBits())
|
||||
self.context.voidType()
|
||||
else
|
||||
try self.llvmType(return_type);
|
||||
|
||||
const fn_type = llvm.functionType(
|
||||
try self.llvmType(return_type),
|
||||
llvm_ret_ty,
|
||||
llvm_param_buffer.ptr,
|
||||
llvm_params_len,
|
||||
.False,
|
||||
|
||||
Reference in New Issue
Block a user