Commit graph

151 commits

Author SHA1 Message Date
Siu Kwan Lam
bba30621f1 Allow to_native_object & to_native_assembly to receive an optional fileobj to write to. 2012-10-10 10:47:56 -05:00
Siu Kwan Lam
323d432847 Implements Jun Koi's suggestion to improve consistency of the api:
* allow to_bitcode to return a string if no fileobj is defined.
* also modify from_bitcode and from_assembly to accept a string.
2012-09-26 10:19:35 -05:00
Siu Kwan Lam
0ee5e2e845 Raise TypeError when a function is called with the wrong argument.
Otherwise, llvm will give assertion error which is hard to trackdown.
2012-09-20 15:15:26 -07:00
Siu Kwan Lam
56796cad61 Follow up on pull request 21. Since PyCapsule_GetPointer returns NULL on error, we should check if the list element is Py_None. 2012-09-14 18:42:49 -07:00
Wladimir J. van der Laan
c94e852c0e MetaData operands can be None. Handle this. 2012-09-14 17:09:28 +02:00
Wladimir J. van der Laan
e2d8079b93 Support MetaDataString, and correctly represent MetaData Values in _make_value 2012-09-12 21:23:54 +02:00
Wladimir J. van der Laan
7f69beb258 Access to MetaData operands
This is not available in the C API, so add functions to extra.cpp:

- `LLVMMetaDataGetOperand` wraps MDNode::getOperand
- `LLVMMetaDataGetNumOperands` wraps MDNode::getNumOperands
2012-09-12 20:59:59 +02:00
Wladimir J. van der Laan
6e6bd1ea71 Add support for module named metadata
This is mainly useful to get access to top-level debug information through 'llvm.dbg.cu'.

Wraps LLVM C-API functions `LLVMGetNamedMetadataNumOperands`, `LLVMGetNamedMetadataOperands` and `LLVMAddNamedMetadataOperand`.

Also add testcase.
2012-09-12 20:03:24 +02:00
Siu Kwan Lam
47baa49160 Merge pull request #18 from laanwj/2012_09_constantint_value
Thanks!
2012-09-10 16:41:19 -07:00
Siu Kwan Lam
cc12434f57 Add thread local 2012-09-10 16:37:20 -07:00
Wladimir J. van der Laan
41953602bf Add ways to get the value of a ConstantInt
- property z_ext_value gets the zero-extended value using LLVMConstIntGetZExtValue
- property s_ext_value gets the sign-extended value using LLVMConstIntGetSExtValue
- add test case for both
2012-09-09 12:40:40 +02:00
Siu Kwan Lam
fbb7208b85 add invariant load
add related test
2012-09-06 20:00:01 -07:00
Siu Kwan Lam
82117d899e add support for metadata.
add related test.
2012-09-06 15:47:23 -07:00
Siu Kwan Lam
78cde30883 Revive inline_function() 2012-09-04 10:06:36 -07:00
Wladimir J. van der Laan
5bd4991f0b Implement property CallOrInvokeInstruction.called_function
Also add a testcase.
2012-09-02 13:23:47 +02:00
Siu Kwan Lam
5d14461c84 Fix ConstantExpr opcode to use C++ enum values.
Note: C++ opcode is different from C opcode values.
Add ConstantExpr opcode name.
Add test for these.
2012-09-01 20:53:33 -07:00
Wladimir J. van der Laan
c033ba02a4 Implement property ConstantExpr.opcode
Use LLVM C-API function `LLVMGetConstOpcode`
2012-09-01 17:33:55 +02:00
Siu Kwan Lam
38d4de35bb Make it possible to pass LLVM options from environment variables.
These options are parsed like commandline options to llc.
2012-08-26 21:00:56 -07:00
Mark Wiebe
bc2c9a24ed Support possibility of neither PTX backend being available 2012-08-23 09:27:30 -07:00
Siu Kwan Lam
d78253ebe3 Add control to alignment of ld/st inst 2012-08-21 18:28:35 -05:00
Siu Kwan Lam
d1bcdd05d1 add NVPTX for LLVM 3.2;
auto-gen _intrinsic_ids.py  in setup.py;
2012-08-18 15:29:26 -07:00
Jon Riehl
7c22f37b57 Adding support for building the "insertvalue" instruction. 2012-08-17 15:52:07 -05:00
Siu Kwan Lam
8b273490a9 Can create PTX target machine and print PTX asm 2012-08-14 16:50:32 -07:00
Siu Kwan Lam
f85713a736 Enable PTX backend 2012-08-14 15:05:22 -07:00
Siu Kwan Lam
bed4f24cbd Added Module.to_native_object() and Module.to_native_assembly().
Added test for these new functions.
2012-08-09 15:41:55 -07:00
Siu Kwan Lam
5e15b27909 Atomic load/store must explicit define alignment. 2012-08-03 14:13:22 -07:00
Siu Kwan Lam
f479f85676 Add memory fence 2012-08-03 12:30:01 -07:00
Siu Kwan Lam
6ac0f3c369 Add atomic load/store 2012-08-03 11:56:59 -07:00
Siu Kwan Lam
4d763680f6 Add easier atomic api 2012-08-03 10:28:17 -07:00
Siu Kwan Lam
fb72ab5c8d Add the rest of atomic op. 2012-08-03 10:14:09 -07:00
Siu Kwan Lam
acad5c9d8b Added atomic cmpxchg. 2012-08-02 17:54:40 -07:00
Siu Kwan Lam
9d068fd582 Add methods to set volatile inst. 2012-08-02 16:51:42 -07:00
Siu Kwan Lam
9aadd489c3 Python3 ready. Py2.7 and Py3 working. Drop PyCObject for all.
Pre Py2.7 support should be possible by including  "capsulethunk.h". (See llvm/wrap.h)
2012-07-26 15:25:23 -07:00
Siu Kwan Lam
6a02c36f04 Added PassManagerBuilder.
Updated test/passes.py for PassManagerBuilder.
2012-07-24 23:42:28 -07:00
Siu Kwan Lam
54a0a95faf Fix missing return in llvm/core.py and do some refactoring;
Update test/testall.py.

