summaryrefslogtreecommitdiff
path: root/bindings
AgeCommit message (Collapse)Author
2018-05-28[LLVM-C] [OCaml] Remove LLVMAddBBVectorizePassFangrui Song
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333378 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-10[LLVM-C] Consolidate llgo's DIBuilder BindingsRobert Widmann
Summary: Move and correct LLVMDIBuilderCreateTypedef. This is the last API in DIBuilderBindings.h, so it is being removed and the C API will now be re-exported from IRBindings.h. Reviewers: whitequark, harlanhaskins, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46725 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332041 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-10[LLVM-C] Move DIBuilder Bindings For Temporary MDNodesRobert Widmann
Summary: Move LLVMTemporaryMDNode and LLVMMetadataReplaceAllUsesWith to the C bindings and add LLVMDeleteTemporaryMDNode for deleting non-RAUW'ed temporary nodes. Reviewers: whitequark, harlanhaskins, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46632 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332010 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09[LLVM-C] Correct types in Go bindingsRobert Widmann
Summary: Fixes a test failure introduced in rL331114. Reviewers: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46631 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331850 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-04[bindings/go] Add Go bindings for volatile loads/storesDavid Bolvansky
Reviewers: whitequark Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46235 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331530 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-30IWYU for llvm-config.h in llvm, additions.Nico Weber
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331184 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-30[bindings] Fix dibuilder go bindings after r331114.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331171 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-24[AggressiveInstCombine] Add aggressive inst combiner to the LLVM C API.Craig Topper
I just tried to copy what was done for regular InstCombine. Hopefully I didn't miss anything. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330668 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-23[LLVM-C] DIBuilder Bindings For Variable ExpressionsRobert Widmann
Summary: Add DIBuilder bindings for (global) variable expressions, variable value expressions, and debug value intrinsic insertion. Reviewers: harlanhaskins, deadalnix, whitequark Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45979 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330661 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-23[LLVM-C] DIBuilderBindings for Subrange and ArraysRobert Widmann
Summary: Move Go bindings for subranges and DINode arrays. Reviewers: harlanhaskins, whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45933 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330594 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-22[LLVM-C] Add DIBuilder Bindings For Variable CreationRobert Widmann
Summary: Wrap LLVMDIBuilderCreateAutoVariable, LLVMDIBuilderCreateParameterVariable, LLVMDIBuilderCreateExpression, and move and correct LLVMDIBuilderInsertDeclareBefore and LLVMDIBuilderInsertDeclareAtEnd from the Go bindings to the C bindings. Reviewers: harlanhaskins, whitequark, deadalnix Reviewed By: harlanhaskins, whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45928 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330555 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-07[llgo] Move SetSubprogramRobert Widmann
Summary: Fixes the bots - I moved LLVMSetSubprogram into the DIBuilder bindings, so the Go bindings need to move as well. Reviewers: whitequark Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45402 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329505 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-07[LLVM-C] Move DIBuilder Bindings For Block ScopesRobert Widmann
Summary: Move LLVMDIBuilderCreateFunction , LLVMDIBuilderCreateLexicalBlock, and LLVMDIBuilderCreateLexicalBlockFile from Go to LLVM-C. Reviewers: whitequark, harlanhaskins, deadalnix Reviewed By: whitequark, harlanhaskins Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45352 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329488 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-02Fix Go IR test for changes in DIBuilder APIHarlan Haskins
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329021 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-02Add C API bindings for DIBuilder 'Type' APIsHarlan Haskins
This patch adds a set of unstable C API bindings to the DIBuilder interface for creating structure, function, and aggregate types. This patch also removes the existing implementations of these functions from the Go bindings and updates the Go API to fit the new C APIs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328953 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-31Unbreak the build of the go bindings after r328839.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328916 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-17[bindings/go] Add a missing `,` in the test code to fix a go compileChandler Carruth
failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327771 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-17[X86] Added support for nocf_check attribute for indirect Branch TrackingOren Ben Simhon
X86 Supports Indirect Branch Tracking (IBT) as part of Control-Flow Enforcement Technology (CET). IBT instruments ENDBR instructions used to specify valid targets of indirect call / jmp. The `nocf_check` attribute has two roles in the context of X86 IBT technology: 1. Appertains to a function - do not add ENDBR instruction at the beginning of the function. 2. Appertains to a function pointer - do not track the target function of this pointer by adding nocf_check prefix to the indirect-call instruction. This patch implements `nocf_check` context for Indirect Branch Tracking. It also auto generates `nocf_check` prefixes before indirect branchs to jump tables that are guarded by range checks. Differential Revision: https://reviews.llvm.org/D41879 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327767 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14[LLVM-C] [bindings/go] Add C and Golang bindings for COMDATReid Kleckner
Patch by Ben Clayton Differential Revision: https://reviews.llvm.org/D44086 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327551 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-23Because of CVE-2018-6574, some compiler options and linker options are ↵Eric Christopher
restricted to prevent arbitrary code execution. https://github.com/golang/go/issues/23672 By this change, building a Go code with LLVM Go bindings causes a compilation error as follows. go build llvm.org/llvm/bindings/go/llvm: invalid flag in #cgo LDFLAGS: -Wl,-headerpad_max_install_names llvm-go tool generates cgo LDFLAGS directive from `llvm-config --ldflags` and it contains -Wl,option options. But -Wl,option is banned by default. To avoid this problem, we need to set $CGO_LDFLAGS_ALLOW environment variable to notify a compiler that the flags should be allowed. $ export CGO_LDFLAGS_ALLOW='-Wl,(-search_paths_first|-headerpad_max_install_names)' By default for go 1.10 and go 1.9.5 these options should appear in the accepted set of options, however, if you're running into the error it's useful to have this documented. Patch by Ryuichi Hayashida git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325946 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-26[NFC] fix trivial typos in comments and documentsHiroshi Inoue
"in in" -> "in", "on on" -> "on" etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323508 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-28[bindings/go] fix vet errorsAndrew Wilkins
Fix "go vet" errors, which will be run automatically with "go test" as of Go 1.10. Patch by Karsten Weiss! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321509 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-02Update go bindings to use new functions from rL317135.Sam McCall
This fixes duplicate symbol problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317195 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-02Revert "Remove some of the go specific C bindings for debug info now that ↵Eric Christopher
they've been migrated into the main C API." This reverts commits r317151 and 317152 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317154 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-02Fix for go bindings header to match previous commit.Eric Christopher
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317152 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-02Remove some of the go specific C bindings for debug info now that they've ↵Eric Christopher
been migrated into the main C API. Fixes a go bindings breakage after r317135. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317151 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-15Reverting r315590; it did not include changes for llvm-tblgen, which is ↵Aaron Ballman
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-12[dump] Remove NDEBUG from test to enable dump methods [NFC]Don Hinton
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315590 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28Update the Go bindings for r309426 (remove offset from llvm.dbg.value)Adrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309448 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-27[OCaml] Fix undefined reference to LLVMDumpType() with NDEBUGMichal Gorny
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309321 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28[NFC] Remove multiple semicolonsMandeep Singh Grang
Reviewers: bogner, whitequark, mgrang Reviewed By: mgrang Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34785 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306613 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08[Go] Subtypes functionAndrew Wilkins
This patch adds LLVMGetSubtypes to Go API (as Type.Subtypes), tests included. Patch by Ekaterina Vaartis! Differential Revision: https://reviews.llvm.org/D33901 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304968 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05[LLVM-C] [OCaml] Expose Type::subtypes.whitequark
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304709 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20[go bindings] Rmove duplicated conversion function definitions after r300843.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300872 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-17Introducing LLVMMetadataRefAmaury Sechet
Summary: This seems like an uncontroversial first step toward providing access to the metadata hierarchy that now exists in LLVM. This should allow for good debug info support from C. Future plans are to deprecate API that take mixed bags of values and metadata (mainly the LLVMMDNode family of functions) and migrate the rest toward the use of LLVMMetadataRef. Once this is in place, mapping of DIBuilder will be able to start. Reviewers: mehdi_amini, echristo, whitequark, jketema, Wallbraker Reviewed By: Wallbraker Subscribers: Eugene.Zelenko, axw, mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D19448 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300447 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31Go binding: Add GetCurrentDebugLocation to obtain debug location from builderAndrew Wilkins
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299185 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08[DebugInfo] Emit address space with DW_AT_address_class attribute for ↵Konstantin Zhuravlyov
pointer and reference types Differential Revision: https://reviews.llvm.org/D29670 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297320 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17Go binding: Add methods for missing PassManagerBuilder C APIsAndrew Wilkins
Patch by Ryuichi Hayashida! Differential Revision: http://reviews.llvm.org/D30042 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295420 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15Fix go bindings after r289702 (hopefully, don't really know how to buildDaniel Jasper
them, build.sh seems to be broken). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289775 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18Fix go binding to adapt the new attribute APIAmaury Sechet
https://reviews.llvm.org/D26339 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287328 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12[OCaml] Adapt to the new attribute C API.whitequark
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07Remove Go Attribute type that was deleted from the C API in r286062.David L. Jones
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-06Also delete the go side of the bindings deleted in r286085/r286086.Daniel Jasper
Also delete a comment I forgot to delete. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286087 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-06Delete one more function that needs to go after r286062.Daniel Jasper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-06Remove functions from go bindings that have been deleted in r286062.Daniel Jasper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286085 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-20[Go bindings] Update for r284678 API changes.Benjamin Kramer
Alignment moved from createBasicType to createAutoVariable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284707 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-18DebugInfo: change alignment type from uint64_t to uint32_t to save space.Victor Leschuk
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284482 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30cmake: Install the OCaml libraries into a more correct pathMichal Gorny
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-06Formatting with clang-format patch r280700Leny Kholodov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-06Fix for Bindings/Go/go.test after patch r280700Leny Kholodov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280711 91177308-0d34-0410-b5e6-96231b3b80d8