Pass 'struct_assignment'
This commit is contained in:
parent
6e7949e9bd
commit
b3e2771d11
@ -11744,16 +11744,33 @@ emit_assignment = fn (module: &Module, left_llvm: &LLVMValue, left_type: &Type,
|
|||||||
if (is_constant)
|
if (is_constant)
|
||||||
{
|
{
|
||||||
emit_value(module, right, .memory, 1);
|
emit_value(module, right, .memory, 1);
|
||||||
|
|
||||||
>linkage: LLVMLinkage = .internal;
|
>linkage: LLVMLinkage = .internal;
|
||||||
>thread_local_mode: LLVMThreadLocalMode = .none;
|
>thread_local_mode: LLVMThreadLocalMode = .none;
|
||||||
>externally_initialized: u1 = 0;
|
>externally_initialized: u1 = 0;
|
||||||
>unnamed_address: LLVMUnnamedAddress = .global;
|
>unnamed_address: LLVMUnnamedAddress = .global;
|
||||||
|
|
||||||
>global = llvm_create_global_variable(module.llvm.module, value_type.llvm.memory, is_constant, linkage, right.llvm, "const.aggregate", thread_local_mode, externally_initialized, alignment, unnamed_address);
|
>global = llvm_create_global_variable(module.llvm.module, value_type.llvm.memory, is_constant, linkage, right.llvm, "const.aggregate", thread_local_mode, externally_initialized, alignment, unnamed_address);
|
||||||
|
|
||||||
LLVMBuildMemCpy(module.llvm.builder, left_llvm, alignment, global, alignment, byte_size_value);
|
LLVMBuildMemCpy(module.llvm.builder, left_llvm, alignment, global, alignment, byte_size_value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#trap();
|
switch (resolved_value_type.id)
|
||||||
|
{
|
||||||
|
.struct =>
|
||||||
|
{
|
||||||
|
#trap();
|
||||||
|
},
|
||||||
|
.union =>
|
||||||
|
{
|
||||||
|
#trap();
|
||||||
|
},
|
||||||
|
else =>
|
||||||
|
{
|
||||||
|
#trap();
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
.call =>
|
.call =>
|
||||||
@ -13581,6 +13598,7 @@ names: [_][]u8 =
|
|||||||
"select",
|
"select",
|
||||||
"slice",
|
"slice",
|
||||||
"small_struct_ints",
|
"small_struct_ints",
|
||||||
|
"struct_assignment",
|
||||||
];
|
];
|
||||||
|
|
||||||
[export] main = fn [cc(c)] (argument_count: u32, argv: &&u8, envp: &&u8) s32
|
[export] main = fn [cc(c)] (argument_count: u32, argv: &&u8, envp: &&u8) s32
|
||||||
|
Loading…
x
Reference in New Issue
Block a user