@@ -14,6 +14,7 @@ class IRGenerator:
1414 # This field keeps track of the non_struct names to avoid duplicate name errors.
1515 type_number = 0
1616 unprocessed_store = []
17+
1718 # get the assignments dict and add this stuff to it.
1819 def __init__ (self , llvm_module , handler : DependencyHandler , assignments ):
1920 self .llvm_module = llvm_module
@@ -187,13 +188,17 @@ def gen_ir(self, struct, generated_debug_info):
187188 while hasattr (base_containing_type , "_type_" ):
188189 next_type = base_containing_type ._type_
189190 # Stop if _type_ is a string (like 'c' for c_char)
190- #TODO: stacked pointers not handl;ing ctypes check here as well
191+ # TODO: stacked pointers not handl;ing ctypes check here as well
191192 if isinstance (next_type , str ):
192193 break
193194 base_containing_type = next_type
194195
195196 # Get the base struct name
196- base_struct_name = base_containing_type .__name__ if hasattr (base_containing_type , "__name__" ) else str (base_containing_type )
197+ base_struct_name = (
198+ base_containing_type .__name__
199+ if hasattr (base_containing_type , "__name__" )
200+ else str (base_containing_type )
201+ )
197202
198203 # Look up the size using the base struct name
199204 containing_type_size = self .handler [base_struct_name ].current_offset
@@ -212,14 +217,23 @@ def gen_ir(self, struct, generated_debug_info):
212217 else :
213218 for i in range (0 , array_size ):
214219 field_co_re_name , returned = self ._struct_name_generator (
215- struct , field , field_index , True , i , containing_type_size
220+ struct ,
221+ field ,
222+ field_index ,
223+ True ,
224+ i ,
225+ containing_type_size ,
216226 )
217227 globvar = ir .GlobalVariable (
218228 self .llvm_module , ir .IntType (64 ), name = field_co_re_name
219229 )
220230 globvar .linkage = "external"
221- globvar .set_metadata ("llvm.preserve.access.index" , debug_info )
222- self .generated_field_names [struct .name ][field_name ] = globvar
231+ globvar .set_metadata (
232+ "llvm.preserve.access.index" , debug_info
233+ )
234+ self .generated_field_names [struct .name ][field_name ] = (
235+ globvar
236+ )
223237 field_index += 1
224238 else :
225239 field_co_re_name , returned = self ._struct_name_generator (
@@ -272,7 +286,7 @@ def _struct_name_generator(
272286 return unprocessed_type + "_" + str (self .type_number ), False
273287 else :
274288 self .unprocessed_store .append (unprocessed_type )
275- return unprocessed_type , False
289+ return unprocessed_type , False
276290 # raise TypeError(
277291 # "Name generation cannot occur due to type name not starting with struct"
278292 # )
0 commit comments