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

375 Commits

Author SHA1 Message Date
Peter Collingbourne
eb8bba56de Fix bashism in build.sh.
llvm-svn: 220027
2014-10-17 02:20:40 +00:00
Peter Zotov
c5418e39bd [OCaml] Add Llvm.instr_clone.
llvm-svn: 220008
2014-10-17 01:02:40 +00:00
Peter Collingbourne
22590da2c9 Initial version of Go bindings.
This code is based on the existing LLVM Go bindings project hosted at:
https://github.com/go-llvm/llvm

Note that all contributors to the gollvm project have agreed to relicense
their changes under the LLVM license and submit them to the LLVM project.

Differential Revision: http://reviews.llvm.org/D5684

llvm-svn: 219976
2014-10-16 22:48:02 +00:00
Eric Christopher
2f6f860aaa Reinstate "Nuke the old JIT."
Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

This reinstates commits r215111, 215115, 215116, 215117, 215136.

llvm-svn: 216982
2014-09-02 22:28:02 +00:00
Peter Zotov
637a91873c [OCaml] Expose Llvm.get_operand_use.
Patch by Gabriel Radanne <drupyog@zoho.com>

llvm-svn: 215420
2014-08-12 02:55:45 +00:00
Eric Christopher
378bc328f0 Temporarily Revert "Nuke the old JIT." as it's not quite ready to
be deleted. This will be reapplied as soon as possible and before
the 3.6 branch date at any rate.

Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

This reverts commits r215111, 215115, 215116, 215117, 215136.

llvm-svn: 215154
2014-08-07 22:02:54 +00:00
Rafael Espindola
3b51160f99 Fix the ocaml bindings.
llvm-svn: 215117
2014-08-07 14:48:13 +00:00
Peter Zotov
4fc6b74b35 [OCaml] Add Llvm.{string_of_const,const_element}.
llvm-svn: 214677
2014-08-03 23:54:22 +00:00
Peter Zotov
f79b84b24e [OCaml] Don't truncate constants over 32 bits in Llvm.const_int.
llvm-svn: 213655
2014-07-22 13:55:20 +00:00
Gerolf Hoflehner
5fa7774dfd MergedLoadStoreMotion pass
Merges equivalent loads on both sides of a hammock/diamond
and hoists into into the header.
Merges equivalent stores on both sides of a hammock/diamond
and sinks it to the footer.
Can enable if conversion and tolerate better load misses
and store operand latencies.

llvm-svn: 213396
2014-07-18 19:13:09 +00:00
Peter Zotov
171cddf9b3 [OCaml] Documentation improvements.
Patch by Julien Sagot

llvm-svn: 212230
2014-07-02 22:17:20 +00:00
Peter Zotov
f99a42bc31 [OCaml] Documentation improvements.
llvm-svn: 212048
2014-06-30 16:53:53 +00:00
Peter Zotov
5c56850c1f [OCaml] Unbreak Llvm_target.TargetMachine.set_verbose_asm
Patch by Jacques-Pascal Deplaix

llvm-svn: 210480
2014-06-09 17:34:34 +00:00
Peter Zotov
06677a2162 [OCaml] Commit missing parts of r210395
llvm-svn: 210396
2014-06-07 15:53:28 +00:00
Peter Zotov
ec3618d58d [OCaml] Introduce an llmdkind abstract type.
Patch by Gabriel Radanne.

While this commit technically breaks API, no code should have supplied
the integer IDs directly, and thus no code should break.

llvm-svn: 210395
2014-06-07 15:15:10 +00:00
Peter Zotov
a7bda7bc0b [OCaml] Add an ocamlfind package llvm.all_backends.
This package is useful for architecture-independent tools like llc.

Patch by Jacques-Pascal Deplaix.

llvm-svn: 207793
2014-05-01 21:00:52 +00:00
Anders Waldenborg
f342831239 [python] Fix getting section contents.
The returnvalue was handled as c_char_p which ment that ctypes
handled it as a NUL-terminated string making it cut the contents
at first NUL (or even worse - overrunning the buffer if it doesn't
contain a NUL).

Differential Revision: http://reviews.llvm.org/D3474

llvm-svn: 207199
2014-04-25 06:25:15 +00:00
Anders Waldenborg
0a7dc3330f [python] Fix python bindings tests
Broke after the changes related to the LLVMGetSymbolFileOffset
removal in r206750

llvm-svn: 207018
2014-04-23 20:32:03 +00:00
Rafael Espindola
56c64fd6fd Convert getFileOffset to getOffset and move it to its only user.
We normally don't drop functions from the C API's, but in this case I think we
can:

