aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-c-test
AgeCommit message (Collapse)AuthorFilesLines
2016-06-15Add support for callsite in the new C API for attributesAmaury Sechet1-0/+16
Summary: The second consumer of attributes. Reviewers: Wallbraker, whitequark, echristo, rafael, jyknight Subscribers: mehdi_amini Differential Revision: http://reviews.llvm.org/D21266 llvm-svn: 272754
2016-06-12Make sure we have a Add/Remove/Has function for various thing that can have ↵Amaury Sechet1-1/+16
attribute. Summary: This also deprecated the get attribute function familly. Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael, jyknight Subscribers: axw, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19181 llvm-svn: 272504
2016-04-08[llvm-c] Expose LLVMContextGetDiagnostic{Handler,Context}Jeroen Ketema5-10/+108
Differential Revision: http://reviews.llvm.org/D18820 llvm-svn: 265773
2016-04-07Do some refactoring in the LLVM C API echo test to remove duplication. NFCAmaury Sechet1-70/+85
llvm-svn: 265641
2016-04-06[llvm-c] Add LLVMGetValueKind.Peter Zotov1-53/+69
Patch by Nicole Mazzuca <npmazzuca@gmail.com>. Differential Revision: http://reviews.llvm.org/D18729 llvm-svn: 265608
2016-04-05Revert "Fix Clang-tidy modernize-deprecated-headers warnings in remaining ↵Duncan P. N. Exon Smith2-29/+7
files; other minor fixes." This reverts commit r265454 since it broke the build. E.g.: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/22413/ llvm-svn: 265459
2016-04-05Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; ↵Eugene Zelenko2-7/+29
other minor fixes. Some Include What You Use suggestions were used too. Use anonymous namespaces in source files. Differential revision: http://reviews.llvm.org/D18778 llvm-svn: 265454
2016-04-05[llvm-c] Expose LLVM{Get,Set}ModuleIdentifierPeter Zotov1-2/+11
Patch by Nicole Mazzuca <npmazzuca@gmail.com>. Differential Revision: http://reviews.llvm.org/D18736 llvm-svn: 265394
2016-03-19Expose IRBuilder::CreateAtomicCmpXchg as LLVMBuildAtomicCmpXchg in the C API.Mehdi Amini1-0/+11
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-13Add echo test for constant data arrays in the LLVM C APIAmaury Sechet1-0/+10
llvm-svn: 263350
2016-02-18Add support for invoke/landingpad/resume in C API testAmaury Sechet1-1/+35
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-17Add upport for bitcast in the C API echo testAmaury Sechet1-1/+18
llvm-svn: 261177
2016-02-17Add support for memory operations (load/store/gep) in C API echo testAmaury Sechet1-0/+25
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-17Make sure functions are generated even there is no global in the C API echo testAmaury Sechet1-6/+10
llvm-svn: 261169
2016-02-17Add support for global variables in the C API echo testAmaury Sechet1-32/+138
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-16Make sure the functions' range is empty before going through it in the LLVM ↵Amaury Sechet1-0/+5
C API test llvm-svn: 260947
2016-02-16Do some refactoring in constant generation in the C API echo test. NFCAmaury Sechet1-8/+10
llvm-svn: 260941
2016-02-16Generate functions in 2 steps in the C API echo test. NFCAmaury Sechet1-6/+32
llvm-svn: 260939
2016-02-16Restore the capability to manipulate datalayout from the C APIAmaury Sechet1-0/+6
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-14Use report_fatal_error more consistently in the C API echo testAmaury Sechet1-73/+33
llvm-svn: 260849
2016-02-14Get constant cloning out of CloneValue so it can be used when creating globals.Amaury Sechet1-40/+47
llvm-svn: 260848
2016-02-14Move clone_params aroundAmaury Sechet1-78/+76
llvm-svn: 260846
2016-02-11Add support for phi nodes in the LLVM C API testAmaury Sechet1-18/+37
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-10Add support for struct in C API testAmaury Sechet1-77/+125
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-10Add binding for counting argument and find called value of call and invoke ↵Amaury Sechet1-2/+2
instruction from the C API. Summary: As per title. This remove the need to rely on internal knowledge of call and invoke instruction to find called value and argument count. Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker Differential Revision: http://reviews.llvm.org/D17054 llvm-svn: 260332
2016-02-09Split clone value and instruction in the echo C API testAmaury Sechet1-73/+77
Summary: This is a bit of refactoring required to be able to generate instruction in forward basic block. This, for instance, is a requirement for phi in loops. Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker Differential Revision: http://reviews.llvm.org/D17050 llvm-svn: 260324
2016-02-09Add icmp and conditional branches in the C API echo test.Amaury Sechet1-2/+20
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-09Add C binding for AllocaInst::getAllocatedTypeAmaury Sechet1-1/+2
Summary: Comes with an awesome test. Depends on D16912 Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16942 llvm-svn: 260313
2016-02-09Improve the C API echo test tool to emit basic block is the right order.Amaury Sechet1-214/+260
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-05Prefix external symbols in llvm-c-test.Benjamin Kramer10-46/+46
This makes it less likely to clash with other stuff that might be linked in by change, e.g. ncurses exposes an external function called simply "echo", so linking ncurses statically into the binary explodes in funny ways. llvm-svn: 259882
2016-02-05Add various binary operations in the LLVM C API echo testAmaury Sechet1-0/+72
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-05Add Support to llvm-c-test dependanciesAmaury Sechet1-0/+1
Summary: As per title. It is required and don't get linked in in some builds. Reviewers: chapuni, joker.eph Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16903 llvm-svn: 259853
2016-02-04Improve testing for the C APIAmaury Sechet8-6/+488
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-01-26Remove autoconf supportChris Bieneman1-29/+0
Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
2015-12-18Deprecate a few C APIs.Rafael Espindola3-13/+38
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-18Add a test for LLVMGetBitcodeModule.Rafael Espindola3-10/+25
llvm-svn: 255985
2015-12-18Reorganize the C API headers to improve build times.Eric Christopher1-0/+1
Type specific declarations have been moved to Type.h and error handling routines have been moved to ErrorHandling.h. Both are included in Core.h so nothing should change for projects directly including the headers, but transitive dependencies may be affected. llvm-svn: 255965
2015-01-28Fix build breakage caused by memory leaks in llvm-c-testBjorn Steinbrink1-0/+4
I accidently introduced those in r227319. llvm-svn: 227339
2015-01-28Fix LLVMSetMetadata and LLVMAddNamedMetadataOperand for single value MDNodesBjorn Steinbrink4-0/+48
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
2014-12-18Have llvm-c-test only use libLLVM if libLLVM has all the right components.Chris Bieneman1-3/+21
Summary: We should only have llvm-c-test use libLLVM if the library is built with the default set of components or if LLVM_DYLIB_COMPONENTS includes all the LLVM_LINK_COMPONENTS required for llvm-c-test. Making libLLVM always used causes build failures if libLLVM doesn't include all Reviewers: chapuni, ributzka Reviewed By: ributzka Subscribers: ributzka, llvm-commits Differential Revision: http://reviews.llvm.org/D6668 llvm-svn: 224541
2014-11-10[CMake] llvm-c-test: Use libLLVM.so if it is available.NAKAMURA Takumi1-0/+9
llvm-svn: 221592
2014-09-30Extend C disassembler API to allow specifying target featuresBradley Smith1-7/+13
llvm-svn: 218682
2014-04-21Convert getFileOffset to getOffset and move it to its only user.Rafael Espindola1-3/+2
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-01-08Use -std=gnu99 in tools/llvm-c-test/CMakeLists.txtRafael Espindola1-1/+1
With a current mingw (gcc 4.8.1) it looks like we hit some variation of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40278 The end result is that off_t is not defined and the build fails without this patch. llvm-svn: 198749
2013-12-10[CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.NAKAMURA Takumi1-1/+8
llvm-svn: 196908
2013-10-25llvm-c-test: Don't leak memory buffers.Benjamin Kramer1-0/+2
Detected by valgrind. llvm-svn: 193416
2013-10-23llvm-c-test: Make them C89-compliant.NAKAMURA Takumi5-15/+29
llvm-svn: 193254
2013-10-23Add llvm-c-test tool for testing llvm-cAnders Waldenborg11-0/+682
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