llvmlite 0.42.0__cp310-cp310-win_amd64.whl → 0.43.0rc1__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of llvmlite might be problematic. Click here for more details.
- llvmlite/__init__.py +3 -3
- llvmlite/_version.py +2 -2
- llvmlite/binding/__init__.py +18 -18
- llvmlite/binding/analysis.py +69 -69
- llvmlite/binding/common.py +34 -34
- llvmlite/binding/context.py +29 -29
- llvmlite/binding/dylib.py +45 -45
- llvmlite/binding/executionengine.py +330 -330
- llvmlite/binding/ffi.py +390 -390
- llvmlite/binding/initfini.py +73 -73
- llvmlite/binding/linker.py +20 -20
- llvmlite/binding/llvmlite.dll +0 -0
- llvmlite/binding/module.py +349 -349
- llvmlite/binding/object_file.py +82 -82
- llvmlite/binding/options.py +17 -17
- llvmlite/binding/orcjit.py +342 -342
- llvmlite/binding/passmanagers.py +939 -932
- llvmlite/binding/targets.py +450 -450
- llvmlite/binding/transforms.py +151 -151
- llvmlite/binding/typeref.py +198 -198
- llvmlite/binding/value.py +618 -618
- llvmlite/ir/__init__.py +11 -11
- llvmlite/ir/_utils.py +80 -80
- llvmlite/ir/builder.py +1119 -1119
- llvmlite/ir/context.py +20 -20
- llvmlite/ir/instructions.py +893 -893
- llvmlite/ir/module.py +246 -246
- llvmlite/ir/transforms.py +64 -64
- llvmlite/ir/types.py +614 -614
- llvmlite/ir/values.py +1217 -1217
- llvmlite/tests/__init__.py +57 -57
- llvmlite/tests/__main__.py +3 -3
- llvmlite/tests/customize.py +407 -407
- llvmlite/tests/refprune_proto.py +329 -329
- llvmlite/tests/test_binding.py +2585 -2582
- llvmlite/tests/test_ir.py +2729 -2729
- llvmlite/tests/test_refprune.py +557 -526
- llvmlite/tests/test_valuerepr.py +60 -60
- llvmlite/utils.py +29 -29
- {llvmlite-0.42.0.dist-info → llvmlite-0.43.0rc1.dist-info}/LICENSE +24 -24
- {llvmlite-0.42.0.dist-info → llvmlite-0.43.0rc1.dist-info}/LICENSE.thirdparty +225 -225
- {llvmlite-0.42.0.dist-info → llvmlite-0.43.0rc1.dist-info}/METADATA +1 -1
- llvmlite-0.43.0rc1.dist-info/RECORD +45 -0
- {llvmlite-0.42.0.dist-info → llvmlite-0.43.0rc1.dist-info}/WHEEL +1 -1
- llvmlite-0.42.0.dist-info/RECORD +0 -45
- {llvmlite-0.42.0.dist-info → llvmlite-0.43.0rc1.dist-info}/top_level.txt +0 -0
llvmlite/binding/object_file.py
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
from llvmlite.binding import ffi
|
|
2
|
-
from ctypes import (c_bool, c_char_p, c_char, c_size_t, string_at, c_uint64,
|
|
3
|
-
POINTER)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class SectionIteratorRef(ffi.ObjectRef):
|
|
7
|
-
def name(self):
|
|
8
|
-
return ffi.lib.LLVMPY_GetSectionName(self)
|
|
9
|
-
|
|
10
|
-
def is_text(self):
|
|
11
|
-
return ffi.lib.LLVMPY_IsSectionText(self)
|
|
12
|
-
|
|
13
|
-
def size(self):
|
|
14
|
-
return ffi.lib.LLVMPY_GetSectionSize(self)
|
|
15
|
-
|
|
16
|
-
def address(self):
|
|
17
|
-
return ffi.lib.LLVMPY_GetSectionAddress(self)
|
|
18
|
-
|
|
19
|
-
def data(self):
|
|
20
|
-
return string_at(ffi.lib.LLVMPY_GetSectionContents(self), self.size())
|
|
21
|
-
|
|
22
|
-
def is_end(self, object_file):
|
|
23
|
-
return ffi.lib.LLVMPY_IsSectionIteratorAtEnd(object_file, self)
|
|
24
|
-
|
|
25
|
-
def next(self):
|
|
26
|
-
ffi.lib.LLVMPY_MoveToNextSection(self)
|
|
27
|
-
|
|
28
|
-
def _dispose(self):
|
|
29
|
-
ffi.lib.LLVMPY_DisposeSectionIterator(self)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class ObjectFileRef(ffi.ObjectRef):
|
|
33
|
-
@classmethod
|
|
34
|
-
def from_data(cls, data):
|
|
35
|
-
return cls(ffi.lib.LLVMPY_CreateObjectFile(data, len(data)))
|
|
36
|
-
|
|
37
|
-
@classmethod
|
|
38
|
-
def from_path(cls, path):
|
|
39
|
-
with open(path, 'rb') as f:
|
|
40
|
-
data = f.read()
|
|
41
|
-
return cls(ffi.lib.LLVMPY_CreateObjectFile(data, len(data)))
|
|
42
|
-
|
|
43
|
-
def sections(self):
|
|
44
|
-
it = SectionIteratorRef(ffi.lib.LLVMPY_GetSections(self))
|
|
45
|
-
while not it.is_end(self):
|
|
46
|
-
yield it
|
|
47
|
-
it.next()
|
|
48
|
-
|
|
49
|
-
def _dispose(self):
|
|
50
|
-
ffi.lib.LLVMPY_DisposeObjectFile(self)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
ffi.lib.LLVMPY_CreateObjectFile.argtypes = [c_char_p, c_size_t]
|
|
54
|
-
ffi.lib.LLVMPY_CreateObjectFile.restype = ffi.LLVMObjectFileRef
|
|
55
|
-
|
|
56
|
-
ffi.lib.LLVMPY_DisposeObjectFile.argtypes = [ffi.LLVMObjectFileRef]
|
|
57
|
-
|
|
58
|
-
ffi.lib.LLVMPY_GetSections.argtypes = [ffi.LLVMObjectFileRef]
|
|
59
|
-
ffi.lib.LLVMPY_GetSections.restype = ffi.LLVMSectionIteratorRef
|
|
60
|
-
|
|
61
|
-
ffi.lib.LLVMPY_DisposeSectionIterator.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
62
|
-
|
|
63
|
-
ffi.lib.LLVMPY_MoveToNextSection.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
64
|
-
|
|
65
|
-
ffi.lib.LLVMPY_IsSectionIteratorAtEnd.argtypes = [
|
|
66
|
-
ffi.LLVMObjectFileRef, ffi.LLVMSectionIteratorRef]
|
|
67
|
-
ffi.lib.LLVMPY_IsSectionIteratorAtEnd.restype = c_bool
|
|
68
|
-
|
|
69
|
-
ffi.lib.LLVMPY_GetSectionName.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
70
|
-
ffi.lib.LLVMPY_GetSectionName.restype = c_char_p
|
|
71
|
-
|
|
72
|
-
ffi.lib.LLVMPY_GetSectionSize.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
73
|
-
ffi.lib.LLVMPY_GetSectionSize.restype = c_uint64
|
|
74
|
-
|
|
75
|
-
ffi.lib.LLVMPY_GetSectionAddress.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
76
|
-
ffi.lib.LLVMPY_GetSectionAddress.restype = c_uint64
|
|
77
|
-
|
|
78
|
-
ffi.lib.LLVMPY_GetSectionContents.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
79
|
-
ffi.lib.LLVMPY_GetSectionContents.restype = POINTER(c_char)
|
|
80
|
-
|
|
81
|
-
ffi.lib.LLVMPY_IsSectionText.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
82
|
-
ffi.lib.LLVMPY_IsSectionText.restype = c_bool
|
|
1
|
+
from llvmlite.binding import ffi
|
|
2
|
+
from ctypes import (c_bool, c_char_p, c_char, c_size_t, string_at, c_uint64,
|
|
3
|
+
POINTER)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SectionIteratorRef(ffi.ObjectRef):
|
|
7
|
+
def name(self):
|
|
8
|
+
return ffi.lib.LLVMPY_GetSectionName(self)
|
|
9
|
+
|
|
10
|
+
def is_text(self):
|
|
11
|
+
return ffi.lib.LLVMPY_IsSectionText(self)
|
|
12
|
+
|
|
13
|
+
def size(self):
|
|
14
|
+
return ffi.lib.LLVMPY_GetSectionSize(self)
|
|
15
|
+
|
|
16
|
+
def address(self):
|
|
17
|
+
return ffi.lib.LLVMPY_GetSectionAddress(self)
|
|
18
|
+
|
|
19
|
+
def data(self):
|
|
20
|
+
return string_at(ffi.lib.LLVMPY_GetSectionContents(self), self.size())
|
|
21
|
+
|
|
22
|
+
def is_end(self, object_file):
|
|
23
|
+
return ffi.lib.LLVMPY_IsSectionIteratorAtEnd(object_file, self)
|
|
24
|
+
|
|
25
|
+
def next(self):
|
|
26
|
+
ffi.lib.LLVMPY_MoveToNextSection(self)
|
|
27
|
+
|
|
28
|
+
def _dispose(self):
|
|
29
|
+
ffi.lib.LLVMPY_DisposeSectionIterator(self)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class ObjectFileRef(ffi.ObjectRef):
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_data(cls, data):
|
|
35
|
+
return cls(ffi.lib.LLVMPY_CreateObjectFile(data, len(data)))
|
|
36
|
+
|
|
37
|
+
@classmethod
|
|
38
|
+
def from_path(cls, path):
|
|
39
|
+
with open(path, 'rb') as f:
|
|
40
|
+
data = f.read()
|
|
41
|
+
return cls(ffi.lib.LLVMPY_CreateObjectFile(data, len(data)))
|
|
42
|
+
|
|
43
|
+
def sections(self):
|
|
44
|
+
it = SectionIteratorRef(ffi.lib.LLVMPY_GetSections(self))
|
|
45
|
+
while not it.is_end(self):
|
|
46
|
+
yield it
|
|
47
|
+
it.next()
|
|
48
|
+
|
|
49
|
+
def _dispose(self):
|
|
50
|
+
ffi.lib.LLVMPY_DisposeObjectFile(self)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
ffi.lib.LLVMPY_CreateObjectFile.argtypes = [c_char_p, c_size_t]
|
|
54
|
+
ffi.lib.LLVMPY_CreateObjectFile.restype = ffi.LLVMObjectFileRef
|
|
55
|
+
|
|
56
|
+
ffi.lib.LLVMPY_DisposeObjectFile.argtypes = [ffi.LLVMObjectFileRef]
|
|
57
|
+
|
|
58
|
+
ffi.lib.LLVMPY_GetSections.argtypes = [ffi.LLVMObjectFileRef]
|
|
59
|
+
ffi.lib.LLVMPY_GetSections.restype = ffi.LLVMSectionIteratorRef
|
|
60
|
+
|
|
61
|
+
ffi.lib.LLVMPY_DisposeSectionIterator.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
62
|
+
|
|
63
|
+
ffi.lib.LLVMPY_MoveToNextSection.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
64
|
+
|
|
65
|
+
ffi.lib.LLVMPY_IsSectionIteratorAtEnd.argtypes = [
|
|
66
|
+
ffi.LLVMObjectFileRef, ffi.LLVMSectionIteratorRef]
|
|
67
|
+
ffi.lib.LLVMPY_IsSectionIteratorAtEnd.restype = c_bool
|
|
68
|
+
|
|
69
|
+
ffi.lib.LLVMPY_GetSectionName.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
70
|
+
ffi.lib.LLVMPY_GetSectionName.restype = c_char_p
|
|
71
|
+
|
|
72
|
+
ffi.lib.LLVMPY_GetSectionSize.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
73
|
+
ffi.lib.LLVMPY_GetSectionSize.restype = c_uint64
|
|
74
|
+
|
|
75
|
+
ffi.lib.LLVMPY_GetSectionAddress.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
76
|
+
ffi.lib.LLVMPY_GetSectionAddress.restype = c_uint64
|
|
77
|
+
|
|
78
|
+
ffi.lib.LLVMPY_GetSectionContents.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
79
|
+
ffi.lib.LLVMPY_GetSectionContents.restype = POINTER(c_char)
|
|
80
|
+
|
|
81
|
+
ffi.lib.LLVMPY_IsSectionText.argtypes = [ffi.LLVMSectionIteratorRef]
|
|
82
|
+
ffi.lib.LLVMPY_IsSectionText.restype = c_bool
|
llvmlite/binding/options.py
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
from llvmlite.binding import ffi
|
|
2
|
-
from llvmlite.binding.common import _encode_string
|
|
3
|
-
from ctypes import c_char_p
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def set_option(name, option):
|
|
7
|
-
"""
|
|
8
|
-
Set the given LLVM "command-line" option.
|
|
9
|
-
|
|
10
|
-
For example set_option("test", "-debug-pass=Structure") would display
|
|
11
|
-
all optimization passes when generating code.
|
|
12
|
-
"""
|
|
13
|
-
ffi.lib.LLVMPY_SetCommandLine(_encode_string(name),
|
|
14
|
-
_encode_string(option))
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
ffi.lib.LLVMPY_SetCommandLine.argtypes = [c_char_p, c_char_p]
|
|
1
|
+
from llvmlite.binding import ffi
|
|
2
|
+
from llvmlite.binding.common import _encode_string
|
|
3
|
+
from ctypes import c_char_p
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def set_option(name, option):
|
|
7
|
+
"""
|
|
8
|
+
Set the given LLVM "command-line" option.
|
|
9
|
+
|
|
10
|
+
For example set_option("test", "-debug-pass=Structure") would display
|
|
11
|
+
all optimization passes when generating code.
|
|
12
|
+
"""
|
|
13
|
+
ffi.lib.LLVMPY_SetCommandLine(_encode_string(name),
|
|
14
|
+
_encode_string(option))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
ffi.lib.LLVMPY_SetCommandLine.argtypes = [c_char_p, c_char_p]
|