* The old implementation of getFileOffset was fairly broken
* The introduction of LLVMGetSymbolFileOffset was itself a C api breaking
  change as it removed LLVMGetSymbolOffset.
* It is an incredibly specialized use case. The only reason MCJIT needs it is
  because of its odd position of being a dynamic linker of .o files.

llvm-svn: 206750
2014-04-21 13:45:32 +00:00
Michael Gottesman
eec992195b [python-bindings] Remove some cruft that snuck in.
llvm-svn: 201966
2014-02-23 04:43:26 +00:00
Michael Gottesman
436376bfbc [python-bindings] Added OpCode like support for all enumerations with unittests.
Also fixed some trailing whitespace issues.

llvm-svn: 201929
2014-02-22 05:39:35 +00:00
NAKAMURA Takumi
0c7582f249 Makefile.ocaml: Tweak to use --system-libs.
llvm-svn: 197758
2013-12-20 00:36:59 +00:00
Alp Toker
20f2bae8eb Fix documentation typos
llvm-svn: 197757
2013-12-20 00:33:39 +00:00
Peter Zotov
f783e4243e [OCaml] Add a slash accidentally omitted from Makefile
llvm-svn: 195912
2013-11-28 09:03:28 +00:00
Peter Zotov
4ae3b7518c [OCaml] Embed rpath into stub libraries and native executables
This commit embeds a set of linker flags with hardcoded paths to
the LLVM shared library on --enable-shared builds into .cmxa files
and stub dynamic libraries. This solution closely follows existing
rules for rpath in the LLVM tools, which had to be modified because
of differences in toolchain.

Without this patch, OCaml tests as well as opam bindings broke,
as neither of those updates LD_LIBRARY_PATH to include
the $prefix/lib directory.

llvm-svn: 195834
2013-11-27 11:03:18 +00:00
Peter Zotov
e3fdb03df7 [OCaml] Embed the flags necessary for linking with libLLVM.so into .cmxa files
llvm-svn: 195782
2013-11-26 20:40:34 +00:00
Peter Zotov
770a3bbabb [OCaml] Unbreak make install by providing ocamldoc target
llvm-svn: 195336
2013-11-21 10:10:16 +00:00
Anders Waldenborg
5adf625df0 python: Fix check for disasm creation failure
Check should be for pointer being NULL, not what it points to.

Also adds a test for this case.

Reviewed By: indygreg

Differential Revision: http://llvm-reviews.chandlerc.com/D1878

llvm-svn: 194965
2013-11-17 15:40:57 +00:00
Anders Waldenborg
9ee62020d6 python: Properly initialize before trying to create disasm
As the "LLVMInitializeAll*" functions are not available as symbols in
the shared library they can't be used, and as a workaround a list of
the targets is kept and the individual symbols tried. As soon as the
"All"-functions are changed to proper symbols (as opposed to static
inlines in the headers) this hack will be replace with simple calls
to the corresponding "LLVMInitializeAll*" functions.

Reviewed By: indygreg

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1879

llvm-svn: 194964
2013-11-17 15:17:08 +00:00
Peter Zotov
ec8c29b1d7 [OCaml] Add Target and TargetMachine bindings to Llvm_target
llvm-svn: 194774
2013-11-15 02:51:57 +00:00
Peter Zotov
5d089306c3 [OCaml] Refactor Llvm_target interface
This commit brings the module structure, argument order and
primitive names in Llvm_target in order with the rest of the bindings,
in preparation for adding TargetMachine API.

llvm-svn: 194773
2013-11-15 02:51:44 +00:00
Peter Zotov
e66ae0045d [OCaml] Fix building of stub libraries
llvm-svn: 194772
2013-11-15 02:51:27 +00:00
Peter Zotov
e0c727aff0 [OCaml] Build stub OCaml libraries for all configured targets
This allows to only link in the needed targets, reducing binary
size and more importantly link time.

Note that this is an incomplete implementation: currently,
LLVM does not have the plumbing which would allow to conditionally
link in AsmPrinter, AsmParser and Disassembler for the targets
which support them. This should be improved in the future.

llvm-svn: 194670
2013-11-14 06:34:21 +00:00
Peter Zotov
b192fa5024 [OCaml] Expose LLVM's fatal error and stacktrace APIs
llvm-svn: 194669
2013-11-14 06:34:13 +00:00
Peter Zotov
b163e08a96 [OCaml] Dynamically link LLVM on --enable-shared builds
This commit significantly speeds up both bytecode and native
builds of LLVM clients (from ~20 second to sub-second link time),
and allows to invoke LLVM functions from OCaml toplevel.

