@@ -443,7 +443,7 @@ def emit_attribute_writeback(self):
443
443
lldatalayout = llvm .create_target_data (self .llmodule .data_layout )
444
444
445
445
llrpcattrty = self .llcontext .get_identified_type ("attr_desc" )
446
- llrpcattrty .elements = [lli32 , llptr , llptr ]
446
+ llrpcattrty .elements = [lli32 , lli32 , llptr , llptr ]
447
447
448
448
lldescty = self .llcontext .get_identified_type ("type_desc" )
449
449
lldescty .elements = [llrpcattrty .as_pointer ().as_pointer (), llptr .as_pointer ()]
@@ -459,7 +459,10 @@ def emit_attribute_writeback(self):
459
459
type_name = "instance.{}" .format (typ .name )
460
460
461
461
def llrpcattr_of_attr (name , typ ):
462
- size = self .llty_of_type (typ ).get_abi_size (lldatalayout , context = self .llcontext )
462
+ size = self .llty_of_type (typ ). \
463
+ get_abi_size (lldatalayout , context = self .llcontext )
464
+ alignment = self .llty_of_type (typ ). \
465
+ get_abi_alignment (lldatalayout , context = self .llcontext )
463
466
464
467
def rpc_tag_error (typ ):
465
468
print (typ )
@@ -476,6 +479,7 @@ def rpc_tag_error(typ):
476
479
name = "attr.{}.{}" .format (type_name , name ))
477
480
llrpcattr .initializer = ll .Constant (llrpcattrty , [
478
481
ll .Constant (lli32 , size ),
482
+ ll .Constant (lli32 , alignment ),
479
483
llrpctag ,
480
484
self .llstr_of_str (name )
481
485
])
0 commit comments