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

28 Commits

Author SHA1 Message Date
Mehdi Amini
906e0f5f55 Expose IRBuilder::CreateAtomicCmpXchg as LLVMBuildAtomicCmpXchg in the C API.
Summary: Also expose getters and setters in the C API, so that the change can be tested.

Reviewers: nhaehnle, axw, joker.eph

Subscribers: llvm-commits

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

From: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
llvm-svn: 263886
2016-03-19 21:28:28 +00:00
Amaury Sechet
bd13303f63 Add echo test for constant data arrays in the LLVM C API
llvm-svn: 263350
2016-03-13 00:58:25 +00:00
Amaury Sechet
c379e9149e Add support for invoke/landingpad/resume in C API test
Summary: As per title. There was a lot of part missing in the C API, so I had to extend the invoke and landingpad API.

Reviewers: echristo, joker.eph, Wallbraker

Subscribers: llvm-commits

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

llvm-svn: 261254
2016-02-18 20:38:32 +00:00
Amaury Sechet
71fa6fafdf Add support for memory operations (load/store/gep) in C API echo test
Summary: As per title.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

llvm-svn: 261174
2016-02-17 22:51:03 +00:00
Amaury Sechet
3d8d25176e Add support for global variables in the C API echo test
Summary: As per title

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

llvm-svn: 261164
2016-02-17 22:13:33 +00:00
Amaury Sechet
a0396b8473 Make sure the functions' range is empty before going through it in the LLVM C API test
llvm-svn: 260947
2016-02-16 08:37:01 +00:00
Amaury Sechet
34464e942c Restore the capability to manipulate datalayout from the C API
Summary:
This consist in variosu addition to the C API:

  LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M);
  void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL);
  LLVMTargetDataRef LLVMCreateTargetMachineData(LLVMTargetMachineRef T);

Reviewers: joker.eph, Wallbraker, echristo

Subscribers: axw

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

llvm-svn: 260936
2016-02-16 05:11:24 +00:00
Amaury Sechet
acebdda8cc Add support for phi nodes in the LLVM C API test
Summary: This required to add binding to Instruction::removeFromParent so that instruction can be forward declared and then moved at the right place.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

llvm-svn: 260597
2016-02-11 21:37:54 +00:00
Amaury Sechet
ecd50f3e0c Add support for struct in C API test
Summary: As per title. This also include extra support for insertvalue and extracvalue.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

llvm-svn: 260335
2016-02-10 00:38:50 +00:00
Amaury Sechet
352aef6336 Add icmp and conditional branches in the C API echo test.
Summary:
Improving coverage.

Depends on D16912 .

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

llvm-svn: 260321
2016-02-09 23:15:02 +00:00
Amaury Sechet
ef4c99d35b Improve the C API echo test tool to emit basic block is the right order.
Summary: As per title. Also add a facility method to get the name of a basic block from the C API.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

llvm-svn: 260309
2016-02-09 22:36:41 +00:00
Reid Kleckner
8fbada61d0 Fix echo.ll test failing due to DOS line endings
llvm-svn: 259896
2016-02-05 18:21:28 +00:00
Amaury Sechet
9f9b1d8649 Add various binary operations in the LLVM C API echo test
Summary: This diff increase the tested surface of the C API.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

llvm-svn: 259863
2016-02-05 01:27:11 +00:00
Amaury Sechet
e2c912cc97 Improve testing for the C API
Summary:
This basically add an echo test case in C. The support is limited right now, but full support would just be too much to review at once.

The echo test case simply get a module as input and try to output the same exact module. This allow to check the both reading and writing API are working as expected.

I want to improve this test over time to support more and more of the API, in order to improve coverage (coverage is quite poor right now).

Test Plan: Run the test.

Reviewers: chandlerc, bogner

Subscribers: llvm-commits

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

llvm-svn: 259844
2016-02-04 23:26:19 +00:00
Rafael Espindola
e392243a54 Deprecate a few C APIs.
This deprecates:
* LLVMParseBitcode
* LLVMParseBitcodeInContext
* LLVMGetBitcodeModuleInContext
* LLVMGetBitcodeModule

They are replaced with the functions with a 2 suffix which do not record
a diagnostic.

llvm-svn: 256065
2015-12-18 23:46:42 +00:00
Rafael Espindola
a61d61e740 Fix error handling in LLVMGetBitcodeModuleInContext.
It was not setting OutMessage.