The behavior for --disable-shared builds is unchanged.

llvm-svn: 194509
2013-11-12 20:55:49 +00:00
Peter Zotov
215b4eb081 [OCaml] Fix a typo
llvm-svn: 194508
2013-11-12 20:55:42 +00:00
Peter Zotov
83f140c801 [OCaml] Add missing Llvm_target functions
llvm-svn: 194382
2013-11-11 14:47:28 +00:00
Peter Zotov
7456a45c87 [OCaml] Accept context explicitly in Llvm_target functions
Llvm_target.intptr_type used to implicitly use global context. As
none of other functions in OCaml bindings do, it is changed to
accept context explicitly.

llvm-svn: 194381
2013-11-11 14:47:20 +00:00
Peter Zotov
4625440ac9 [OCaml] Make Llvm_target.DataLayout.t automatically managed
This breaks the API by removing Llvm_target.DataLayout.dispose.

llvm-svn: 194380
2013-11-11 14:47:11 +00:00
Peter Zotov
fe15a570ea [OCaml] Impement Llvm_irreader, bindings to LLVM assembly parser
llvm-svn: 194138
2013-11-06 09:21:25 +00:00
Peter Zotov
7e2a601991 [OCaml] Implement Llvm.string_of_llvalue
llvm-svn: 194136
2013-11-06 09:21:08 +00:00
Peter Zotov
012a4ffd60 [OCaml] (PR16190) Add ValueKinds for ConstantDataSequential and subclasses
Original patch by David Monniaux

llvm-svn: 194075
2013-11-05 12:55:43 +00:00
Peter Zotov
09f34ca4b9 [OCaml] (PR16318) Add missing argument to Llvm.const_intcast
llvm-svn: 194065
2013-11-05 11:56:20 +00:00
Peter Zotov
118bf8ac38 [OCaml] (PR11717) Make declare_qualified_global respect address argument
Original patch by Jonathan Ragan-Kelley

llvm-svn: 194064
2013-11-05 11:56:13 +00:00
Peter Zotov
7bb25c41d3 [OCaml] Properly tag the custom operations of Llvm.llbuilder
All other custom operations tags have LLVM prefix.

llvm-svn: 194058
2013-11-05 09:13:46 +00:00
Peter Zotov
615991b419 [OCaml] Llvm_linker: do not use external in module interface
Workaround for an OCaml bug:
http://caml.inria.fr/mantis/view.php?id=4166

llvm-svn: 194057
2013-11-05 09:13:39 +00:00
Peter Zotov
4b13ee5f62 [OCaml] implement Llvm_passmgr_builder, bindings for PassManagerBuilder
llvm-svn: 193968
2013-11-04 01:39:42 +00:00
Peter Zotov
23e94a56d9 [OCaml] Documentation
llvm-svn: 193967
2013-11-04 01:39:31 +00:00
Peter Zotov
22f34b9373 [OCaml] Implement missing LLVMCore APIs
llvm-svn: 193966
2013-11-04 01:39:26 +00:00
Peter Zotov
d01f123fa7 [OCaml] Formatting
llvm-svn: 193965
2013-11-04 01:39:18 +00:00
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
Dylan Noblesmith
40dea4f20c drop unneeded config.h includes
llvm-svn: 147197
2011-12-22 23:04:07 +00:00
Daniel Dunbar
30d6a45140 LLVMBuild: Remove trailing newline, which irked me.
llvm-svn: 146409
2011-12-12 19:48:00 +00:00
Wojciech Matyjewicz
b017bc6c32 Minor fixes in Makefiles for the OCaml bindings:
1. Interface files (.mli) are installed before compiled interface
   files (.cmi) to preserve timestamp relation.
2. install-meta should use $(OcamlDir) instead of $(ObjDir).
3. Declared some targets as .PHONY.

Patch by Christophe Raffalli.

llvm-svn: 144183
2011-11-09 12:00:39 +00:00
Daniel Dunbar
3760ebeebb build: Add initial cut at LLVMBuild.txt files.
llvm-svn: 143634
2011-11-03 18:53:17 +00:00
Torok Edwin
ab8624db55 OCaml bindings: add some missing functions and testcases.
The C bindings exposed some APIs that weren't covered by the OCaml bindings

llvm-svn: 141997
2011-10-14 20:38:33 +00:00
Torok Edwin
562d70c5ec OCaml bindings: fix attributes to use all 32 bits
OCaml's int is limited to 31 bits on 32-bit architectures, so use Int32
explicitly.
Also add an unpack_attr, and {function,param,instr}_attr functions to read
the attributes.

