[python bindings] Added code to get the length of a memory buffer. Tests are included.
authorMichael Gottesman <mgottesman@apple.com>
Tue, 10 Sep 2013 06:57:57 +0000 (06:57 +0000)
committerMichael Gottesman <mgottesman@apple.com>
Tue, 10 Sep 2013 06:57:57 +0000 (06:57 +0000)
commit653212fdd1f5b5eea1c5b7d4d28b3f6c8fd05bba
treecaab39a22536cd5c265b267034e86196f64ce71e
parentc3c9b9b7a8e36e17e629196d33f5c33eb690c2f8
[python bindings] Added code to get the length of a memory buffer. Tests are included.

This is a part of a series of patches that have been sitting fallow on a
personal branch that I have been messing with for a bit.

The patches start to flesh out the python llvm-c wrapper to the point where you can:

1. Load Modules from Bitcode/Dump/Print them.
2. Iterate over Functions from those modules/get their names/dump them.
3. Iterate over the BasicBlocks from said function/get the BB's name/dump it.
4. Iterate over the Instructions in said BasicBlocks/get the instructions
   name/dump the instruction.

My main interest in developing this was to be able to gather statistics about
LLVM IR using python scripts to speed up statistical profiling of different IR
level transformations (hence the focus on printing/dumping/getting names).

This is a gift from me to the LLVM community = ).

I am going to be committing the patches slowly over the next bit as I have time
to prepare the patches.

The overall organization follows the c-api like the bindings that are already
implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190388 91177308-0d34-0410-b5e6-96231b3b80d8
bindings/python/llvm/core.py
bindings/python/llvm/tests/base.py
bindings/python/llvm/tests/test_core.py
bindings/python/llvm/tests/test_file [new file with mode: 0644]