summaryrefslogtreecommitdiffstats
path: root/llvm/bindings
Commit message (Collapse)AuthorAgeFilesLines
...
* Go binding: Add GetCurrentDebugLocation to obtain debug location from builderAndrew Wilkins2017-03-314-0/+74
| | | | | | | | | | | | | | | | | | | Summary: Currently Go binding only has SetCurrentDebugLocation method. I added GetCurrentDebugLocation method to IRBuilder instance. I added this because I want to save current debug location, change debug location temporary and restore the saved one finally. This is useful when source location jumps and goes back after while LLVM IR generation. I also added tests for this to ir_test.go. I confirmed that all test passed with this patch based on r298890 Patch by Ryuichi Hayashida! Differential Revision: https://reviews.llvm.org/D31415 llvm-svn: 299185
* [DebugInfo] Emit address space with DW_AT_address_class attribute for ↵Konstantin Zhuravlyov2017-03-081-1/+2
| | | | | | | | pointer and reference types Differential Revision: https://reviews.llvm.org/D29670 llvm-svn: 297320
* Go binding: Add methods for missing PassManagerBuilder C APIsAndrew Wilkins2017-02-171-0/+20
| | | | | | | | Patch by Ryuichi Hayashida! Differential Revision: http://reviews.llvm.org/D30042 llvm-svn: 295420
* Fix go bindings after r289702 (hopefully, don't really know how to buildDaniel Jasper2016-12-151-2/+2
| | | | | | them, build.sh seems to be broken). llvm-svn: 289775
* Fix go binding to adapt the new attribute APIAmaury Sechet2016-11-182-0/+193
| | | | | | https://reviews.llvm.org/D26339 llvm-svn: 287328
* [OCaml] Adapt to the new attribute C API.whitequark2016-11-123-226/+279
| | | | llvm-svn: 286705
* Remove Go Attribute type that was deleted from the C API in r286062.David L. Jones2016-11-071-1/+0
| | | | | | | | | | | | | | Summary: The C++ side of the Go bindings were updated in r286085, r286086, and r286087, but those did not remove this type. Reviewers: djasper Subscribers: axw Differential Revision: https://reviews.llvm.org/D26337 llvm-svn: 286131
* Also delete the go side of the bindings deleted in r286085/r286086.Daniel Jasper2016-11-063-180/+0
| | | | | | Also delete a comment I forgot to delete. llvm-svn: 286087
* Delete one more function that needs to go after r286062.Daniel Jasper2016-11-062-8/+0
| | | | llvm-svn: 286086
* Remove functions from go bindings that have been deleted in r286062.Daniel Jasper2016-11-062-24/+0
| | | | llvm-svn: 286085
* [Go bindings] Update for r284678 API changes.Benjamin Kramer2016-10-203-21/+18
| | | | | | Alignment moved from createBasicType to createAutoVariable. llvm-svn: 284707
* DebugInfo: change alignment type from uint64_t to uint32_t to save space.Victor Leschuk2016-10-183-24/+24
| | | | | | | | | In futher patches we shall have alignment field added to DIVariable family and switching from uint64_t to uint32_t will save 4 bytes per variable. Differential Revision: https://reviews.llvm.org/D25620 llvm-svn: 284482
* 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
* Formatting with clang-format patch r280700Leny Kholodov2016-09-061-10/+8
| | | | llvm-svn: 280716
* Fix for Bindings/Go/go.test after patch r280700Leny Kholodov2016-09-061-6/+10
| | | | llvm-svn: 280711
* [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
* bindings/go: reinstate TargetMachine.TargetDataAndrew Wilkins2016-03-151-0/+7
| | | | | | | | | | | | | | | | Summary: LLVMGetTargetDataLayout was removed from the C API, and then TargetMachine.TargetData was removed. Later, LLVMCreateTargetMachineData was added to the C API, and we now expose this via the Go API. Reviewers: deadalnix, pcc Subscribers: cierniak, llvm-commits, axw Differential Revision: http://reviews.llvm.org/D18173 llvm-svn: 263530
* Kill LLVMAddTargetDataAmaury Sechet2016-02-162-8/+0
| | | | | | | | | | | | Summary: It's red, it's dead. Reviewers: joker.eph, Wallbraker, echristo Subscribers: llvm-commits, axw Differential Revision: http://reviews.llvm.org/D17282 llvm-svn: 260919
* Remove LLVMGetTargetMachineData leftovers.Benjamin Kramer2016-02-123-24/+0
| | | | llvm-svn: 260720
* Remove LLVMGetTargetMachineData in go-binding.Haojian Wu2016-02-121-5/+0
| | | | | | | | | | | | | | | Summary: LLVMGetTargetMachineData has been removed, and LLVMGetDataLayout is suggested to use. The LLVMGetDataLayout is exposed in go bindings. So it's safe to remove the function. Reviewers: bkramer Subscribers: llvm-commits, axw Differential Revision: http://reviews.llvm.org/D17193 llvm-svn: 260670
* Remove autoconf supportChris Bieneman2016-01-2620-960/+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-183-12/+9
| | | | | | | | | | | | | 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
* Reorganize the C API headers to improve build times.Eric Christopher2015-12-185-0/+5
| | | | | | | | | 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
* Change linkInModule to take a std::unique_ptr.Rafael Espindola2015-12-164-13/+9
| | | | | | | 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
* DI: Reverse direction of subprogram -> function edge.Peter Collingbourne2015-11-056-5/+12
| | | | | | | | | | | | | | | | | | | | | | | Previously, subprograms contained a metadata reference to the function they described. Because most clients need to get or set a subprogram for a given function rather than the other way around, this created unneeded inefficiency. For example, many passes needed to call the function llvm::makeSubprogramMap() to build a mapping from functions to subprograms, and the IR linker needed to fix up function references in a way that caused quadratic complexity in the IR linking phase of LTO. This change reverses the direction of the edge by storing the subprogram as function-level metadata and removing DISubprogram's function field. Since this is an IR change, a bitcode upgrade has been provided. Fixes PR23367. An upgrade script for textual IR for out-of-tree clients is attached to the PR. Differential Revision: http://reviews.llvm.org/D14265 llvm-svn: 252219
* [OCaml] Expose Llvm.{set_,}unnamed_addr.Peter Zotov2015-10-213-0/+23
| | | | | | Patch by Jacques-Pascal Deplaix <jp.deplaix@gmail.com> llvm-svn: 250912
* Remove DIFile from createSubroutineType.Eric Christopher2015-10-151-2/+1
| | | | | | Patch by Amaury Sechet with a small modification by me. llvm-svn: 250374
* [bindings] Update Go bindings to DIBuilderAndrew Wilkins2015-09-063-22/+59
| | | | | | | | | | | | | | | Summary: Update the Go bindings to DIBuilder to match the split of creating local variables into auto and parameter variables. Reviewers: pcc Subscribers: llvm-commits, axw Differential Revision: http://reviews.llvm.org/D11864 llvm-svn: 246935
* [PM/AA] Remove the last relics of the separate IPA library from LLVM,Chandler Carruth2015-08-181-4/+0
| | | | | | | | | | | | | | | | | | | | | folding the code into the main Analysis library. There already wasn't much of a distinction between Analysis and IPA. A number of the passes in Analysis are actually IPA passes, and there doesn't seem to be any advantage to separating them. Moreover, it makes it hard to have interactions between analyses that are both local and interprocedural. In trying to make the Alias Analysis infrastructure work with the new pass manager, it becomes particularly awkward to navigate this split. I've tried to find all the places where we referenced this, but I may have missed some. I have also adjusted the C API to continue to be equivalently functional after this change. Differential Revision: http://reviews.llvm.org/D12075 llvm-svn: 245318
* 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
* DI: Rewrite the DIBuilder local variable APIDuncan P. N. Exon Smith2015-07-311-4/+9
| | | | | | | | | | | | Replace the general `createLocalVariable()` with two more specific functions: `createParameterVariable()` and `createAutoVariable()`, and rewrite the documentation. Besides cleaning up the API, this avoids exposing the fake DWARF tags `DW_TAG_arg_variable` and `DW_TAG_auto_variable` to frontends, and is preparation for removing them completely. llvm-svn: 243764
* 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-162-2/+2
| | | | | | | | | | | 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
* Expose setPersonalityFn to GoAndrew Wilkins2015-07-151-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add Value.SetPersonality to the Go bindings. The Go bindings' Builder.CreateLandingPad has been updated, removing the obsolete personality argument. Background The personality attribute was removed from LandingPadInst in r239940, and llvm::Function::setPersonalityFn introduced. There was no corresponding change to either the C API or Go bindings. The Go bindings were broken until r239940, but that change was just to ignore the personality argument. This broke llgo. Reviewers: majnemer, pcc Subscribers: deadalnix, llvm-commits, axw Differential Revision: http://reviews.llvm.org/D11116 llvm-svn: 242289
* Remove getRelocationAddress.Rafael Espindola2015-07-061-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally added in r139314. Back then it didn't actually get the address, it got whatever value the relocation used: address or offset. The values in different object formats are: * MachO: Always an offset. * COFF: Always an address, but when talking about the virtual address of sections it says: "for simplicity, compilers should set this to zero". * ELF: An offset for .o files and and address for .so files. In the case of the .so, the relocation in not linked to any section (sh_info is 0). We can't really compute an offset. Some API mappings would be: * Use getAddress for everything. It would be quite cumbersome. To compute the address elf has to follow sh_info, which can be corrupted and therefore the method has to return an ErrorOr. The address of the section is also the same for every relocation in a section, so we shouldn't have to check the error and fetch the value for every relocation. * Use a getValue and make it up to the user to know what it is getting. * Use a getOffset and: * Assert for dynamic ELF objects. That is a very peculiar case and it is probably fair to ask any tool that wants to support it to use ELF.h. The only tool we have that reads those (llvm-readobj) already does that. The only other use case I can think of is a dynamic linker. * Check that COFF .obj files have sections with zero virtual address spaces. If it turns out that some assembler/compiler produces these, we can change COFFObjectFile::getRelocationOffset to subtract it. Given COFF format, this can be done without the need for ErrorOr. The getRelocationAddress method was never implemented for COFF. It also had exactly one use in a very peculiar case: a shortcut for adding the section value to a pcrel reloc on MachO. Given that, I don't expect that there is any use out there of the C API. If that is not the case, let me know and I will add it back with the implementation inlined and do a proper deprecation. llvm-svn: 241450
* [OCaml] Bump ctypes dependency to 0.4.Peter Zotov2015-06-271-5/+5
| | | | | | | | | | | | ctypes 0.3 and earlier contains an interface-definig bug: its ptr_of_raw_address accepts Int64 and not Nativeint. ctypes 0.4 was not released during the 3.6 cycle, and because of that, LLVM 3.6 was released with ctypes 0.3 as a dependency, which now breaks the build on modern ctypes. Unbreak. llvm-svn: 240882
* Update LLVM bindings after r239940. Apparently these aren't included inDaniel Jasper2015-06-182-2/+2
| | | | | | | | | any tests and I even don't know how to run the tests. This seems like a minimal change to make them work again, although I can't really verify at this point. Additionally, it probably makes sense to propagate the personality parameter removal further. llvm-svn: 240010
* Add safestack attribute to LLVMAttribute enum and Go bindings. CorrectPeter Collingbourne2015-06-152-0/+4
| | | | | | | constants in commented-out part of LLVMAttribute enum. Add tests that verify that the safestack attribute is only allowed as a function attribute. llvm-svn: 239772
* IR: Give 'DI' prefix to debug info metadataDuncan P. N. Exon Smith2015-04-291-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Finish off PR23080 by renaming the debug info IR constructs from `MD*` to `DI*`. The last of the `DIDescriptor` classes were deleted in r235356, and the last of the related typedefs removed in r235413, so this has all baked for about a week. Note: If you have out-of-tree code (like a frontend), I recommend that you get everything compiling and tests passing with the *previous* commit before updating to this one. It'll be easier to keep track of what code is using the `DIDescriptor` hierarchy and what you've already updated, and I think you're extremely unlikely to insert bugs. YMMV of course. Back to *this* commit: I did this using the rename-md-di-nodes.sh upgrade script I've attached to PR23080 (both code and testcases) and filtered through clang-format-diff.py. I edited the tests for test/Assembler/invalid-generic-debug-node-*.ll by hand since the columns were off-by-three. It should work on your out-of-tree testcases (and code, if you've followed the advice in the previous paragraph). Some of the tests are in badly named files now (e.g., test/Assembler/invalid-mdcompositetype-missing-tag.ll should be 'dicompositetype'); I'll come back and move the files in a follow-up commit. llvm-svn: 236120
* DebugInfo: Remove DIArray and DITypeArray typedefsDuncan P. N. Exon Smith2015-04-211-5/+5
| | | | | | | Remove the `DIArray` and `DITypeArray` typedefs, preferring the underlying types (`DebugNodeArray` and `MDTypeRefArray`, respectively). llvm-svn: 235413
* DebugInfo: Drop rest of DIDescriptor subclassesDuncan P. N. Exon Smith2015-04-211-7/+4
| | | | | | | Delete the remaining subclasses of (the already deleted) `DIDescriptor`. Part of PR23080. llvm-svn: 235404
* DebugInfo: Delete subclasses of DIScopeDuncan P. N. Exon Smith2015-04-201-14/+10
| | | | | | | Delete subclasses of (the already defunct) `DIScope`, updating users to use the raw pointers from the `Metadata` hierarchy directly. llvm-svn: 235356
OpenPOWER on IntegriCloud