summaryrefslogtreecommitdiff
path: root/bindings/python/llvm/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/python/llvm/core.py')
-rw-r--r--bindings/python/llvm/core.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bindings/python/llvm/core.py b/bindings/python/llvm/core.py
index 6756637425..bd61a6ac99 100644
--- a/bindings/python/llvm/core.py
+++ b/bindings/python/llvm/core.py
@@ -83,11 +83,17 @@ class MemoryBuffer(LLVMObject):
LLVMObject.__init__(self, memory, disposer=lib.LLVMDisposeMemoryBuffer)
+ def __len__(self):
+ return lib.LLVMGetBufferSize(self)
+
def register_library(library):
+ # Memory buffer declarations
library.LLVMCreateMemoryBufferWithContentsOfFile.argtypes = [c_char_p,
POINTER(c_object_p), POINTER(c_char_p)]
library.LLVMCreateMemoryBufferWithContentsOfFile.restype = bool
+ library.LLVMGetBufferSize.argtypes = [MemoryBuffer]
+
library.LLVMDisposeMemoryBuffer.argtypes = [MemoryBuffer]
def register_enumerations():