diff --git a/llvm/core.py b/llvm/core.py index cbe7f73..8a4ac2d 100644 --- a/llvm/core.py +++ b/llvm/core.py @@ -211,7 +211,7 @@ class CCEnum(Enum): CC_X86_THISCALL = ID.X86_ThisCall CC_PTX_KERNEL = ID.PTX_Kernel CC_PTX_DEVICE = ID.PTX_Device - + if llvm.version <= (3, 3): CC_MBLAZE_INTR = ID.MBLAZE_INTR CC_MBLAZE_SVOL = ID.MBLAZE_SVOL @@ -221,7 +221,7 @@ CCEnum.declare() # int predicates class ICMPEnum(Enum): prefix = 'ICMP_' - + Predicate = api.llvm.CmpInst.Predicate ICMP_EQ = Predicate.ICMP_EQ @@ -953,7 +953,7 @@ class StructType(Type): def _get_name(self): if self._ptr.isLiteral(): return "" - else: + else: return self._ptr.getName() name = property(_get_name, _set_name) @@ -1454,7 +1454,7 @@ class Argument(Value): attrbldr.addAttribute(attr) attrs = api.llvm.AttributeSet.get(context, 0, attrbldr) self._ptr.addAttr(attrs) - + if attr not in self: raise ValueError("Attribute %r is not valid for arg %s" % (attr, self)) diff --git a/llvm/llrt.py b/llvm/llrt.py index 13402d6..c704a66 100644 --- a/llvm/llrt.py +++ b/llvm/llrt.py @@ -38,7 +38,7 @@ def _replace_with(builder, inst, func): def load(arch): '''Load the LLRT module corresponding to the given architecture - Creates a new module and optimizes it using the information from + Creates a new module and optimizes it using the information from the host machine. ''' if arch != 'x86_64': diff --git a/llvm/mc/__init__.py b/llvm/mc/__init__.py index 3ee1541..69dd12f 100644 --- a/llvm/mc/__init__.py +++ b/llvm/mc/__init__.py @@ -191,12 +191,12 @@ class Disassembler(object): where the instruction bytes are from (not an offset into @bs). yields instructions in the form of (addr, data, inst) where addr is an integer, data is a tuple of integers and inst is an instance of - llvm.mc.Instr. @align specifies the byte alignment of instructions and + llvm.mc.Instr. @align specifies the byte alignment of instructions and is only used if an un-decodable instruction is encountered, in which case the disassembler will skip the following bytes until the next aligned address. if @align is unspecified, the default alignment for the architecture will be used, however this may not be ideal - for disassembly. for example, the default alignment for ARM is 1, but you + for disassembly. for example, the default alignment for ARM is 1, but you probably want it to be 4 for the purposes of disassembling ARM instructions. ''' @@ -223,7 +223,7 @@ class Disassembler(object): if amt_left >= size: data = code.readBytes(addr, size) elif amt_left < 1: - break + break else: data = code.readBytes(addr, amt_left) diff --git a/llvm/target.py b/llvm/target.py index 44d5086..e70fd1b 100644 --- a/llvm/target.py +++ b/llvm/target.py @@ -186,7 +186,7 @@ class TargetMachine(llvm.Wrapper): @property def feature_string(self): return self._ptr.getTargetFeatureString() - + @property def target(self): return self._ptr.getTarget() diff --git a/llvm/test_llvmpy.py b/llvm/test_llvmpy.py index 72283e6..2efd5a4 100644 --- a/llvm/test_llvmpy.py +++ b/llvm/test_llvmpy.py @@ -1469,7 +1469,7 @@ class TestArith(TestCase): cty = maptypes[ty] prototype = CFUNCTYPE(*[cty] * 3) callee = prototype(ptr) - callee(12, 23) + callee(12, 23) def template(self, iop, fop): inttys = [Type.int(32), Type.int(64)] @@ -1487,7 +1487,7 @@ class TestArith(TestCase): def test_sub(self): self.template('sub', 'fsub') - + def test_mul(self): self.template('mul', 'fmul') diff --git a/llvm_array/array.py b/llvm_array/array.py index 3cac244..de194a6 100644 --- a/llvm_array/array.py +++ b/llvm_array/array.py @@ -1,18 +1,18 @@ # This should be moved to llvmpy -# +# # There are different array kinds parameterized by eltype and nd -# -# Contiguous or Fortran +# +# Contiguous or Fortran # struct { # eltype *data; -# intp shape[nd]; +# intp shape[nd]; # } contiguous_array(eltype, nd) # # struct { # eltype *data; # diminfo shape[nd]; # } strided_array(eltype, nd) -# +# # struct { # eltype *data; # intp shape[nd]; @@ -40,7 +40,7 @@ # int32 nd; # diminfo shape[nd]; # } strided_array_nd(eltype) -# +# # # Backward compatible but deprecated: # struct { @@ -50,25 +50,25 @@ # intp stride[nd]; # } strided_soa_array_nd(eltype) # -# +# # The most general (where the kind of array is stored as well as number # of dimensions) # Rarely needed. -# +# # struct { # eltype *data; # int16 nd; # int16 dimkind; # ??? # } array_nd(eltype) -# +# # where ??? is run-time interpreted based on the dimkind to either: # intp shape[nd]; for dimkind = C_CONTIGUOUS or F_CONTIGUOUS # # diminfo shape[nd]; for dimkind = STRIDED # # intp shape[ind]; -# intp strides[ind]; dimkind = STRIDED_SOA +# intp strides[ind]; dimkind = STRIDED_SOA # import llvm.core as lc @@ -95,7 +95,7 @@ STRIDED_DK = STRIDED + HAS_DIMKIND STRIDED_SOA_DK = STRIDED_SOA + HAS_DIMKIND array_kinds = (C_CONTIGUOUS, F_CONTIGUOUS, STRIDED, STRIDED_SOA, - C_CONTIGUOUS_ND, F_CONTIGUOUS_ND, STRIDED_ND, STRIDED_SOA_DK, + C_CONTIGUOUS_ND, F_CONTIGUOUS_ND, STRIDED_ND, STRIDED_SOA_DK, C_CONTIGUOUS_DK, F_CONTIGUOUS_DK, STRIDED_DK, STRIDED_SOA_DK) _invmap = {} @@ -105,7 +105,7 @@ def kind_to_str(kind): if not _invmap: for key, value in globals().items(): if isinstance(value, int) and value in array_kinds: - _invmap[value] = key + _invmap[value] = key return _invmap[kind] def str_to_kind(str): @@ -157,7 +157,7 @@ def array_type(nd, kind, el_type=char_type): terms.append(Type.array(intp_type, nd)) # shape elif base == STRIDED: terms.append(Type.array(diminfo_type, nd)) # diminfo - elif base == STRIDED_SOA: + elif base == STRIDED_SOA: terms.extend([Type.array(intp_type, nd), # shape Type.array(intp_type, nd)]) # strides @@ -184,8 +184,8 @@ def _raw_check_array(arrtyp): a0 = arrtyp.elements[0] a1 = arrtyp.elements[1] if not isinstance(a0, lc.PointerType) or \ - not (isinstance(a1, lc.ArrayType) or - (a1 == int32_type) or (a1 == int16_type)): + not (isinstance(a1, lc.ArrayType) or + (a1 == int32_type) or (a1 == int16_type)): return None data_type = a0.pointee @@ -214,7 +214,7 @@ def _raw_check_array(arrtyp): c_contiguous = C_CONTIGUOUS_DK f_contiguous = F_CONTIGUOUS_DK else: - num = 1 + num = 1 strided = STRIDED strided_soa = STRIDED_SOA c_contiguous = C_CONTIGUOUS @@ -254,4 +254,4 @@ def test(): assert check_array(arr) == (STRIDED_SOA, 3, char_type) if __name__ == '__main__': - test() \ No newline at end of file + test() diff --git a/llvmpy/src/Attributes.py b/llvmpy/src/Attributes.py index 303d61d..7985833 100644 --- a/llvmpy/src/Attributes.py +++ b/llvmpy/src/Attributes.py @@ -21,14 +21,14 @@ if LLVM_VERSION >= (3, 3): @Attribute class Attribute: AttrKind = Enum('''None, Alignment, AlwaysInline, - ByVal, InlineHint, InReg, - MinSize, Naked, Nest, NoAlias, - NoBuiltin, NoCapture, NoDuplicate, NoImplicitFloat, - NoInline, NonLazyBind, NoRedZone, NoReturn, - NoUnwind, OptimizeForSize, ReadNone, ReadOnly, - Returned, ReturnsTwice, SExt, StackAlignment, - StackProtect, StackProtectReq, StackProtectStrong, StructRet, - SanitizeAddress, SanitizeThread, SanitizeMemory, UWTable, + ByVal, InlineHint, InReg, + MinSize, Naked, Nest, NoAlias, + NoBuiltin, NoCapture, NoDuplicate, NoImplicitFloat, + NoInline, NonLazyBind, NoRedZone, NoReturn, + NoUnwind, OptimizeForSize, ReadNone, ReadOnly, + Returned, ReturnsTwice, SExt, StackAlignment, + StackProtect, StackProtectReq, StackProtectStrong, StructRet, + SanitizeAddress, SanitizeThread, SanitizeMemory, UWTable, ZExt, EndAttrKinds''') delete = Destructor() diff --git a/llvmpy/src/CallingConv.py b/llvmpy/src/CallingConv.py index b03e65c..bdd5c1c 100644 --- a/llvmpy/src/CallingConv.py +++ b/llvmpy/src/CallingConv.py @@ -4,7 +4,7 @@ from .namespace import llvm ccs = ''' C, Fast, Cold, GHC, FirstTargetCC, X86_StdCall, X86_FastCall, ARM_APCS, ARM_AAPCS, ARM_AAPCS_VFP, MSP430_INTR, X86_ThisCall, - PTX_Kernel, PTX_Device, + PTX_Kernel, PTX_Device, ''' if LLVM_VERSION <= (3, 3): diff --git a/llvmpy/src/DIBuilder.py b/llvmpy/src/DIBuilder.py index 7bc8224..78aba4c 100644 --- a/llvmpy/src/DIBuilder.py +++ b/llvmpy/src/DIBuilder.py @@ -56,7 +56,7 @@ class DIBuilder: ) else: createNullPtrType = Method(DIBasicType) - + createBasicType = Method(DIType, stringref_arg, # Name @@ -204,7 +204,7 @@ class DIBuilder: createObjectPointerType = Method(DIType, ref(DIType), # Ty ) - + #createTemporaryType = Method(DIType, ref(DIFile)).require_only(0) createForwardDecl = Method(DIType, @@ -250,7 +250,7 @@ class DIBuilder: bool_arg, # isLocalToUnit ptr(Value), # Val ) - + createLocalVariable = Method(DIVariable, unsigned_arg, # Tag, ref(DIDescriptor), # Scope, @@ -273,7 +273,7 @@ class DIBuilder: ref(SmallVector_Value), # Addr, unsigned_arg, # ArgNo=0, ).require_only(7) - + createFunction = Method(DISubprogram, ref(DIDescriptor), # Scope stringref_arg, # Name @@ -318,7 +318,7 @@ class DIBuilder: unsigned_arg, # LineNo ) - createLexicalBlockFile = Method(DILexicalBlockFile, + createLexicalBlockFile = Method(DILexicalBlockFile, ref(DIDescriptor), # Scope, ref(DIFile), # File ) @@ -329,7 +329,7 @@ class DIBuilder: unsigned_arg, # Line, unsigned_arg, # Col ) - + _insertDeclare_1 = Method(ptr(Instruction), ptr(Value), # Storage, ref(DIVariable), # VarInfo diff --git a/llvmpy/src/Function.py b/llvmpy/src/Function.py index 9c2c8b7..ac5b6fd 100644 --- a/llvmpy/src/Function.py +++ b/llvmpy/src/Function.py @@ -19,7 +19,7 @@ class Function: _include_ = 'llvm/IR/Function.h' else: _include_ = 'llvm/Function.h' - + _downcast_ = GlobalValue, Constant, Value getReturnType = Method(ptr(Type)) diff --git a/llvmpy/src/MC/__init__.py b/llvmpy/src/MC/__init__.py index 92db727..f7ff609 100644 --- a/llvmpy/src/MC/__init__.py +++ b/llvmpy/src/MC/__init__.py @@ -1,4 +1,4 @@ -#this file is not processed unless the llvm library is +#this file is not processed unless the llvm library is #version 3.4 or higher. see llvmpy/__init__.py for details. from binding import * from ..namespace import llvm @@ -73,7 +73,7 @@ class MCOperand: getImm = Method(cast(Int64, int)) getFPImm = Method(cast(Double, float)) getExpr = Method(const(ownedptr(MCExpr))) - + @MCInst class MCInst: _include_ = "llvm/MC/MCInst.h" @@ -148,7 +148,7 @@ class MCDisassembler: DecodeStatus = Enum('Fail', 'SoftFail', 'Success') - getInstruction = CustomMethod('MCDisassembler_getInstruction', + getInstruction = CustomMethod('MCDisassembler_getInstruction', PyObjectPtr, ref(MCInst), ref(MemoryObject), diff --git a/llvmpy/src/Support/Dwarf.py b/llvmpy/src/Support/Dwarf.py index caecc24..ab537a4 100644 --- a/llvmpy/src/Support/Dwarf.py +++ b/llvmpy/src/Support/Dwarf.py @@ -7,557 +7,557 @@ dwarf.includes.add('llvm/Support/Dwarf.h') dwarf_constants = dwarf.Enum('dwarf_constants', ''' -DWARF_VERSION -DW_TAG_array_type -DW_TAG_class_type -DW_TAG_entry_point -DW_TAG_enumeration_type -DW_TAG_formal_parameter -DW_TAG_imported_declaration -DW_TAG_label -DW_TAG_lexical_block -DW_TAG_member +DWARF_VERSION +DW_TAG_array_type +DW_TAG_class_type +DW_TAG_entry_point +DW_TAG_enumeration_type +DW_TAG_formal_parameter +DW_TAG_imported_declaration +DW_TAG_label +DW_TAG_lexical_block +DW_TAG_member DW_TAG_pointer_type -DW_TAG_reference_type -DW_TAG_compile_unit -DW_TAG_string_type -DW_TAG_structure_type -DW_TAG_subroutine_type -DW_TAG_typedef -DW_TAG_union_type -DW_TAG_unspecified_parameters -DW_TAG_variant -DW_TAG_common_block -DW_TAG_common_inclusion -DW_TAG_inheritance -DW_TAG_inlined_subroutine -DW_TAG_module -DW_TAG_ptr_to_member_type -DW_TAG_set_type -DW_TAG_subrange_type -DW_TAG_with_stmt -DW_TAG_access_declaration -DW_TAG_base_type -DW_TAG_catch_block -DW_TAG_const_type -DW_TAG_constant -DW_TAG_enumerator -DW_TAG_file_type -DW_TAG_friend -DW_TAG_namelist -DW_TAG_namelist_item -DW_TAG_packed_type -DW_TAG_subprogram -DW_TAG_template_type_parameter -DW_TAG_template_value_parameter -DW_TAG_thrown_type -DW_TAG_try_block -DW_TAG_variant_part -DW_TAG_variable -DW_TAG_volatile_type -DW_TAG_dwarf_procedure -DW_TAG_restrict_type -DW_TAG_interface_type -DW_TAG_namespace -DW_TAG_imported_module -DW_TAG_unspecified_type -DW_TAG_partial_unit -DW_TAG_imported_unit -DW_TAG_condition -DW_TAG_shared_type -DW_TAG_type_unit -DW_TAG_rvalue_reference_type -DW_TAG_template_alias -DW_TAG_MIPS_loop -DW_TAG_format_label -DW_TAG_function_template -DW_TAG_class_template -DW_TAG_GNU_template_template_param -DW_TAG_GNU_template_parameter_pack -DW_TAG_GNU_formal_parameter_pack -DW_TAG_lo_user -DW_TAG_APPLE_property -DW_TAG_hi_user -DW_CHILDREN_no -DW_CHILDREN_yes -DW_AT_sibling -DW_AT_location -DW_AT_name -DW_AT_ordering -DW_AT_byte_size -DW_AT_bit_offset -DW_AT_bit_size -DW_AT_stmt_list -DW_AT_low_pc -DW_AT_high_pc -DW_AT_language +DW_TAG_reference_type +DW_TAG_compile_unit +DW_TAG_string_type +DW_TAG_structure_type +DW_TAG_subroutine_type +DW_TAG_typedef +DW_TAG_union_type +DW_TAG_unspecified_parameters +DW_TAG_variant +DW_TAG_common_block +DW_TAG_common_inclusion +DW_TAG_inheritance +DW_TAG_inlined_subroutine +DW_TAG_module +DW_TAG_ptr_to_member_type +DW_TAG_set_type +DW_TAG_subrange_type +DW_TAG_with_stmt +DW_TAG_access_declaration +DW_TAG_base_type +DW_TAG_catch_block +DW_TAG_const_type +DW_TAG_constant +DW_TAG_enumerator +DW_TAG_file_type +DW_TAG_friend +DW_TAG_namelist +DW_TAG_namelist_item +DW_TAG_packed_type +DW_TAG_subprogram +DW_TAG_template_type_parameter +DW_TAG_template_value_parameter +DW_TAG_thrown_type +DW_TAG_try_block +DW_TAG_variant_part +DW_TAG_variable +DW_TAG_volatile_type +DW_TAG_dwarf_procedure +DW_TAG_restrict_type +DW_TAG_interface_type +DW_TAG_namespace +DW_TAG_imported_module +DW_TAG_unspecified_type +DW_TAG_partial_unit +DW_TAG_imported_unit +DW_TAG_condition +DW_TAG_shared_type +DW_TAG_type_unit +DW_TAG_rvalue_reference_type +DW_TAG_template_alias +DW_TAG_MIPS_loop +DW_TAG_format_label +DW_TAG_function_template +DW_TAG_class_template +DW_TAG_GNU_template_template_param +DW_TAG_GNU_template_parameter_pack +DW_TAG_GNU_formal_parameter_pack +DW_TAG_lo_user +DW_TAG_APPLE_property +DW_TAG_hi_user +DW_CHILDREN_no +DW_CHILDREN_yes +DW_AT_sibling +DW_AT_location +DW_AT_name +DW_AT_ordering +DW_AT_byte_size +DW_AT_bit_offset +DW_AT_bit_size +DW_AT_stmt_list +DW_AT_low_pc +DW_AT_high_pc +DW_AT_language DW_AT_discr -DW_AT_discr_value -DW_AT_visibility -DW_AT_import -DW_AT_string_length -DW_AT_common_reference -DW_AT_comp_dir -DW_AT_const_value -DW_AT_containing_type -DW_AT_default_value -DW_AT_inline -DW_AT_is_optional -DW_AT_lower_bound -DW_AT_producer -DW_AT_prototyped -DW_AT_return_addr -DW_AT_start_scope -DW_AT_bit_stride -DW_AT_upper_bound -DW_AT_abstract_origin -DW_AT_accessibility -DW_AT_address_class -DW_AT_artificial -DW_AT_base_types -DW_AT_calling_convention -DW_AT_count -DW_AT_data_member_location -DW_AT_decl_column -DW_AT_decl_file -DW_AT_decl_line -DW_AT_declaration -DW_AT_discr_list -DW_AT_encoding -DW_AT_external -DW_AT_frame_base -DW_AT_friend -DW_AT_identifier_case -DW_AT_macro_info -DW_AT_namelist_item -DW_AT_priority -DW_AT_segment -DW_AT_specification -DW_AT_static_link -DW_AT_type -DW_AT_use_location -DW_AT_variable_parameter -DW_AT_virtuality -DW_AT_vtable_elem_location -DW_AT_allocated -DW_AT_associated -DW_AT_data_location -DW_AT_byte_stride -DW_AT_entry_pc -DW_AT_use_UTF8 -DW_AT_extension -DW_AT_ranges -DW_AT_trampoline -DW_AT_call_column -DW_AT_call_file -DW_AT_call_line -DW_AT_description -DW_AT_binary_scale -DW_AT_decimal_scale -DW_AT_small -DW_AT_decimal_sign -DW_AT_digit_count -DW_AT_picture_string -DW_AT_mutable -DW_AT_threads_scaled -DW_AT_explicit -DW_AT_object_pointer -DW_AT_endianity -DW_AT_elemental -DW_AT_pure -DW_AT_recursive -DW_AT_signature -DW_AT_main_subprogram -DW_AT_data_bit_offset -DW_AT_const_expr -DW_AT_enum_class -DW_AT_linkage_name -DW_AT_lo_user -DW_AT_hi_user -DW_AT_MIPS_loop_begin -DW_AT_MIPS_tail_loop_begin -DW_AT_MIPS_epilog_begin -DW_AT_MIPS_loop_unroll_factor -DW_AT_MIPS_software_pipeline_depth -DW_AT_MIPS_linkage_name -DW_AT_MIPS_stride -DW_AT_MIPS_abstract_name -DW_AT_MIPS_clone_origin -DW_AT_MIPS_has_inlines -DW_AT_MIPS_stride_byte -DW_AT_MIPS_stride_elem -DW_AT_MIPS_ptr_dopetype -DW_AT_MIPS_allocatable_dopetype -DW_AT_MIPS_assumed_shape_dopetype -DW_AT_MIPS_assumed_size -DW_AT_sf_names -DW_AT_src_info -DW_AT_mac_info -DW_AT_src_coords -DW_AT_body_begin -DW_AT_body_end +DW_AT_discr_value +DW_AT_visibility +DW_AT_import +DW_AT_string_length +DW_AT_common_reference +DW_AT_comp_dir +DW_AT_const_value +DW_AT_containing_type +DW_AT_default_value +DW_AT_inline +DW_AT_is_optional +DW_AT_lower_bound +DW_AT_producer +DW_AT_prototyped +DW_AT_return_addr +DW_AT_start_scope +DW_AT_bit_stride +DW_AT_upper_bound +DW_AT_abstract_origin +DW_AT_accessibility +DW_AT_address_class +DW_AT_artificial +DW_AT_base_types +DW_AT_calling_convention +DW_AT_count +DW_AT_data_member_location +DW_AT_decl_column +DW_AT_decl_file +DW_AT_decl_line +DW_AT_declaration +DW_AT_discr_list +DW_AT_encoding +DW_AT_external +DW_AT_frame_base +DW_AT_friend +DW_AT_identifier_case +DW_AT_macro_info +DW_AT_namelist_item +DW_AT_priority +DW_AT_segment +DW_AT_specification +DW_AT_static_link +DW_AT_type +DW_AT_use_location +DW_AT_variable_parameter +DW_AT_virtuality +DW_AT_vtable_elem_location +DW_AT_allocated +DW_AT_associated +DW_AT_data_location +DW_AT_byte_stride +DW_AT_entry_pc +DW_AT_use_UTF8 +DW_AT_extension +DW_AT_ranges +DW_AT_trampoline +DW_AT_call_column +DW_AT_call_file +DW_AT_call_line +DW_AT_description +DW_AT_binary_scale +DW_AT_decimal_scale +DW_AT_small +DW_AT_decimal_sign +DW_AT_digit_count +DW_AT_picture_string +DW_AT_mutable +DW_AT_threads_scaled +DW_AT_explicit +DW_AT_object_pointer +DW_AT_endianity +DW_AT_elemental +DW_AT_pure +DW_AT_recursive +DW_AT_signature +DW_AT_main_subprogram +DW_AT_data_bit_offset +DW_AT_const_expr +DW_AT_enum_class +DW_AT_linkage_name +DW_AT_lo_user +DW_AT_hi_user +DW_AT_MIPS_loop_begin +DW_AT_MIPS_tail_loop_begin +DW_AT_MIPS_epilog_begin +DW_AT_MIPS_loop_unroll_factor +DW_AT_MIPS_software_pipeline_depth +DW_AT_MIPS_linkage_name +DW_AT_MIPS_stride +DW_AT_MIPS_abstract_name +DW_AT_MIPS_clone_origin +DW_AT_MIPS_has_inlines +DW_AT_MIPS_stride_byte +DW_AT_MIPS_stride_elem +DW_AT_MIPS_ptr_dopetype +DW_AT_MIPS_allocatable_dopetype +DW_AT_MIPS_assumed_shape_dopetype +DW_AT_MIPS_assumed_size +DW_AT_sf_names +DW_AT_src_info +DW_AT_mac_info +DW_AT_src_coords +DW_AT_body_begin +DW_AT_body_end DW_AT_APPLE_optimized -DW_AT_APPLE_flags -DW_AT_APPLE_isa -DW_AT_APPLE_block -DW_AT_APPLE_major_runtime_vers -DW_AT_APPLE_runtime_class -DW_AT_APPLE_omit_frame_ptr -DW_AT_APPLE_property_name -DW_AT_APPLE_property_getter -DW_AT_APPLE_property_setter -DW_AT_APPLE_property_attribute -DW_AT_APPLE_objc_complete_type -DW_AT_APPLE_property -DW_FORM_addr -DW_FORM_block2 -DW_FORM_block4 -DW_FORM_data2 -DW_FORM_data4 -DW_FORM_data8 -DW_FORM_string -DW_FORM_block -DW_FORM_block1 -DW_FORM_data1 -DW_FORM_flag -DW_FORM_sdata -DW_FORM_strp -DW_FORM_udata -DW_FORM_ref_addr -DW_FORM_ref1 -DW_FORM_ref2 -DW_FORM_ref4 -DW_FORM_ref8 -DW_FORM_ref_udata -DW_FORM_indirect -DW_FORM_sec_offset -DW_FORM_exprloc -DW_FORM_flag_present +DW_AT_APPLE_flags +DW_AT_APPLE_isa +DW_AT_APPLE_block +DW_AT_APPLE_major_runtime_vers +DW_AT_APPLE_runtime_class +DW_AT_APPLE_omit_frame_ptr +DW_AT_APPLE_property_name +DW_AT_APPLE_property_getter +DW_AT_APPLE_property_setter +DW_AT_APPLE_property_attribute +DW_AT_APPLE_objc_complete_type +DW_AT_APPLE_property +DW_FORM_addr +DW_FORM_block2 +DW_FORM_block4 +DW_FORM_data2 +DW_FORM_data4 +DW_FORM_data8 +DW_FORM_string +DW_FORM_block +DW_FORM_block1 +DW_FORM_data1 +DW_FORM_flag +DW_FORM_sdata +DW_FORM_strp +DW_FORM_udata +DW_FORM_ref_addr +DW_FORM_ref1 +DW_FORM_ref2 +DW_FORM_ref4 +DW_FORM_ref8 +DW_FORM_ref_udata +DW_FORM_indirect +DW_FORM_sec_offset +DW_FORM_exprloc +DW_FORM_flag_present DW_FORM_ref_sig8 -DW_OP_addr -DW_OP_deref -DW_OP_const1u -DW_OP_const1s -DW_OP_const2u -DW_OP_const2s -DW_OP_const4u -DW_OP_const4s -DW_OP_const8u -DW_OP_const8s -DW_OP_constu -DW_OP_consts -DW_OP_dup -DW_OP_drop -DW_OP_over -DW_OP_pick -DW_OP_swap -DW_OP_rot -DW_OP_xderef -DW_OP_abs -DW_OP_and -DW_OP_div -DW_OP_minus -DW_OP_mod -DW_OP_mul -DW_OP_neg -DW_OP_not -DW_OP_or -DW_OP_plus -DW_OP_plus_uconst -DW_OP_shl -DW_OP_shr -DW_OP_shra -DW_OP_xor -DW_OP_skip -DW_OP_bra -DW_OP_eq -DW_OP_ge -DW_OP_gt -DW_OP_le -DW_OP_lt -DW_OP_ne -DW_OP_lit0 -DW_OP_lit1 -DW_OP_lit2 -DW_OP_lit3 -DW_OP_lit4 -DW_OP_lit5 -DW_OP_lit6 -DW_OP_lit7 -DW_OP_lit8 -DW_OP_lit9 -DW_OP_lit10 -DW_OP_lit11 -DW_OP_lit12 -DW_OP_lit13 -DW_OP_lit14 -DW_OP_lit15 -DW_OP_lit16 -DW_OP_lit17 -DW_OP_lit18 -DW_OP_lit19 -DW_OP_lit20 -DW_OP_lit21 -DW_OP_lit22 -DW_OP_lit23 -DW_OP_lit24 -DW_OP_lit25 -DW_OP_lit26 -DW_OP_lit27 -DW_OP_lit28 -DW_OP_lit29 -DW_OP_lit30 -DW_OP_lit31 -DW_OP_reg0 -DW_OP_reg1 -DW_OP_reg2 -DW_OP_reg3 -DW_OP_reg4 -DW_OP_reg5 -DW_OP_reg6 -DW_OP_reg7 -DW_OP_reg8 -DW_OP_reg9 -DW_OP_reg10 -DW_OP_reg11 -DW_OP_reg12 -DW_OP_reg13 -DW_OP_reg14 -DW_OP_reg15 -DW_OP_reg16 -DW_OP_reg17 -DW_OP_reg18 -DW_OP_reg19 -DW_OP_reg20 -DW_OP_reg21 -DW_OP_reg22 -DW_OP_reg23 -DW_OP_reg24 -DW_OP_reg25 -DW_OP_reg26 -DW_OP_reg27 -DW_OP_reg28 -DW_OP_reg29 -DW_OP_reg30 -DW_OP_reg31 -DW_OP_breg0 -DW_OP_breg1 -DW_OP_breg2 -DW_OP_breg3 -DW_OP_breg4 -DW_OP_breg5 -DW_OP_breg6 -DW_OP_breg7 -DW_OP_breg8 -DW_OP_breg9 -DW_OP_breg10 -DW_OP_breg11 -DW_OP_breg12 -DW_OP_breg13 -DW_OP_breg14 -DW_OP_breg15 -DW_OP_breg16 -DW_OP_breg17 -DW_OP_breg18 -DW_OP_breg19 -DW_OP_breg20 -DW_OP_breg21 -DW_OP_breg22 -DW_OP_breg23 -DW_OP_breg24 -DW_OP_breg25 -DW_OP_breg26 -DW_OP_breg27 -DW_OP_breg28 -DW_OP_breg29 -DW_OP_breg30 -DW_OP_breg31 -DW_OP_regx -DW_OP_fbreg -DW_OP_bregx -DW_OP_piece -DW_OP_deref_size -DW_OP_xderef_size -DW_OP_nop -DW_OP_push_object_address -DW_OP_call2 -DW_OP_call4 -DW_OP_call_ref -DW_OP_form_tls_address -DW_OP_call_frame_cfa -DW_OP_bit_piece -DW_OP_implicit_value -DW_OP_stack_value -DW_OP_lo_user +DW_OP_addr +DW_OP_deref +DW_OP_const1u +DW_OP_const1s +DW_OP_const2u +DW_OP_const2s +DW_OP_const4u +DW_OP_const4s +DW_OP_const8u +DW_OP_const8s +DW_OP_constu +DW_OP_consts +DW_OP_dup +DW_OP_drop +DW_OP_over +DW_OP_pick +DW_OP_swap +DW_OP_rot +DW_OP_xderef +DW_OP_abs +DW_OP_and +DW_OP_div +DW_OP_minus +DW_OP_mod +DW_OP_mul +DW_OP_neg +DW_OP_not +DW_OP_or +DW_OP_plus +DW_OP_plus_uconst +DW_OP_shl +DW_OP_shr +DW_OP_shra +DW_OP_xor +DW_OP_skip +DW_OP_bra +DW_OP_eq +DW_OP_ge +DW_OP_gt +DW_OP_le +DW_OP_lt +DW_OP_ne +DW_OP_lit0 +DW_OP_lit1 +DW_OP_lit2 +DW_OP_lit3 +DW_OP_lit4 +DW_OP_lit5 +DW_OP_lit6 +DW_OP_lit7 +DW_OP_lit8 +DW_OP_lit9 +DW_OP_lit10 +DW_OP_lit11 +DW_OP_lit12 +DW_OP_lit13 +DW_OP_lit14 +DW_OP_lit15 +DW_OP_lit16 +DW_OP_lit17 +DW_OP_lit18 +DW_OP_lit19 +DW_OP_lit20 +DW_OP_lit21 +DW_OP_lit22 +DW_OP_lit23 +DW_OP_lit24 +DW_OP_lit25 +DW_OP_lit26 +DW_OP_lit27 +DW_OP_lit28 +DW_OP_lit29 +DW_OP_lit30 +DW_OP_lit31 +DW_OP_reg0 +DW_OP_reg1 +DW_OP_reg2 +DW_OP_reg3 +DW_OP_reg4 +DW_OP_reg5 +DW_OP_reg6 +DW_OP_reg7 +DW_OP_reg8 +DW_OP_reg9 +DW_OP_reg10 +DW_OP_reg11 +DW_OP_reg12 +DW_OP_reg13 +DW_OP_reg14 +DW_OP_reg15 +DW_OP_reg16 +DW_OP_reg17 +DW_OP_reg18 +DW_OP_reg19 +DW_OP_reg20 +DW_OP_reg21 +DW_OP_reg22 +DW_OP_reg23 +DW_OP_reg24 +DW_OP_reg25 +DW_OP_reg26 +DW_OP_reg27 +DW_OP_reg28 +DW_OP_reg29 +DW_OP_reg30 +DW_OP_reg31 +DW_OP_breg0 +DW_OP_breg1 +DW_OP_breg2 +DW_OP_breg3 +DW_OP_breg4 +DW_OP_breg5 +DW_OP_breg6 +DW_OP_breg7 +DW_OP_breg8 +DW_OP_breg9 +DW_OP_breg10 +DW_OP_breg11 +DW_OP_breg12 +DW_OP_breg13 +DW_OP_breg14 +DW_OP_breg15 +DW_OP_breg16 +DW_OP_breg17 +DW_OP_breg18 +DW_OP_breg19 +DW_OP_breg20 +DW_OP_breg21 +DW_OP_breg22 +DW_OP_breg23 +DW_OP_breg24 +DW_OP_breg25 +DW_OP_breg26 +DW_OP_breg27 +DW_OP_breg28 +DW_OP_breg29 +DW_OP_breg30 +DW_OP_breg31 +DW_OP_regx +DW_OP_fbreg +DW_OP_bregx +DW_OP_piece +DW_OP_deref_size +DW_OP_xderef_size +DW_OP_nop +DW_OP_push_object_address +DW_OP_call2 +DW_OP_call4 +DW_OP_call_ref +DW_OP_form_tls_address +DW_OP_call_frame_cfa +DW_OP_bit_piece +DW_OP_implicit_value +DW_OP_stack_value +DW_OP_lo_user DW_OP_hi_user -DW_ATE_address -DW_ATE_boolean -DW_ATE_complex_float -DW_ATE_float -DW_ATE_signed -DW_ATE_signed_char -DW_ATE_unsigned -DW_ATE_unsigned_char -DW_ATE_imaginary_float -DW_ATE_packed_decimal -DW_ATE_numeric_string -DW_ATE_edited -DW_ATE_signed_fixed -DW_ATE_unsigned_fixed -DW_ATE_decimal_float -DW_ATE_UTF -DW_ATE_lo_user -DW_ATE_hi_user -DW_DS_unsigned -DW_DS_leading_overpunch -DW_DS_trailing_overpunch -DW_DS_leading_separate -DW_DS_trailing_separate -DW_END_default -DW_END_big -DW_END_little -DW_END_lo_user -DW_END_hi_user -DW_ACCESS_public -DW_ACCESS_protected -DW_ACCESS_private -DW_VIS_local -DW_VIS_exported -DW_VIS_qualified -DW_VIRTUALITY_none -DW_VIRTUALITY_virtual -DW_VIRTUALITY_pure_virtual -DW_LANG_C89 -DW_LANG_C -DW_LANG_Ada83 -DW_LANG_C_plus_plus -DW_LANG_Cobol74 -DW_LANG_Cobol85 -DW_LANG_Fortran77 -DW_LANG_Fortran90 -DW_LANG_Pascal83 -DW_LANG_Modula2 -DW_LANG_Java -DW_LANG_C99 -DW_LANG_Ada95 -DW_LANG_Fortran95 -DW_LANG_PLI -DW_LANG_ObjC -DW_LANG_ObjC_plus_plus -DW_LANG_UPC -DW_LANG_D -DW_LANG_Python -DW_LANG_lo_user -DW_LANG_Mips_Assembler -DW_LANG_hi_user -DW_ID_case_sensitive -DW_ID_up_case -DW_ID_down_case -DW_ID_case_insensitive -DW_CC_normal -DW_CC_program -DW_CC_nocall -DW_CC_lo_user -DW_CC_hi_user -DW_INL_not_inlined -DW_INL_inlined -DW_INL_declared_not_inlined -DW_INL_declared_inlined -DW_ORD_row_major -DW_ORD_col_major -DW_DSC_label -DW_DSC_range -DW_LNS_extended_op -DW_LNS_copy -DW_LNS_advance_pc -DW_LNS_advance_line -DW_LNS_set_file -DW_LNS_set_column -DW_LNS_negate_stmt -DW_LNS_set_basic_block -DW_LNS_const_add_pc -DW_LNS_fixed_advance_pc -DW_LNS_set_prologue_end -DW_LNS_set_epilogue_begin -DW_LNS_set_isa -DW_LNE_end_sequence -DW_LNE_set_address -DW_LNE_define_file -DW_LNE_set_discriminator -DW_LNE_lo_user -DW_LNE_hi_user -DW_MACINFO_define -DW_MACINFO_undef -DW_MACINFO_start_file -DW_MACINFO_end_file -DW_MACINFO_vendor_ext -DW_CFA_extended -DW_CFA_nop -DW_CFA_advance_loc -DW_CFA_offset -DW_CFA_restore -DW_CFA_set_loc -DW_CFA_advance_loc1 -DW_CFA_advance_loc2 -DW_CFA_advance_loc4 -DW_CFA_offset_extended -DW_CFA_restore_extended -DW_CFA_undefined -DW_CFA_same_value -DW_CFA_register -DW_CFA_remember_state -DW_CFA_restore_state -DW_CFA_def_cfa -DW_CFA_def_cfa_register -DW_CFA_def_cfa_offset -DW_CFA_def_cfa_expression -DW_CFA_expression -DW_CFA_offset_extended_sf -DW_CFA_def_cfa_sf -DW_CFA_def_cfa_offset_sf -DW_CFA_val_offset -DW_CFA_val_offset_sf -DW_CFA_val_expression -DW_CFA_MIPS_advance_loc8 -DW_CFA_GNU_window_save -DW_CFA_GNU_args_size -DW_CFA_lo_user -DW_CFA_hi_user -DW_EH_PE_absptr -DW_EH_PE_omit +DW_ATE_address +DW_ATE_boolean +DW_ATE_complex_float +DW_ATE_float +DW_ATE_signed +DW_ATE_signed_char +DW_ATE_unsigned +DW_ATE_unsigned_char +DW_ATE_imaginary_float +DW_ATE_packed_decimal +DW_ATE_numeric_string +DW_ATE_edited +DW_ATE_signed_fixed +DW_ATE_unsigned_fixed +DW_ATE_decimal_float +DW_ATE_UTF +DW_ATE_lo_user +DW_ATE_hi_user +DW_DS_unsigned +DW_DS_leading_overpunch +DW_DS_trailing_overpunch +DW_DS_leading_separate +DW_DS_trailing_separate +DW_END_default +DW_END_big +DW_END_little +DW_END_lo_user +DW_END_hi_user +DW_ACCESS_public +DW_ACCESS_protected +DW_ACCESS_private +DW_VIS_local +DW_VIS_exported +DW_VIS_qualified +DW_VIRTUALITY_none +DW_VIRTUALITY_virtual +DW_VIRTUALITY_pure_virtual +DW_LANG_C89 +DW_LANG_C +DW_LANG_Ada83 +DW_LANG_C_plus_plus +DW_LANG_Cobol74 +DW_LANG_Cobol85 +DW_LANG_Fortran77 +DW_LANG_Fortran90 +DW_LANG_Pascal83 +DW_LANG_Modula2 +DW_LANG_Java +DW_LANG_C99 +DW_LANG_Ada95 +DW_LANG_Fortran95 +DW_LANG_PLI +DW_LANG_ObjC +DW_LANG_ObjC_plus_plus +DW_LANG_UPC +DW_LANG_D +DW_LANG_Python +DW_LANG_lo_user +DW_LANG_Mips_Assembler +DW_LANG_hi_user +DW_ID_case_sensitive +DW_ID_up_case +DW_ID_down_case +DW_ID_case_insensitive +DW_CC_normal +DW_CC_program +DW_CC_nocall +DW_CC_lo_user +DW_CC_hi_user +DW_INL_not_inlined +DW_INL_inlined +DW_INL_declared_not_inlined +DW_INL_declared_inlined +DW_ORD_row_major +DW_ORD_col_major +DW_DSC_label +DW_DSC_range +DW_LNS_extended_op +DW_LNS_copy +DW_LNS_advance_pc +DW_LNS_advance_line +DW_LNS_set_file +DW_LNS_set_column +DW_LNS_negate_stmt +DW_LNS_set_basic_block +DW_LNS_const_add_pc +DW_LNS_fixed_advance_pc +DW_LNS_set_prologue_end +DW_LNS_set_epilogue_begin +DW_LNS_set_isa +DW_LNE_end_sequence +DW_LNE_set_address +DW_LNE_define_file +DW_LNE_set_discriminator +DW_LNE_lo_user +DW_LNE_hi_user +DW_MACINFO_define +DW_MACINFO_undef +DW_MACINFO_start_file +DW_MACINFO_end_file +DW_MACINFO_vendor_ext +DW_CFA_extended +DW_CFA_nop +DW_CFA_advance_loc +DW_CFA_offset +DW_CFA_restore +DW_CFA_set_loc +DW_CFA_advance_loc1 +DW_CFA_advance_loc2 +DW_CFA_advance_loc4 +DW_CFA_offset_extended +DW_CFA_restore_extended +DW_CFA_undefined +DW_CFA_same_value +DW_CFA_register +DW_CFA_remember_state +DW_CFA_restore_state +DW_CFA_def_cfa +DW_CFA_def_cfa_register +DW_CFA_def_cfa_offset +DW_CFA_def_cfa_expression +DW_CFA_expression +DW_CFA_offset_extended_sf +DW_CFA_def_cfa_sf +DW_CFA_def_cfa_offset_sf +DW_CFA_val_offset +DW_CFA_val_offset_sf +DW_CFA_val_expression +DW_CFA_MIPS_advance_loc8 +DW_CFA_GNU_window_save +DW_CFA_GNU_args_size +DW_CFA_lo_user +DW_CFA_hi_user +DW_EH_PE_absptr +DW_EH_PE_omit DW_EH_PE_uleb128 -DW_EH_PE_udata2 -DW_EH_PE_udata4 -DW_EH_PE_udata8 -DW_EH_PE_sleb128 -DW_EH_PE_sdata2 -DW_EH_PE_sdata4 -DW_EH_PE_sdata8 -DW_EH_PE_signed -DW_EH_PE_pcrel -DW_EH_PE_textrel -DW_EH_PE_datarel -DW_EH_PE_funcrel -DW_EH_PE_aligned -DW_EH_PE_indirect -DW_APPLE_PROPERTY_readonly -DW_APPLE_PROPERTY_readwrite -DW_APPLE_PROPERTY_assign -DW_APPLE_PROPERTY_retain -DW_APPLE_PROPERTY_copy -DW_APPLE_PROPERTY_nonatomic +DW_EH_PE_udata2 +DW_EH_PE_udata4 +DW_EH_PE_udata8 +DW_EH_PE_sleb128 +DW_EH_PE_sdata2 +DW_EH_PE_sdata4 +DW_EH_PE_sdata8 +DW_EH_PE_signed +DW_EH_PE_pcrel +DW_EH_PE_textrel +DW_EH_PE_datarel +DW_EH_PE_funcrel +DW_EH_PE_aligned +DW_EH_PE_indirect +DW_APPLE_PROPERTY_readonly +DW_APPLE_PROPERTY_readwrite +DW_APPLE_PROPERTY_assign +DW_APPLE_PROPERTY_retain +DW_APPLE_PROPERTY_copy +DW_APPLE_PROPERTY_nonatomic ''') ### The following enums are not available in LLVM 3.2 # DW_AT_GNU_dwo_name -# DW_AT_GNU_vector +# DW_AT_GNU_vector # DW_AT_GNU_template_name # DW_AT_GNU_dwo_id -# DW_AT_GNU_ranges_base -# DW_AT_GNU_addr_base -# DW_AT_GNU_pubnames -# DW_AT_GNU_pubtypes -# DW_FORM_GNU_addr_index +# DW_AT_GNU_ranges_base +# DW_AT_GNU_addr_base +# DW_AT_GNU_pubnames +# DW_AT_GNU_pubtypes +# DW_FORM_GNU_addr_index # DW_FORM_GNU_str_index -# DW_OP_GNU_addr_index +# DW_OP_GNU_addr_index # DW_OP_GNU_const_index diff --git a/llvmpy/src/Support/Host.py b/llvmpy/src/Support/Host.py index cd063e8..f7d361b 100644 --- a/llvmpy/src/Support/Host.py +++ b/llvmpy/src/Support/Host.py @@ -17,7 +17,7 @@ if LLVM_VERSION >= (3, 3): cast(Bool, bool)) else: - + isLittleEndianHost = sys.Function('isLittleEndianHost', cast(Bool, bool)) diff --git a/llvmpy/src/Support/StringRefMemoryObject.py b/llvmpy/src/Support/StringRefMemoryObject.py index f710626..a5ba0c1 100644 --- a/llvmpy/src/Support/StringRefMemoryObject.py +++ b/llvmpy/src/Support/StringRefMemoryObject.py @@ -16,7 +16,7 @@ if LLVM_VERSION >= (3, 4): readBytes = CustomMethod('MemoryObject_readBytes', PyObjectPtr, cast(int, Uint64), #address - cast(int, Uint64) #size + cast(int, Uint64) #size ) @CustomPythonMethod def readAll(self): diff --git a/llvmpy/src/Support/TargetRegistry.py b/llvmpy/src/Support/TargetRegistry.py index 8c70d4c..0635e2b 100644 --- a/llvmpy/src/Support/TargetRegistry.py +++ b/llvmpy/src/Support/TargetRegistry.py @@ -58,7 +58,7 @@ class Target: cast(str, StringRef), #cpu cast(str, StringRef) #features ) - + createMCDisassembler = Method(ptr(MCDisassembler), ref(MCSubtargetInfo)) createMCRegInfo = Method(ptr(MCRegisterInfo), diff --git a/llvmpy/src/Transforms/Utils/BasicBlockUtils.py b/llvmpy/src/Transforms/Utils/BasicBlockUtils.py index 8a571c2..8217f2e 100644 --- a/llvmpy/src/Transforms/Utils/BasicBlockUtils.py +++ b/llvmpy/src/Transforms/Utils/BasicBlockUtils.py @@ -13,4 +13,4 @@ SplitBlockAndInsertIfThen = llvm.Function('SplitBlockAndInsertIfThen', ReplaceInstWithInst = llvm.Function('ReplaceInstWithInst', Void, ptr(Instruction), # from - ptr(Instruction)) # to \ No newline at end of file + ptr(Instruction)) # to diff --git a/test/example-instruction-info.py b/test/example-instruction-info.py index 6467061..7ed79e5 100644 --- a/test/example-instruction-info.py +++ b/test/example-instruction-info.py @@ -35,4 +35,4 @@ def main(): return 0 -exit(main()) \ No newline at end of file +exit(main()) diff --git a/test/target_info.py b/test/target_info.py index ce0c9a8..2242bbb 100644 --- a/test/target_info.py +++ b/test/target_info.py @@ -1,4 +1,4 @@ -from llvmpy.api import llvm; +from llvmpy.api import llvm; llvm.InitializeAllTargets() llvm.InitializeAllTargetInfos() llvm.InitializeAllTargetMCs() diff --git a/test/testall.py b/test/testall.py index 367f250..8591123 100644 --- a/test/testall.py +++ b/test/testall.py @@ -300,7 +300,7 @@ def do_function(): f.add_attribute(ATTR_NO_RETURN) f.add_attribute(ATTR_ALWAYS_INLINE) #for some reason removeFnAttr is just gone in 3.3 - if version <= (3, 2): + if version <= (3, 2): f.remove_attribute(ATTR_NO_RETURN) # LLVM misbehaves: