1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

225 Commits

Author SHA1 Message Date
Peter Zotov
47beae7a65 [OCaml] Implement Llvm.MemoryBuffer.{of_string,as_string}
llvm-svn: 193953
2013-11-03 08:27:45 +00:00
Peter Zotov
57d8f2c2e9 [OCaml] Fix ABI incompatibility
OCaml's type unit is not compatible with C's type void.

llvm-svn: 193952
2013-11-03 08:27:37 +00:00
Peter Zotov
aa2a604cf0 [OCaml] Implement Llvm_linker, bindings for the IR linker
llvm-svn: 193951
2013-11-03 08:27:32 +00:00
Peter Zotov
2aba543196 [OCaml] Implement Llvm_vectorize bindings
llvm-svn: 193950
2013-11-03 08:27:22 +00:00
Peter Zotov
500cb8d4ee [OCaml] Llvm_target: fix typo (Int_val instead of Int64_val)
llvm-svn: 193948
2013-11-03 08:27:08 +00:00
Peter Zotov
9e58e5ad83 [OCaml] Llvm_scalar_opts: add missing transforms
llvm-svn: 193946
2013-11-03 07:54:17 +00:00
Peter Zotov
d9e82e73c8 [OCaml] Llvm_ipo: add missing transforms
llvm-svn: 193945
2013-11-03 07:54:08 +00:00
Sylvestre Ledru
08e83c3930 OCaml bindings: fix typo
Patch by Peter Zotov

llvm-svn: 193851
2013-11-01 02:29:13 +00:00
Sylvestre Ledru
9f107a3782 OCaml bindings: remove unused DONT_BUILD_RELINKED from Makefiles
Patch by Peter Zotov

llvm-svn: 193847
2013-11-01 01:14:24 +00:00
Sylvestre Ledru
3cdf499ddf OCaml bindings: fix typo
Patch by Peter Zotov

llvm-svn: 193845
2013-11-01 01:10:58 +00:00
Sylvestre Ledru
8dbae1013d OCaml bindings: fix typo in documentation
Patch by Peter Zotov

llvm-svn: 193838
2013-11-01 00:30:02 +00:00
Sylvestre Ledru
f2e94c88f0 OCaml bindings: formatting
This commit only changes comments and documentation in OCaml bindings. The official name of the language is OCaml, and the usage is now consistent.

Patch by Peter Zotov

llvm-svn: 193836
2013-11-01 00:26:01 +00:00
Michael Gottesman
16531da862 [python-bindings] Added support for getting/setting operands of values and getting the number of operands of a value.
Also in the process did some cleanups for BasicBlock.

llvm-svn: 190477
2013-09-11 01:38:12 +00:00
Michael Gottesman
7e163e45bf [python-bindings] Added support for iterating over a basic blocks instructions, getting their name/dumping them, f/b iteration.
Tests are included.

llvm-svn: 190475
2013-09-11 01:17:38 +00:00
Michael Gottesman
ae12b893bc [python-bindings] Added support for iterating over a function's basic blocks, dumping/getting names of those bb, f/w iteration.
Tests are included.

llvm-svn: 190473
2013-09-11 01:01:40 +00:00
Michael Gottesman
b956e822b0 [python-bindings] Added support for getting a module's functions, iterating f/b over said functions, dumping/print name of functions.
Tests are included as well.