llvm-svn: 141996
2011-10-14 20:38:24 +00:00
Torok Edwin
d75f74a0f2 OCaml bindings: add icmp_predicate
llvm-svn: 141995
2011-10-14 20:38:19 +00:00
Torok Edwin
39d89ea3b3 OCaml bindings: fix infinite recursion on string_of_lltype
llvm-svn: 141994
2011-10-14 20:38:14 +00:00
Torok Edwin
4beae25e5a bindings: named struct support
llvm-svn: 141993
2011-10-14 20:38:08 +00:00
Torok Edwin
50c1b48b4c ocaml bindings: add findlib META support
This makes it easier to link against LLVM libs, especially if you are using
_oasis.

llvm-svn: 141992
2011-10-14 20:38:02 +00:00
Torok Edwin
5ea77f1df2 ocaml bindings: introduce classify_value
llvm-svn: 141991
2011-10-14 20:37:56 +00:00
Torok Edwin
47a6a6a1fc ocaml bindings: add getopcode for constant and instruction, and int64_of_const.
llvm-svn: 141990
2011-10-14 20:37:49 +00:00
Torok Edwin
463c360a11 bindings: tab and indentation fixes of my previous commits
llvm-svn: 141989
2011-10-14 20:37:42 +00:00
Torok Edwin
e5135b07e8 ocaml/C bindings: type->isSized()
llvm-svn: 141288
2011-10-06 12:13:28 +00:00
Torok Edwin
413276a992 add binding to read icmp predicate
llvm-svn: 141287
2011-10-06 12:13:20 +00:00
Torok Edwin
b0b404e35f ocaml/C bindings: getmdstring, add num_op, get_op should work on metadata too
llvm-svn: 141286
2011-10-06 12:13:11 +00:00
Torok Edwin
76fc6a1a53 C/OCaml API to retrieve struct name.
llvm-svn: 141285
2011-10-06 12:12:50 +00:00
Torok Edwin
be951e90d4 ocaml bindings: add llvm_ipo based on IPO.h
llvm-svn: 141284
2011-10-06 12:12:27 +00:00
Torok Edwin
b7495041db attempt to fix ocaml bindings: landing pads
llvm-svn: 140991
2011-10-03 06:41:46 +00:00
Peter Collingbourne
7f188438d5 Remove the build_unwind function from the OCaml bindings.
llvm-svn: 137193
2011-08-10 01:10:17 +00:00
Benjamin Kramer
801c887f01 Remove InvalidateStructLayoutInfo from the ocaml bindings.
llvm-svn: 136582
2011-07-31 01:12:39 +00:00
Nick Lewycky
73c4468632 Update OCaml bindings. Opaque types are gone, type holders are gone and the
module operations that operate on type names are gone.

llvm-svn: 134839
2011-07-09 18:29:33 +00:00
Erick Tryzelaar
4a621556e4 Fix compiling the ocaml kaleidoscope tutorials
llvm-svn: 125202
2011-02-09 18:32:02 +00:00
Torok Edwin
2acdd67db2 Fix OCaml bindings crash, PR8847.
See http://caml.inria.fr/mantis/view.php?id=4166
If we call only external functions from a module, then its 'let _' bindings
don't get executed, which means that the exceptions don't get registered for use
in the C code.
This in turn causes llvm_raise to call raise_with_arg() with a NULL pointer and
cause a segmentation fault.

The workaround is to declare all 'external' functions as 'val' in these .mli
files.

Also added a separate testcase (the testcase must call only external functions
for the bug to occur).

llvm-svn: 122497
2010-12-23 15:49:26 +00:00
Eric Christopher
4d10241635 Try to fix ocaml bindings.
llvm-svn: 116021
2010-10-08 00:36:21 +00:00
Duncan Sands
2b3ed03649 Remove the Ada bindings which are unmaintained and unused. The project which
was the main putative user of the binding is actually maintaining its own
different binding, see http://git.ada.cx/cgi-bin/cgit.cgi/draco.git/

llvm-svn: 113960
2010-09-15 08:17:10 +00:00
Dale Johannesen
b3df2ff13d Add X86 MMX type to bitcode and Type.
(The Ada bindings probably need it too, but all the
obvious places to change say "do not edit this file".)

llvm-svn: 113618
2010-09-10 20:55:01 +00:00
Benjamin Kramer
4c15ccc237 Remove unions from the ocaml bindings.
llvm-svn: 112363
2010-08-28 09:47:42 +00:00
Bill Wendling
9e3d8d1a60 - Add the LinkerPrivateWeakDefAutoLinkage to the Ada bindings.
- Support the LinkerWeak*Linkage types in llvm-nm and in LinkModules.cpp.