TODO: Need to update the passes.
2012-07-23 09:27:24 -07:00
Siu Kwan Lam
c9902ab8cf Add opaque StructType;
Remove test/typehandle.py;
Add test/opaque.py to demonstrate recursive type.
2012-07-22 15:14:52 -07:00
Siu Kwan Lam
b71d22b570 Update StructType to LLVM 3.x (incomplete).
Bring back StructType.elements.
2012-07-22 00:00:04 -07:00
Siu Kwan Lam
9bbeee519b Added Module.id property (getter+setter).
Updated test/asm.py to use unittest.
2012-07-20 20:15:21 -07:00
Travis E. Oliphant
8d064806a1 BUG: Add ConstantDataArray and ConstantD 2012-06-28 14:59:43 -05:00
Travis E. Oliphant
7b6aac79fb Add llvm::Module::addLibrary to exposed API 2012-06-21 01:25:23 -05:00
Travis E. Oliphant
3569ba6182 Update intrinsics and other codes for the 3.1 release. 2012-03-08 11:09:22 -06:00
Travis E. Oliphant
45177bbeb0 Add make_ufunc to llvm-py and additional fixes. 2012-02-18 04:20:21 -06:00
Travis E. Oliphant
76edfad7c8 Fix-up opcodes that are different in 3.0 2012-02-14 16:34:36 -06:00
Travis E. Oliphant
b4f51acd64 More changes to get working on LLVM 3.0 2012-02-09 23:40:22 -06:00
Travis E. Oliphant
c09903e54f Making progress towards a 3.0 version of llvm-py. 2012-02-08 01:40:03 -06:00
AndrewBC
6d50a337ad Updating to python 3 with 2to3. Check llvm/py3k_update.diff and llvm/py3k_update.out for the output from this. 2011-06-11 20:39:16 -05:00
AndrewBC
d5c2806b5d applied patch to work with llvm 2.9 from llvm-py r105 ... 84.7KB version seen here: http://code.google.com/p/llvm-py/issues/detail?id=37 2011-06-05 21:21:18 -05:00
mdevan.foobar
ae61530aff Use extract_value instead of getresult (Bryan Silverthorn) (Issue #34)
git-svn-id: http://llvm-py.googlecode.com/svn/trunk@103 8d1e9007-1d4e-0410-b67e-1979fd6579aa
2010-10-24 08:46:59 +00:00
mdevan.foobar
b7fa3e8fa1 Added llvm.core.Argument.alignment
git-svn-id: http://llvm-py.googlecode.com/svn/trunk@101 8d1e9007-1d4e-0410-b67e-1979fd6579aa
2010-10-15 10:33:37 +00:00
mdevan.foobar
ab4ef428b6 Migrate to LLVM 2.8 (rc2)
git-svn-id: http://llvm-py.googlecode.com/svn/trunk@96 8d1e9007-1d4e-0410-b67e-1979fd6579aa
2010-09-30 13:22:13 +00:00