summaryrefslogtreecommitdiffstats
path: root/llvm/bindings/ocaml
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Fix trivial typos in commentsJames Henderson2020-01-061-1/+1
| | | | | | | | Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D72143 Patch by Kazuaki Ishizaki.
* [Test] Fix freeze ocaml test failureJuneyoung Lee2019-11-223-0/+14
|
* Reapply r374743 with a fix for the ocaml bindingJoerg Sonnenberger2019-10-143-0/+14
| | | | | | | | | | | | | | | | | | | Add a pass to lower is.constant and objectsize intrinsics This pass lowers is.constant and objectsize intrinsics not simplified by earlier constant folding, i.e. if the object given is not constant or if not using the optimized pass chain. The result is recursively simplified and constant conditionals are pruned, so that dead blocks are removed even for -O0. This allows inline asm blocks with operand constraints to work all the time. The new pass replaces the existing lowering in the codegen-prepare pass and fallbacks in SDAG/GlobalISEL and FastISel. The latter now assert on the intrinsics. Differential Revision: https://reviews.llvm.org/D65280 llvm-svn: 374784
* Revert "Add a pass to lower is.constant and objectsize intrinsics"Dmitri Gribenko2019-10-142-11/+0
| | | | | | | This reverts commit r374743. It broke the build with Ocaml enabled: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19218 llvm-svn: 374768
* Add a pass to lower is.constant and objectsize intrinsicsJoerg Sonnenberger2019-10-132-0/+11
| | | | | | | | | | | | | | | | | This pass lowers is.constant and objectsize intrinsics not simplified by earlier constant folding, i.e. if the object given is not constant or if not using the optimized pass chain. The result is recursively simplified and constant conditionals are pruned, so that dead blocks are removed even for -O0. This allows inline asm blocks with operand constraints to work all the time. The new pass replaces the existing lowering in the codegen-prepare pass and fallbacks in SDAG/GlobalISEL and FastISel. The latter now assert on the intrinsics. Differential Revision: https://reviews.llvm.org/D65280 llvm-svn: 374743
* Revert "[OCaml] Handle nullptr in Llvm.global_initializer"Dmitri Gribenko2019-10-013-16/+4
| | | | | | | This reverts commit r373299. It broke tests: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18485 llvm-svn: 373311
* [OCaml] Handle nullptr in Llvm.global_initializerAditya Kumar2019-10-013-4/+16
| | | | | | | | | | | | | | LLVMGetInitializer returns nullptr in case there is no initializer. There is not much that can be done with nullptr in OCaml, not even test if it is null. Also, there does not seem to be a C or OCaml API to test if there is an initializer. So this diff changes Llvm.global_initializer to return an option. Differential Revision: https://reviews.llvm.org/D65195 Reviewed by: whitequark Authored by: kren1 llvm-svn: 373299
* [LLVM-C][Ocaml] Add MergeFunctions and DCE passAditya Kumar2019-09-296-0/+27
| | | | | | | | | | | | | | | | | | | MergeFunctions and DCE pass are missing from OCaml/C-api. This patch adds them. Differential Revision: https://reviews.llvm.org/D65071 Reviewers: whitequark, hiraditya, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Tags: #llvm Authored by: kren1 llvm-svn: 373170
* [OCaml] Update api to account for FNeg and CallBr instructionswhitequark2019-04-163-1/+5
| | | | | | | | | | | | | | | | | | Summary: This diff adds minimal support for the recent FNeg and CallBr instructions to the OCaml bindings. Reviewers: whitequark Reviewed By: whitequark Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60680 llvm-svn: 358501
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1945-180/+150
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [OCaml] Fix incorrect use of CAMLlocal in nested blockswhitequark2018-11-081-4/+3
| | | | | | | | | | | | | | | | | | | | | | Summary: The OCaml manual states: > Local variables of type value must be declared with one of the > CAMLlocal macros. [...] These macros must be used at the beginning > of the function, not in a nested block. This patch moves several instances of CAMLlocal macros from nested blocks to the function beginning. Reviewers: whitequark Reviewed By: whitequark Subscribers: CodaFi, llvm-commits Differential Revision: https://reviews.llvm.org/D53841 llvm-svn: 346387
* [TI removal] Remove TerminatorInst references from bindings.Chandler Carruth2018-10-181-3/+3
| | | | | | | | | | For the Go bindings, this just removes the no longer useful "isa"-style wrapper. If there is a user that is interested, they can add a wrapper for `Instruction::isTerminator`. For the OCaml bindings, this is just a documentation update. llvm-svn: 344726
* [LLVM-C][OCaml] Add UnifyFunctionExitNodes pass to C and OCaml APIswhitequark2018-09-183-0/+14
| | | | | | | | | | | | | | | | Summary: Adds LLVMAddUnifyFunctionExitNodesPass to expose createUnifyFunctionExitNodesPass to the C and OCaml APIs. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52212 llvm-svn: 342476
* [LLVM-C][OCaml] Add LowerAtomic pass to C and OCaml APIswhitequark2018-09-183-0/+14
| | | | | | | | | | | | | | | | Summary: Adds LLVMAddLowerAtomicPass to expose createLowerAtomicPass in the C and OCaml APIs. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D52211 llvm-svn: 342475
* [OCaml] Add OCaml API for LLVMGetIndiceswhitequark2018-09-183-0/+19
| | | | | | | | | | | | | | | | | | Summary: This patch adds a thin wrapper around LLVMGetNumIndices and LLVMGetIndices to return the indices of ExtractValue or InsertValue instructions as an OCaml array. It has not seemed to be necessary to expose LLVMGetNumIndices separately. Reviewers: whitequark Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52207 llvm-svn: 342474
* [OCaml] Add OCaml API for LLVMIsCleanupwhitequark2018-09-183-0/+10
| | | | | | | | | | | | | | Summary: Expose test for whether or not a landingpad is a cleanup. Reviewers: whitequark Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52205 llvm-svn: 342438
* [NFC][OCaml] Fix copy paste error in file headerwhitequark2018-09-181-1/+1
| | | | | | | | | | | | | | Summary: Just copypasta resulting in the wrong file name in the header. Reviewers: whitequark Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52215 llvm-svn: 342437
* [NFC][OCaml] Fix implicit declaration compilation warningswhitequark2018-09-181-0/+1
| | | | | | | | | | | | | | | | | Summary: 2dd4f35c7fc75639920ebc473a4a57ea91864c10 moved LLVMAddLowerSwitchPass and LLVMAddPromoteMemoryToRegisterPass declarations from llvm-c/Transforms/Scalar.h to llvm-c/Transforms/Utils.h Reviewers: whitequark Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52214 llvm-svn: 342436
* [LLVM-C][OCaml] Add C and OCaml APIs for llvm::StructType::isLiteralwhitequark2018-09-183-0/+10
| | | | | | | | | | | | | | | | | Summary: This patch adds LLVMIsLiteralStruct to the C API to expose StructType::isLiteral. This is then used to implement the analogous addition to the OCaml API. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52209 llvm-svn: 342435
* [OCaml] Add OCaml APIs for Invoke arguments and destinationswhitequark2018-09-183-2/+23
| | | | | | | | | | | | | | | | | Summary: This patch adds OCaml APIs for LLVMGetNormalDest and LLVMGetUnwindDest on InvokeInsts, as well as LLVMGetNumArgOperands on CallInsts and InvokeInsts. Reviewers: whitequark Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52204 llvm-svn: 342433
* [OCaml] Add GlobalIFunc value kind to OCaml APIwhitequark2018-09-183-0/+4
| | | | | | | | | | | | | | | | | | Summary: The GlobalIFunc value kind has not yet been added to the OCaml API. This patch only extends the enum, so that e.g. classify_value will not crash. No support for manipulating or building GlobalIFuncs is added at this point. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52198 llvm-svn: 342429
* [OCaml] Add Token type to kind enum in OCaml APIwhitequark2018-09-182-0/+2
| | | | | | | | | | | | | | | | | | Summary: The token type has not yet been added to the OCaml API. This patch only extends the enum, so that e.g. classify_type will not crash. No support for manipulating or building tokens is added at this point. Reviewers: whitequark Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52197 llvm-svn: 342428
* [OCaml] Add missing instruction opcodes to OCaml APIwhitequark2018-09-183-1/+13
| | | | | | | | | | | | | | | | | Summary: The OCaml bindings have become out of date and several opcodes have been added to the C API without corresponding additions to the OCaml API. Reviewers: whitequark, mgorny Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52196 llvm-svn: 342427
* [LLVM-C] [OCaml] Remove LLVMAddBBVectorizePassFangrui Song2018-05-283-14/+0
| | | | | | | | | | | | Summary: It was fully replaced back in 2014, and the implementation was removed 11 months ago by r306797. Reviewers: hfinkel, chandlerc, whitequark, deadalnix Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47436 llvm-svn: 333378
* IWYU for llvm-config.h in llvm, additions.Nico Weber2018-04-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See r331124 for how I made a list of files missing the include. I then ran this Python script: for f in open('filelist.txt'): f = f.strip() fl = open(f).readlines() found = False for i in xrange(len(fl)): p = '#include "llvm/' if not fl[i].startswith(p): continue if fl[i][len(p):] > 'Config': fl.insert(i, '#include "llvm/Config/llvm-config.h"\n') found = True break if not found: print 'not found', f else: open(f, 'w').write(''.join(fl)) and then looked through everything with `svn diff | diffstat -l | xargs -n 1000 gvim -p` and tried to fix include ordering and whatnot. No intended behavior change. llvm-svn: 331184
* [NFC] fix trivial typos in comments and documentsHiroshi Inoue2018-01-261-1/+1
| | | | | | "in in" -> "in", "on on" -> "on" etc. llvm-svn: 323508
* Reverting r315590; it did not include changes for llvm-tblgen, which is ↵Aaron Ballman2017-10-151-1/+1
| | | | | | | | causing link errors for several people. Error LNK2019 unresolved external symbol "public: void __cdecl `anonymous namespace'::MatchableInfo::dump(void)const " (?dump@MatchableInfo@?A0xf4f1c304@@QEBAXXZ) referenced in function "public: void __cdecl `anonymous namespace'::AsmMatcherEmitter::run(class llvm::raw_ostream &)" (?run@AsmMatcherEmitter@?A0xf4f1c304@@QEAAXAEAVraw_ostream@llvm@@@Z) llvm-tblgen D:\llvm\2017\utils\TableGen\AsmMatcherEmitter.obj 1 llvm-svn: 315854
* [dump] Remove NDEBUG from test to enable dump methods [NFC]Don Hinton2017-10-121-1/+1
| | | | | | | | | | | | | | | Summary: Add LLVM_FORCE_ENABLE_DUMP cmake option, and use it along with LLVM_ENABLE_ASSERTIONS to set LLVM_ENABLE_DUMP. Remove NDEBUG and only use LLVM_ENABLE_DUMP to enable dump methods. Move definition of LLVM_ENABLE_DUMP from config.h to llvm-config.h so it'll be picked up by public headers. Differential Revision: https://reviews.llvm.org/D38406 llvm-svn: 315590
* [OCaml] Fix undefined reference to LLVMDumpType() with NDEBUGMichal Gorny2017-07-273-0/+11
| | | | | | | | | | | | | | | Account for the possibility of LLVMDumpType() not being available with NDEBUG in the OCaml bindings. If it is not built into LLVM, make the dump function raise an exception. Since rL293359, the dump functions are built only if either NDEBUG is not defined, or LLVM_ENABLE_DUMP is defined. As a result, if the dump functions are not built in LLVM, the dynamic OCaml libraries fail to load due to undefined LLVMDumpType symbol. Differential Revision: https://reviews.llvm.org/D35899 llvm-svn: 309321
* [NFC] Remove multiple semicolonsMandeep Singh Grang2017-06-281-1/+1
| | | | | | | | | | | | Reviewers: bogner, whitequark, mgrang Reviewed By: mgrang Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34785 llvm-svn: 306613
* [LLVM-C] [OCaml] Expose Type::subtypes.whitequark2017-06-053-0/+19
| | | | | | | | | | | | | The C functions added are LLVMGetNumContainedTypes and LLVMGetSubtypes. The OCaml function added is Llvm.subtypes. Patch by Ekaterina Vaartis. Differential Revision: https://reviews.llvm.org/D33677 llvm-svn: 304709
* [OCaml] Adapt to the new attribute C API.whitequark2016-11-123-226/+279
| | | | llvm-svn: 286705
* cmake: Install the OCaml libraries into a more correct pathMichal Gorny2016-09-304-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a OCAML_INSTALL_PATH variable that can be used to control the install path for OCaml libraries. The new variable defaults to ${OCAML_STDLIB_PATH}, i.e. the OCaml library path obtained from the OCaml compiler. Install libraries into "llvm" subdirectory. This fixes two issues: 1. OCaml library directories differ between systems, and 'lib/ocaml' is incorrect e.g. on amd64 Gentoo where OCaml is installed in 'lib64/ocaml'. Therefore, obtain the library path from the OCaml compiler using 'ocamlc -where' (which is already used to set OCAML_STDLIB_PATH), which is the method used commonly in OCaml packages. 2. The top-level directory is reserved for the standard library, and has precedence over local directory in search path. As a result, OCaml preferred the files installed along with previous LLVM version over the source tree when building a new version, resulting in two versions being mixed during the build. The new layout is used commonly by other OCaml packages, and findlib is able to find the LLVM libraries successfully. Bug: https://bugs.gentoo.org/559134 Bug: https://bugs.gentoo.org/559624 Differential Revision: https://reviews.llvm.org/D24354 llvm-svn: 282895
* [CMake] [OCaml] Allow building OCaml bindings out of tree.Peter Zotov2016-09-051-0/+29
| | | | | | | | | That is, add build system support for building the OCaml bindings against preinstalled LLVM libraries. This is important for package managers such as OPAM, because OCaml libraries need to be built against a specific OCaml compiler installation. llvm-svn: 280642
* [OCaml] Add functions for accessing metadata nodes.Peter Zotov2016-06-223-0/+17
| | | | | | | | Patch by Xinyu Zhuang. Differential Revision: http://reviews.llvm.org/D19309 llvm-svn: 273370
* Remove the ScalarReplAggregates passDavid Majnemer2016-06-151-3/+3
| | | | | | | | | | Nearly all the changes to this pass have been done while maintaining and updating other parts of LLVM. LLVM has had another pass, SROA, which has superseded ScalarReplAggregates for quite some time. Differential Revision: http://reviews.llvm.org/D21316 llvm-svn: 272737
* Remove every uses of getGlobalContext() in LLVM (but the C API)Mehdi Amini2016-04-141-1/+1
| | | | | | | | | | | At the same time, fixes InstructionsTest::CastInst unittest: yes you can leave the IR in an invalid state and exit when you don't destroy the context (like the global one), no longer now. This is the first part of http://reviews.llvm.org/D19094 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266379
* [OCaml] Expose the LLVM diagnostic handlerJeroen Ketema2016-04-103-1/+93
| | | | | | Differential Revision: http://reviews.llvm.org/D18891 llvm-svn: 265897
* [OCaml] Use LLVMCreateMessage with constant strings when calling llvm_raiseJeroen Ketema2016-04-014-4/+7
| | | | | | | | | | | The llvm_string_of_message function, called by llvm_raise, calls LLVMDisposeMessage, which expects the message to be dynamically allocated; it fails freeing the message otherwise. So always dynamically allocate with LLVMCreateMessage. Differential Revision: http://reviews.llvm.org/D18675 llvm-svn: 265116
* [OCaml] Reinstate data_layoutJeroen Ketema2016-04-013-0/+11
| | | | | | | | | | | | Expose LLVMCreateTargetMachineData as data_layout. As r263530 did for go. From that commit: "LLVMGetTargetDataLayout was removed from the C API, and then TargetMachine.TargetData was removed. Later, LLVMCreateTargetMachineData was added to the C API" Differential Revision: http://reviews.llvm.org/D18677 llvm-svn: 265115
* Silence warnings in OCaml bindingsJeroen Ketema2016-03-315-16/+3
| | | | | | | | | * LLVMDisposeMessage lives in llvm-c/Core.h, include this file where necessary * LLVMAddTargetData has been removed, follow suit in the bindings Differential Revision: http://reviews.llvm.org/D18633 llvm-svn: 265001
* Remove LLVMGetTargetMachineData leftovers.Benjamin Kramer2016-02-123-24/+0
| | | | llvm-svn: 260720
* Remove autoconf supportChris Bieneman2016-01-2619-940/+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
* Deprecate a few C APIs.Rafael Espindola2015-12-181-6/+4
| | | | | | | | | | | | | 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
* Change linkInModule to take a std::unique_ptr.Rafael Espindola2015-12-163-9/+7
| | | | | | | Passing in a std::unique_ptr should help find errors when the module is used after being linked into another module. llvm-svn: 255842
* Fix `llvm-config` to adapt to the install environment.Richard Diamond2015-11-091-0/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This patch does a couple of things: - Adds a new argument `--shared-mode` which accepts a list of components and prints whether or not the provided components need to be linked statically or shared. - Fixes `--libnames` when CMake BUILD_SHARED_LIBS is used. - Fixes `--libnames`, `--libs`, and `--libfiles` for dylib when static components aren't installed. - Fixes `--libnames`, `--libs`, `--libfiles`, and `--components` to use LLVM_DYLIB_COMPONENTS as the component manifest for dylib linking. - Uses the host platform's usual convention for filename extensions and such, instead of always defaulting to Unix-izms. Because I don't own a Mac, I am not able to test the Mac platform dependent stuff locally. If someone would be willing to run a build for me on their machine (unless there's a better option), I'd appreciate it. Reviewers: jfb, brad.king, whitequark, beanz Subscribers: beanz, jauhien, llvm-commits Differential Revision: http://reviews.llvm.org/D13198 llvm-svn: 252532
* [OCaml] Expose Llvm.{set_,}unnamed_addr.Peter Zotov2015-10-213-0/+23
| | | | | | Patch by Jacques-Pascal Deplaix <jp.deplaix@gmail.com> llvm-svn: 250912
* Revert "Fix `llvm-config` to emit the linker flag for the combined shared ↵Richard Diamond2015-08-051-2/+0
| | | | | | | | | | object built by autoconfig/make instead of the individual components." It seems I was wrong thinking `autoconf`/`make` only installed shared libraries if configured with `--enable-shared`, even if `--disable-static` is present. I'll re-address with a followup patch. This reverts commit r243297 for causing PR#24154. llvm-svn: 244108
* Fix `llvm-config` to emit the linker flag for the combined shared object ↵JF Bastien2015-07-271-0/+2
| | | | | | | | | | | | | | | | | | | built by autoconfig/make instead of the individual components. Summary: When LLVM is configured to build shared libraries, CMake builds each component as it's own shared object, while autoconfig/make builds them statically and then links them all together to create a single shared object. This change adds compile time config flags to `llvm-config` so it can know whether LLVM's components are separated or not and act accordingly. This fixes `llvm-config` instead of fixing the makefiles to behave like CMake because, AIUI, LLVM's autoconfig/make build system is on the way out anyway. This change only affects `llvm-config` from builds that use autoconfig/make. Reviewers: jfb Subscribers: echristo, dschuff, llvm-commits Differential Revision: http://reviews.llvm.org/D11392 llvm-svn: 243297
* Revert "Update LLVM bindings after r239940. ..."Reid Kleckner2015-07-161-1/+1
| | | | | | | | | | | Revert the changes to the C API LLVMBuildLandingPad that were part of the personality function move. We now set the personality on the parent function when the C API attempts to construct a landingpad with a personality. This reverts commit r240010. llvm-svn: 242372
OpenPOWER on IntegriCloud