llvm-svn: 190471
2013-09-11 00:52:47 +00:00
Michael Gottesman
e9968bba4f [python-bindings] Export OpCode from core.py.
llvm-svn: 190468
2013-09-11 00:41:07 +00:00
Michael Gottesman
2df6576b7f [python-bindings] Added test for reading a module from bitcode.
llvm-svn: 190467
2013-09-11 00:41:05 +00:00
Michael Gottesman
e3e842d196 [python-bindings] Fixed 3 test failures caused by typos.
llvm-svn: 190465
2013-09-11 00:41:02 +00:00
Michael Gottesman
0c33b9c4e7 Fixed typo.
llvm-svn: 190459
2013-09-11 00:27:23 +00:00
Michael Gottesman
fafe55f90e [python-bindings] Added code for loading a module from bitcode, getset its datalayout, getset its target, dump it, print it to a file.
llvm-svn: 190458
2013-09-11 00:23:14 +00:00
Michael Gottesman
2e080516e5 [python-bindings] Added bindings for LLVMContextRef and a test for creating a new context or getting the global context.
llvm-svn: 190457
2013-09-11 00:23:10 +00:00
Michael Gottesman
81cbb207c8 [python-bindings] Implemented the PassRegistry class and the calls to initialize/shutdown llvm. Also included an initialize_llvm declaration.
llvm-svn: 190456
2013-09-11 00:23:08 +00:00
Michael Gottesman
27027c011f [python-bindings] Removed unused import byref from llvm/disassembler.py.
llvm-svn: 190455
2013-09-11 00:23:05 +00:00
Michael Gottesman
43af76e63d [python-bindings] Changed test_memory_buffer_create_from_file to just use the generic provided test_file instead of a binary.
llvm-svn: 190389
2013-09-10 06:58:00 +00:00
Michael Gottesman
c0820b7131 [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.

llvm-svn: 190388
2013-09-10 06:57:57 +00:00
Bill Wendling
f6be87cbaa We're in 3.4 land now.
llvm-svn: 181350
2013-05-07 20:31:28 +00:00
Andrew Kaylor
36788b2f65 Exposing MCJIT through C API
Re-submitting with fix for OCaml dependency problems (removing dependency on SectionMemoryManager when it isn't used).

Patch by Fili Pizlo

llvm-svn: 180720
2013-04-29 17:49:40 +00:00
Andrew Kaylor
be18a2273e Fixing OCAML bindings for MCJIT
llvm-svn: 180232
2013-04-25 00:03:58 +00:00
Gregory Szorc
dbb4e4372b [python] Add markup option to disassembler
Patch contributed by Wladimir J. van der Laan <laanwj@gmail.com>

llvm-svn: 169102
2012-12-01 21:57:30 +00:00
Anders Waldenborg
c07fe5ea4d [python] fix get_library()
Before this fix, the LLVM Python bindings on SVN trunk always fail with:
	Exception: LLVM shared library not found!
since it's still looking for a library named "LLVM-3.1svn".

Besides updating the LLVM version in the library name,
this patch also changes llvm.get_library() to make it possible to run
the unit tests without installing the LLVM shared library into a
default linker search path.

e.g. after this patch, running the llvm/python unit tests with:
LD_LIBRARY_PATH=../build/Debug+Asserts/lib nosetests -v bindings/python/llvm/tests/
would work on Linux.

Patch from Scott Tsai (with some minor modifications)

Patch also acked by Gregory Szorc

llvm-svn: 168390
2012-11-20 22:27:55 +00:00
Micah Villmow
4dcbb3e605 Fix a build error for ocaml bindings that was introduced with the TargetData --> DataLayout changes.
llvm-svn: 166309
2012-10-19 20:36:22 +00:00
Micah Villmow
c349103c68 Fix the ocaml binding breakage from TargetData -> DataLayout changes.
llvm-svn: 165406
2012-10-08 17:06:25 +00:00
Micah Villmow
fe3338a7eb Move TargetData to DataLayout.
llvm-svn: 165403
2012-10-08 16:39:34 +00:00
Nuno Lopes
9b3fce6457 add support for ocaml 3.12
llvm-svn: 163096
2012-09-02 14:42:56 +00:00
Bill Wendling
a3152cce75 Remove tabs.
llvm-svn: 160482
2012-07-19 00:23:13 +00:00
Anders Waldenborg
25b56d6bad [python] Add negative MemoryBuffer testcase
llvm-svn: 153248
2012-03-22 11:23:52 +00:00
Anders Waldenborg
423e630620 [python] Add some paths where to find test binary
Adds /usr/lib/debug early to list, as some systems (debian) have unstripped libs in there
Adds /lib/i386-linux-gnu for systems that does multiarch (debian)

llvm-svn: 153174
2012-03-21 08:34:58 +00:00
Anders Waldenborg
67c13466ff [python] Mark get_test_binary as not being a test
get_test_binary is a helper method, not a test, make sure nosetests
doesn't pick it up as a test.

llvm-svn: 153173
2012-03-21 08:18:19 +00:00
Gregory Szorc
6d2a379bd6 [llvm.py] Implement disassembler interface
It doesn't currently support the op info and symbol lookup callbacks,
but it is better than nothing.

llvm-svn: 152527
2012-03-11 02:32:56 +00:00
Gregory Szorc
668034d91a Revert "[llvm.py] Implement interface to enhanced disassembler"
Chris Lattner says the edis interface is going away. It doesn't make
sense to land something that will go away in the near future.

llvm-svn: 152508
2012-03-10 21:44:03 +00:00
Gregory Szorc
5b524ff3b9 [llvm.py] Implement interface to enhanced disassembler
This requires a C++ change to EDDisassembler's ctor to function properly
(the llvm::InitializeAll* functions aren't being called currently and
there is no way to call them from Python).

Code is partially tested and works well enough for initial commit. There
are probably many small bugs.

llvm-svn: 152506
2012-03-10 21:05:05 +00:00
Gregory Szorc
f4a4d195fb [llvm.py] Make LLVMObject.__del__ work if called during __init__
llvm-svn: 152505
2012-03-10 21:01:14 +00:00
Gregory Szorc
4fbb9a1b8f [llvm.py] Define enumerations from Core.h; add OpCode class
llvm-svn: 152483
2012-03-10 05:50:56 +00:00
Gregory Szorc
4c739d029b [llvm.py] Implement interface to object files
It is now possible to load object files and scan over sections, symbols,
and relocations! Includes test code with partial coverage.

llvm-svn: 152482
2012-03-10 04:41:24 +00:00
Gregory Szorc
5348ea33df [llvm.py] Make ObjectFile destructor work
Previous code had a double free in MemoryBuffer. The tests now pass.

llvm-svn: 152422
2012-03-09 18:56:33 +00:00
Gregory Szorc
3c13620c0e [llvm.py] Initial skeleton for Python LLVM bindings
This contains a semi-functional skeleton for the implementation of the
LLVM bindings for Python.

The API for the Object.h interface is roughly designed but not
implemented. MemoryBufferRef is implemented and actually appears to
work!

The ObjectFile unit test fails with a segmentation fault because the
LLVM library isn't being properly initialized. The build system doesn't
know about this code yet, so no alerts should fire.

llvm-svn: 152397
2012-03-09 09:07:35 +00:00
Benjamin Kramer
26c6e4b9e0 ocaml bindings: landing pad is now the last opcode.
llvm-svn: 149997
2012-02-07 18:58:19 +00:00
Jim Grosbach
84b2fe36c8 Tidy up. s/Low Level Virtual Machine/LLVM/.
LLVM isn't an acronym anymore.

llvm-svn: 148985
2012-01-25 22:00:23 +00:00
Bob Wilson
152a507523 Update OCaml bindings for the new half float type.
Patch by Jonathan Ragan-Kelley!

llvm-svn: 147314
2011-12-28 18:51:08 +00:00