llvm-svn: 111952
2010-08-24 20:00:52 +00:00
Bob Wilson
20b6ec47d1 Fix a typo.
llvm-svn: 111627
2010-08-20 14:54:37 +00:00
Erick Tryzelaar
68c31295f7 Expose LLVMSetOperand and LLVMGetNumOperands to llvm-c and ocaml.
llvm-svn: 111625
2010-08-20 14:51:22 +00:00
Erick Tryzelaar
429605f7cc Fix arguments to ocaml's llvm_params.
Thanks to Jianzhou Zhao for finding this.

llvm-svn: 111624
2010-08-20 14:51:16 +00:00
Bill Wendling
90b6422f2f Implement the "linker_private_weak" linkage type. This will be used for
Objective-C metadata types which should be marked as "weak", but which the
linker will remove upon final linkage. However, this linkage isn't specific to
Objective-C.

For example, the "objc_msgSend_fixup_alloc" symbol is defined like this:

      .globl l_objc_msgSend_fixup_alloc
      .weak_definition l_objc_msgSend_fixup_alloc
      .section __DATA, __objc_msgrefs, coalesced
      .align 3
l_objc_msgSend_fixup_alloc:
       .quad   _objc_msgSend_fixup
       .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

Currently only supported on Darwin platforms.

llvm-svn: 107433
2010-07-01 21:55:59 +00:00
Bill Wendling
59ef9bcc6d Revert r107205 and r107207.
llvm-svn: 107215
2010-06-29 22:34:52 +00:00
Bill Wendling
05a4c0b1f2 Introducing the "linker_weak" linkage type. This will be used for Objective-C
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:

       .globl l_objc_msgSend_fixup_alloc
       .weak_definition l_objc_msgSend_fixup_alloc
       .section __DATA, __objc_msgrefs, coalesced
       .align 3
l_objc_msgSend_fixup_alloc:
        .quad   _objc_msgSend_fixup
        .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

llvm-svn: 107205
2010-06-29 21:24:00 +00:00
Chris Lattner
caf521c6b4 add attributes and module level asm to the ocaml bindings,
patch by Patrick Walton!

llvm-svn: 100932
2010-04-10 17:52:58 +00:00
Erick Tryzelaar
0e12fd5fc2 Add OCaml tutorial to the examples.
llvm-svn: 97966
2010-03-08 19:32:27 +00:00
Erick Tryzelaar
a71d3b252d Add a LLVMWriteBitcodeToFD that exposes the raw_fd_ostream options.
llvm-svn: 97858
2010-03-06 00:30:06 +00:00
Erick Tryzelaar
0b21835716 Expose the rest of the llvm-c scalar opts to ocaml.
llvm-svn: 97685
2010-03-03 23:51:34 +00:00
Erick Tryzelaar
c99098f20d Rename some ocaml functions.
llvm-svn: 97684
2010-03-03 23:51:30 +00:00
Erick Tryzelaar
d513bd7f7d Expose the external functions for ocaml's execution engine as an optimization.
llvm-svn: 97683
2010-03-03 23:51:28 +00:00
Erick Tryzelaar
2825c880af Expose alignment and stack alignment attributes to llvm-c and ocaml.
llvm-svn: 97682
2010-03-03 23:51:25 +00:00
Erick Tryzelaar
9a8b7c41c3 Use the ocaml tag 0 since we are just returning an option value.
llvm-svn: 97612
2010-03-02 23:59:08 +00:00
Erick Tryzelaar
481b9b1d9f Don't use an ocaml keyword in an ocamldoc comment.
llvm-svn: 97611
2010-03-02 23:59:05 +00:00
Erick Tryzelaar
99a0f1ebff Expose the optimization level for the jit in ocaml.
llvm-svn: 97610
2010-03-02 23:59:03 +00:00
Erick Tryzelaar
f04f234444 Remove module providers from ocaml.
llvm-svn: 97609
2010-03-02 23:59:00 +00:00
Erick Tryzelaar
0b0e6ace2c Add support for use to ocaml.
llvm-svn: 97586
2010-03-02 20:32:32 +00:00
Erick Tryzelaar
264323d31e Add support getting the operands of a User to ocaml.
llvm-svn: 97414
2010-02-28 20:45:03 +00:00
Erick Tryzelaar
ff1a75de6d Add support for global aliases to ocaml.
llvm-svn: 97413
2010-02-28 20:44:58 +00:00
Erick Tryzelaar
c0bff2bbc9 Add support for inserting inline asm to ocaml.
llvm-svn: 97412
2010-02-28 20:44:53 +00:00