xxx
This commit is contained in:
@@ -6333,8 +6333,11 @@ pub const CodeGen = struct {
|
||||
return entry.ptr;
|
||||
}
|
||||
}
|
||||
// Non-identifier expressions (e.g. field access, tuple element):
|
||||
// generate value, store into temp alloca, return alloca pointer
|
||||
// Field access / index: take address of the lvalue directly (no copy)
|
||||
if (node.data == .field_access or node.data == .index_expr) {
|
||||
return try self.genAddressOf(node);
|
||||
}
|
||||
// Other non-identifier expressions: copy into temp alloca
|
||||
if (node.data != .identifier) {
|
||||
const val = try self.genExpr(node);
|
||||
const llvm_ty = c.LLVMTypeOf(val);
|
||||
@@ -10459,8 +10462,8 @@ pub const CodeGen = struct {
|
||||
null;
|
||||
|
||||
const i64_type = self.i64Type();
|
||||
// Enum/union case constants use the backing type; bool uses i1; others use i64
|
||||
const case_int_type = if (enum_name) |en| self.getEnumLLVMType(en) else if (union_name) |un| self.getEnumLLVMType(un) else if (subject_ty == .boolean) self.i1Type() else i64_type;
|
||||
// Enum/union case constants use the backing type; bool uses i1; others must match subject LLVM type
|
||||
const case_int_type = if (enum_name) |en| self.getEnumLLVMType(en) else if (union_name) |un| self.getEnumLLVMType(un) else if (subject_ty == .boolean) self.i1Type() else c.LLVMTypeOf(subject_val);
|
||||
const merge_bb = self.appendBB("match_end");
|
||||
|
||||
// Create case basic blocks
|
||||
|
||||
Reference in New Issue
Block a user