summaryrefslogtreecommitdiffstats
path: root/llvm/bindings
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.
* [bindings/go] Add Subprogram methodAyke van Laethem2020-01-031-0/+5
| | | | | | | This method allows getting the subprogram metadata object from a function value. Differential Revision: https://reviews.llvm.org/D71528
* [llvm][bindings][go] Fix typoKadir Cetinkaya2019-12-031-1/+1
|
* Recommit "[DWARF5]Addition of alignment atrribute in typedef DIE."Sourabh Singh Tomar2019-12-031-0/+2
| | | | | | | | | | | | | | | | This revision is revised to update Go-bindings and Release Notes. The original commit message follows. This patch, adds support for DW_AT_alignment[DWARF5] attribute, to be emitted with typdef DIE. When explicit alignment is specified. Patch by Awanish Pandey <Awanish.Pandey@amd.com> Reviewers: aprantl, dblaikie, jini.susan.george, SouraVX, alok, deadalinx Differential Revision: https://reviews.llvm.org/D70111
* [Test] Fix freeze ocaml test failureJuneyoung Lee2019-11-223-0/+14
|
* [DebugInfo] Remove the DIFlagArgumentNotModified debug info flagDjordje Todorovic2019-11-201-1/+0
| | | | | | | Due to changes in D68206, we remove the DIFlagArgumentNotModified and its usage. Differential Revision: https://reviews.llvm.org/D68207
* Revert "[Bindings][Go] Fix go.test failure due to missing argument"Kai Luo2019-11-191-7/+5
| | | | | This reverts commit 88235812a71d99c082e7aa2ef9356d43d1f83a80 due to d27a16eb392f39f9ee04ff5194b1eff3e189e6f8.
* [Bindings][Go] Fix go.test failure due to missing argumentKai Luo2019-11-191-5/+7
| | | | | | | | | | | | go.test failed with error ``` /tmp/gopath431502532/src/llvm.org/llvm/bindings/go/llvm/dibuilder.go:514:40: not enough arguments in call to _Cfunc_LLVMDIBuilderCreateTypedef have (_Ctype_LLVMDIBuilderRef, _Ctype_LLVMMetadataRef, *_Ctype_char, _Ctype_ulong, _Ctype_LLVMMetadataRef, _Ctype_uint, _Ctype_LLVMMetadataRef) want (*_Ctype_struct_LLVMOpaqueDIBuilder, *_Ctype_struct_LLVMOpaqueMetadata, *_Ctype_char, _Ctype_ulong, *_Ctype_struct_LLVMOpaqueMetadata, _Ctype_uint, *_Ctype_struct_LLVMOpaqueMetadata, _Ctype_uint) ``` This patch fixes above error. Differential Revision: https://reviews.llvm.org/D70360
* Update version number in llvm python bindingsDavid Tenty2019-10-251-2/+2
| | | | | | | | | | | | | | | | Summary: The version number has come out of sync with what is in CMakeLists.txt, causing loading the bindings to fail. Reviewers: AustinWells, abhina.sree Reviewed By: AustinWells Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69436
* 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
* Remove the obsolete BlockByRefStruct flag from LLVM IRAdrian Prantl2019-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | DIFlagBlockByRefStruct is an unused DIFlag that originally was used by clang to express (Objective-)C block captures in debug info. For the last year Clang has been emitting complex DIExpressions to describe block captures instead, which makes all the code supporting this flag redundant. This patch removes the flag and all supporting "dead" code, so we can reuse the bit for something else in the future. Since this only affects debug info generated by Clang with the block extension this mostly affects Apple platforms and I don't have any bitcode compatibility concerns for removing this. The Verifier will reject debug info that uses the bit and thus degrade gracefully when LTO'ing older bitcode with a newer compiler. rdar://problem/44304813 Differential Revision: https://reviews.llvm.org/D67453 llvm-svn: 372272
* Bump llvm-go to C++14Benjamin Kramer2019-08-152-2/+2
| | | | llvm-svn: 368989
* [IR/DIVar] Add the flag for params that have unmodified valueDjordje Todorovic2019-06-261-0/+1
| | | | | | | | | | | | | | | | Introduce the debug info flag that indicates that a parameter has unchanged value throughout a function. This info will be used to emit the expressions with DW_OP_entry_value. ([4/13] Introduce the debug entry values.) Co-authored-by: Ananth Sowda <asowda@cisco.com> Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com> Co-authored-by: Ivan Baev <ibaev@cisco.com> Differential Revision: https://reviews.llvm.org/D58034 llvm-svn: 364406
* [bindings/go] Add debug information accessorsAyke van Laethem2019-06-242-0/+93
| | | | | | | | | | | | | | | | | | | | | | | Add debug information accessors, as provided in the following patches: https://reviews.llvm.org/D46627 (DILocation) https://reviews.llvm.org/D52693 metadata kind https://reviews.llvm.org/D60481 get/set debug location on a Value https://reviews.llvm.org/D60489 (DIScope) The API as proposed in this patch is similar to the current Value API, with a single root type and methods that are only valid for certain subclasses. I have considered just implementing generic Line() calls (that are valid on all DINodes that have a line) but the implementation of that got a bit awkward without support from the C API. I've also considered creating generic getters like a Metadata.DebugLoc() that returns a DebugLoc, but there is a mismatch between the Go DI nodes in the LLVM API and the actual DINode class hierarchy, so that's also hard to get right (without being confusing or breaking the API). Differential Revision: https://reviews.llvm.org/D63056 llvm-svn: 364198
* [bindings/go][NFC] Format code with go fmtAyke van Laethem2019-06-123-64/+65
| | | | | | | | | | Run go fmt (version 1.12) over the Go bindings. This cleans up lots of inconsistencies in the code, it does not change the code in a functional way. Differential Revision: https://reviews.llvm.org/D63057 llvm-svn: 363148
* [bindings/go] Add wrappers for atomic operations.Ayke van Laethem2019-06-091-0/+54
| | | | | | | | This patch adds Go bindings for atomic operations in LLVM. Differential Revision: https://reviews.llvm.org/D61034 llvm-svn: 362899
* [bindings/go] Add bindings to LLVMGet?CmpPredicateAyke van Laethem2019-06-081-0/+4
| | | | | | | | | | | | | | | Add bindings so that predicates on comparisons (icmp/fcmp) can be inspected from IR. Note: I considered adding Value.ICmpPredicate() etc. instead but Value.IntPredicate() seemed easier to read and matches the name of the returned type. (This change was also pushed two commits ago but accidentally had the wrong title and description.) Revision: https://reviews.llvm.org/D53884 llvm-svn: 362893
* Revert "[bindings/go] Add Go bindings for CalledValue"Ayke van Laethem2019-06-081-4/+0
| | | | | | | This reverts commit f675a60ca7a93f22e22dd4209504a9846dd04630. The commit had the wrong title/description. Sorry about the mess! llvm-svn: 362892
* [bindings/go] Add Go bindings for CalledValueAyke van Laethem2019-06-081-0/+4
| | | | | | | | | This is very useful for inspecting generated IR, there appears to be no other way to get the called function from a CallInst. Differential Revision: https://reviews.llvm.org/D52972 llvm-svn: 362891
* [bindings/go] Add Go bindings for CalledValueAyke van Laethem2019-06-081-0/+4
| | | | | | | | This is very useful for inspecting generated IR, there appears to be no other way to get the called function from a CallInst. Revision: https://reviews.llvm.org/D52972 llvm-svn: 362890
* [bindings/go] Add EraseFromParentAyke van Laethem2019-06-081-0/+1
| | | | | | | After using ReplaceAllUsesWith on an instruction, it may be necessary to erase it even though it is dead. llvm-svn: 362889
* [NFC] Test commitAyke van Laethem2019-06-081-0/+1
| | | | | | Add a newline, which is missing according to go fmt. llvm-svn: 362888
* Fix bad go bindings test.Richard Trieu2019-05-311-1/+0
| | | | | | | After r362128, the "byval" attribute has a stricter check and will cause an assertion. Remove the "byval" test case for now. llvm-svn: 362189
* [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
* [LLVM-C] Correct The Current Debug Location Accessors (Again)Robert Widmann2019-04-103-6/+6
| | | | | | | | | | | | | | Summary: Resubmitting D60484 with the conflicting Go bindings renamed to avoid collisions. Reviewers: whitequark, deadalnix Subscribers: hiraditya, llvm-commits, sammccall Tags: #llvm Differential Revision: https://reviews.llvm.org/D60511 llvm-svn: 358086
* [bindings/go] Fix building on 32-bit systems (ARM etc.)whitequark2019-02-161-1/+1
| | | | | | | | | | | | | | | | | | | Summary: The patch in https://reviews.llvm.org/D53883 (by me) fails to build on 32-bit systems like ARM. Fix the array size to be less ridiculously large. 2<<20 should still be enough for all practical purposes. Bug: https://bugs.llvm.org/show_bug.cgi?id=40426 Reviewers: whitequark, pcc Reviewed By: whitequark Subscribers: javed.absar, kristof.beyls, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58030 llvm-svn: 354207
* [NewPM] Second attempt at porting ASanLeonard Chan2019-02-131-1/+2
| | | | | | | | | | | | | | | | | | | | This is the second attempt to port ASan to new PM after D52739. This takes the initialization requried by ASan from the Module by moving it into a separate class with it's own analysis that the new PM ASan can use. Changes: - Split AddressSanitizer into 2 passes: 1 for the instrumentation on the function, and 1 for the pass itself which creates an instance of the first during it's run. The same is done for AddressSanitizerModule. - Add new PM AddressSanitizer and AddressSanitizerModule. - Add legacy and new PM analyses for reading data needed to initialize ASan with. - Removed DominatorTree dependency from ASan since it was unused. - Move GlobalsMetadata and ShadowMapping out of anonymous namespace since the new PM analysis holds these 2 classes and will need to expose them. Differential Revision: https://reviews.llvm.org/D56470 llvm-svn: 353985
* Fix format string in bindings/go/llvm/ir_test.go (PR40561)Hans Wennborg2019-02-051-2/+2
| | | | | | | | | | | | | | The test started failing for me recently. I don't see any changes around this code, so maybe it's my local go version that changed or something. The error seems real to me: we're trying to print an Attribute with %d. The test talks about "attribute masks" I'm not sure what that refers to, but I suppose we could print the raw pointer value, since that's what the test seems to be comparing. Differential revision: https://reviews.llvm.org/D57672 llvm-svn: 353155
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1977-308/+246
| | | | | | | | | | | | | | | | | 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
* [NewPM][TSan] Reiterate the TSan portPhilip Pfaffe2019-01-161-1/+2
| | | | | | | | | | | | | | | | | | | Summary: Second iteration of D56433 which got reverted in rL350719. The problem in the previous version was that we dropped the thunk calling the tsan init function. The new version keeps the thunk which should appease dyld, but is not actually OK wrt. the current semantics of function passes. Hence, add a helper to insert the functions only on the first time. The helper allows hooking into the insertion to be able to append them to the global ctors list. Reviewers: chandlerc, vitalybuka, fedor.sergeev, leonardchan Subscribers: hiraditya, bollu, llvm-commits Differential Revision: https://reviews.llvm.org/D56538 llvm-svn: 351314
* Revert "Fix go bindings for r350647: missed a function rename"Jorge Gorbe Moya2019-01-101-2/+1
| | | | | | This reverts commit a74266858a8164cfb23d4e138cd4c7c37be0b5d1. SVN revision r350657. llvm-svn: 350790
* Fix go bindings for r350647: missed a function renameJorge Gorbe Moya2019-01-081-1/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D56452 llvm-svn: 350657
* Python compat - iterator protocolSerge Guelton2019-01-031-5/+16
| | | | | | | | In Python2 next() is used wile it's __next__ in Python3. Differential Revision: https://reviews.llvm.org/D56250 llvm-svn: 350326
* Python compat - test if type is integralSerge Guelton2019-01-031-7/+9
| | | | | | | | Rely on numbers.Integral instead of int/long Differential Revision: https://reviews.llvm.org/D56262 llvm-svn: 350316
* Python compat - assertRaisesRegexSerge Guelton2019-01-032-1/+6
| | | | | | | | Python3 uses assertRaisesRegex instad of assertRaisesRegexp. Differential Revision: https://reviews.llvm.org/D56251 llvm-svn: 350308
* Python compat - print statementSerge Guelton2019-01-034-5/+12
| | | | | | | | | Make sure all print statements are compatible with Python 2 and Python3 using the `from __future__ import print_function` statement. Differential Revision: https://reviews.llvm.org/D56249 llvm-svn: 350307
* [NewPM] Port MsanPhilip Pfaffe2019-01-033-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Keeping msan a function pass requires replacing the module level initialization: That means, don't define a ctor function which calls __msan_init, instead just declare the init function at the first access, and add that to the global ctors list. Changes: - Pull the actual sanitizer and the wrapper pass apart. - Add a newpm msan pass. The function pass inserts calls to runtime library functions, for which it inserts declarations as necessary. - Update tests. Caveats: - There is one test that I dropped, because it specifically tested the definition of the ctor. Reviewers: chandlerc, fedor.sergeev, leonardchan, vitalybuka Subscribers: sdardis, nemanjai, javed.absar, hiraditya, kbarton, bollu, atanasyan, jsji Differential Revision: https://reviews.llvm.org/D55647 llvm-svn: 350305
* [bindings/go] Add Go bindings to LLVMGetIndiceswhitequark2018-11-081-0/+13
| | | | | | | | | | | | | | Summary: This instruction is useful for inspecting extractvalue/insertvalue in IR. Unlike most other operations, indices cannot be inspected using the generic Value.Opcode() function so a specialized function needs to be added. Reviewers: whitequark, pcc Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D53883 llvm-svn: 346388
* [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-182-4/+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
* [bindings/go] Add Go bindings to the Token typewhitequark2018-09-281-0/+2
| | | | | | | | | | | | | | Summary: This type is necessary for implementing coroutines. Reviewers: whitequark Reviewed By: whitequark Subscribers: modocache, llvm-commits Differential Revision: https://reviews.llvm.org/D47684 llvm-svn: 343345
* [bindings/go] Add Go bindings for inline assemblywhitequark2018-09-281-0/+20
| | | | | | | | | | | | Reviewers: harlanhaskins, whitequark, pcc Reviewed By: pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46437 llvm-svn: 343339
* Revert "[LLVM-C] Add bindings for addCoroutinePassesToExtensionPoints"whitequark2018-09-281-4/+0
| | | | | | | | | This reverts commit c4baf7c2f06ff5459c4f5998ce980346e72bff97. Broke the bots, and should really be in Transforms/Coroutines instead. llvm-svn: 343337
* [LLVM-C] Add bindings for addCoroutinePassesToExtensionPointswhitequark2018-09-281-0/+4
| | | | | | | | | | | | | | Summary: This patch adds bindings to C and Go for addCoroutinePassesToExtensionPoints, which is used to add coroutine passes to the correct locations in PassManagerBuilder. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: mehdi_amini, modocache, llvm-commits Differential Revision: https://reviews.llvm.org/D51642 llvm-svn: 343336
* [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
OpenPOWER on IntegriCloud