llvm-svn: 255998
2015-12-18 13:58:05 +00:00
Rafael Espindola
493b2dfc10 Add a test for LLVMGetBitcodeModule.
llvm-svn: 255985
2015-12-18 03:57:26 +00:00
Vaivaswatha Nagaraj
a478a7d3d6 Add InaccessibleMemOnly and inaccessibleMemOrArgMemOnly attributes
Summary:
This patch introduces two new function attributes 

InaccessibleMemOnly: This attribute indicates that the function may only access memory that is not accessible by the program/IR being compiled. This is a weaker form of ReadNone.
inaccessibleMemOrArgMemOnly: This attribute indicates that the function may only access memory that is either not accessible by the program/IR being compiled, or is pointed to by its pointer arguments. This is a weaker form of  ArgMemOnly

Test cases have been updated. This revision uses this (d001932f3a) as reference.

Reviewers: jmolloy, hfinkel

Subscribers: reames, joker.eph, llvm-commits

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

llvm-svn: 255778
2015-12-16 16:16:19 +00:00
James Molloy
be569ad3b9 Add a new attribute: norecurse
This attribute allows the compiler to assume that the function never recurses into itself, either directly or indirectly (transitively). This can be used among other things to demote global variables to locals.

llvm-svn: 252282
2015-11-06 10:32:53 +00:00
Justin Bogner
26beefcbae test: Move target dependent test in their own folder for c API test
Dissasembly tests depends on target. The problem is that it disable
all tests if all targets are not compiled. This moves things around in
order to get target specific code in a target specific folder.

Patch by Amaury Sechet. Thanks!

llvm-svn: 240380
2015-06-23 06:46:54 +00:00
Rafael Espindola
40410a9efa Propagate a better error message to the C api.
llvm-svn: 227934
2015-02-03 01:53:03 +00:00
Rafael Espindola
c8c6c9e6c7 Use a non-fatal diag handler in the C API. FIxes PR22368.
llvm-svn: 227903
2015-02-03 00:49:57 +00:00
Bjorn Steinbrink
6cbebb1e6a Fix LLVMSetMetadata and LLVMAddNamedMetadataOperand for single value MDNodes
Summary:
MetadataAsValue uses a canonical format that strips the MDNode if it
contains only a single constant value. This triggers an assertion when
trying to cast the value to a MDNode.

Subscribers: llvm-commits

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

llvm-svn: 227319
2015-01-28 16:35:59 +00:00
Bradley Smith
4388d0e70f Extend C disassembler API to allow specifying target features
llvm-svn: 218682
2014-09-30 16:31:40 +00:00
Bjorn Steinbrink
a2eead0028 Restore the ability to check if LLVMCreateObjectFile was successful
Summary:
Until r216870 LLVMCreateObjectFile returned nullptr in case of an error,
so callers could check if the call was successful. Now, it always
returns an OwningBinary wrapped as an LLVMObjectFileRef, so callers
can't check if the call was successul.

This results in a segfault running e.g.

 llvm-c-test --object-list-sections < /dev/null

So the old behaviour should be restored.

Subscribers: llvm-commits

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

llvm-svn: 217279
2014-09-05 21:22:09 +00:00
Alp Toker
03b6e12fae Reduce verbiage of lit.local.cfg files
We can just split targets_to_build in one place and make it immutable.

llvm-svn: 210496
2014-06-09 22:42:55 +00:00
Anders Waldenborg
37694f9f85 Fix check for supported targets in llvm-c lit.local.cfg
llvm-svn: 193235
2013-10-23 08:47:52 +00:00
Anders Waldenborg
94fc29186e Add llvm-c-test tool for testing llvm-c
This provides rudimentary testing of the llvm-c api.

The following commands are implemented:

  * --module-dump
    Read bytecode from stdin - print ir

  * --module-list-functions
    Read bytecode from stdin - list summary of functions

  * --module-list-globals
    Read bytecode from stdin - list summary of globals

  * --targets-list
    List available targets

  * --object-list-sections
    Read object file from stdin - list sections

  * --object-list-symbols
    Read object file from stdin - list symbols (like nm)

  * --disassemble
    Read lines of triple, hex ascii machine code from stdin - print disassembly

  * --calc
    Read lines of name, rpn from stdin - print generated module ir

Differential-Revision: http://llvm-reviews.chandlerc.com/D1776
llvm-svn: 193233
2013-10-23 08:10:20 +00:00