Commit Graph

484 Commits

Author SHA1 Message Date
Joerg Sonnenberger
732f95ff9a Reapply r374743 with a fix for the ocaml binding
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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374784 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 16:15:14 +00:00
Dmitri Gribenko
e0cea29324 Revert "Add a pass to lower is.constant and objectsize intrinsics"
This reverts commit r374743. It broke the build with Ocaml enabled:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/19218

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374768 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 12:22:48 +00:00
Joerg Sonnenberger
314e3cde15 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374743 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 23:00:15 +00:00
Dmitri Gribenko
95dac6bc2e Revert "[OCaml] Handle nullptr in Llvm.global_initializer"
This reverts commit r373299. It broke tests:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18485

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373311 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-01 08:29:07 +00:00
Aditya Kumar
e8e962044c [OCaml] Handle nullptr in Llvm.global_initializer
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373299 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-01 03:45:09 +00:00
Aditya Kumar
3b63eace9d [LLVM-C][Ocaml] Add MergeFunctions and DCE pass
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373170 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-29 16:06:22 +00:00
Adrian Prantl
cb7b458c96 Remove the obsolete BlockByRefStruct flag from LLVM IR
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372272 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-18 22:38:56 +00:00
Benjamin Kramer
7b52c1a832 Bump llvm-go to C++14
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368989 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 10:55:25 +00:00
Djordje Todorovic
9eaa8818a5 [IR/DIVar] Add the flag for params that have unmodified value
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364406 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-26 11:19:26 +00:00
Ayke van Laethem
f0bc658e54 [bindings/go] Add debug information accessors
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364198 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-24 16:23:17 +00:00
Ayke van Laethem
78ef4965f2 [bindings/go][NFC] Format code with go fmt
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363148 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-12 11:59:09 +00:00
Ayke van Laethem
d1edfbfdf2 [bindings/go] Add wrappers for atomic operations.
This patch adds Go bindings for atomic operations in LLVM.

Differential Revision: https://reviews.llvm.org/D61034

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362899 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-09 10:06:35 +00:00
Ayke van Laethem
3c89a4bf4b [bindings/go] Add bindings to LLVMGet?CmpPredicate
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362893 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-08 22:21:37 +00:00
Ayke van Laethem
79303dde56 Revert "[bindings/go] Add Go bindings for CalledValue"
This reverts commit f675a60ca7a93f22e22dd4209504a9846dd04630.
The commit had the wrong title/description. Sorry about the mess!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362892 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-08 22:17:51 +00:00
Ayke van Laethem
72a39d3b93 [bindings/go] Add Go bindings for CalledValue
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362891 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-08 22:15:38 +00:00
Ayke van Laethem
ac449df582 [bindings/go] Add Go bindings for CalledValue
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362890 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-08 22:08:52 +00:00
Ayke van Laethem
c9ddc67316 [bindings/go] Add EraseFromParent
After using ReplaceAllUsesWith on an instruction, it may be necessary to
erase it even though it is dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362889 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-08 22:00:19 +00:00
Ayke van Laethem
52406e5dd7 [NFC] Test commit
Add a newline, which is missing according to go fmt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362888 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-08 21:42:00 +00:00
Richard Trieu
7a9c1dcc3e Fix bad go bindings test.
After r362128, the "byval" attribute has a stricter check and will cause an
assertion.  Remove the "byval" test case for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362189 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-31 03:45:11 +00:00
whitequark
fccd1f0eb9 [OCaml] Update api to account for FNeg and CallBr instructions
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358501 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-16 15:00:19 +00:00
Robert Widmann
e9dc5141ac [LLVM-C] Correct The Current Debug Location Accessors (Again)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358086 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-10 14:19:05 +00:00
whitequark
7405c60df8 [bindings/go] Fix building on 32-bit systems (ARM etc.)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354207 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-16 22:33:10 +00:00
Leonard Chan
c6bc69a573 [NewPM] Second attempt at porting ASan
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353985 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13 22:22:48 +00:00
Hans Wennborg
8deefe229d Fix format string in bindings/go/llvm/ir_test.go (PR40561)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353155 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-05 11:01:54 +00:00
Chandler Carruth
6b547686c5 Update the file headers across all of the LLVM projects in the monorepo
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
Philip Pfaffe
6dbe225afe [NewPM][TSan] Reiterate the TSan port
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351314 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 09:28:01 +00:00
Jorge Gorbe Moya
2213e7fa1d Revert "Fix go bindings for r350647: missed a function rename"
This reverts commit a74266858a8164cfb23d4e138cd4c7c37be0b5d1. SVN revision r350657.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350790 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-10 01:51:54 +00:00
Jorge Gorbe Moya
8c244a62d8 Fix go bindings for r350647: missed a function rename
Differential Revision: https://reviews.llvm.org/D56452

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350657 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-08 21:45:42 +00:00
Serge Guelton
19b8509e55 Python compat - iterator protocol
In Python2 next() is used wile it's __next__ in Python3.

Differential Revision: https://reviews.llvm.org/D56250

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350326 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-03 15:43:14 +00:00
Serge Guelton
247f1c68c4 Python compat - test if type is integral
Rely on numbers.Integral instead of int/long

Differential Revision: https://reviews.llvm.org/D56262

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350316 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-03 14:12:50 +00:00
Serge Guelton
9d106538ad Python compat - assertRaisesRegex
Python3 uses assertRaisesRegex instad of assertRaisesRegexp.

Differential Revision: https://reviews.llvm.org/D56251

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350308 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-03 14:11:41 +00:00
Serge Guelton
60ccceba74 Python compat - print statement
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350307 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-03 14:11:33 +00:00
Philip Pfaffe
4956e307f3 [NewPM] Port Msan
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350305 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-03 13:42:44 +00:00
whitequark
2c000da033 [bindings/go] Add Go bindings to LLVMGetIndices
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346388 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-08 04:04:04 +00:00
whitequark
9ac4c44c94 [OCaml] Fix incorrect use of CAMLlocal in nested blocks
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346387 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-08 04:00:18 +00:00
Chandler Carruth
17fa14ff8e [TI removal] Remove TerminatorInst references from bindings.
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344726 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-18 07:40:03 +00:00
whitequark
eb5f10b20c [bindings/go] Add Go bindings to the Token type
Summary: This type is necessary for implementing coroutines.

Reviewers: whitequark

Reviewed By: whitequark

Subscribers: modocache, llvm-commits

Differential Revision: https://reviews.llvm.org/D47684

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343345 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-28 17:39:59 +00:00
whitequark
a2e8972f37 [bindings/go] Add Go bindings for inline assembly
Reviewers: harlanhaskins, whitequark, pcc

Reviewed By: pcc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D46437

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343339 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-28 16:48:47 +00:00
whitequark
1bece59b9d Revert "[LLVM-C] Add bindings for addCoroutinePassesToExtensionPoints"
This reverts commit c4baf7c2f06ff5459c4f5998ce980346e72bff97.

Broke the bots, and should really be in Transforms/Coroutines
instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343337 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-28 16:45:18 +00:00
whitequark
411c9caf4f [LLVM-C] Add bindings for addCoroutinePassesToExtensionPoints
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343336 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-28 16:38:11 +00:00
whitequark
f8ed54cc19 [LLVM-C][OCaml] Add UnifyFunctionExitNodes pass to C and OCaml APIs
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342476 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18 13:36:03 +00:00
whitequark
b224dd6536 [LLVM-C][OCaml] Add LowerAtomic pass to C and OCaml APIs
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342475 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18 13:35:50 +00:00
whitequark
1a70735b28 [OCaml] Add OCaml API for LLVMGetIndices
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342474 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18 13:35:39 +00:00
whitequark
fbd5ffcbc2 [OCaml] Add OCaml API for LLVMIsCleanup
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342438 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18 01:48:01 +00:00
whitequark
84b255f977 [NFC][OCaml] Fix copy paste error in file header
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342437 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18 01:47:53 +00:00
whitequark
b81d4c7e5f [NFC][OCaml] Fix implicit declaration compilation warnings
Summary:
2dd4f35c7f 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342436 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18 01:47:44 +00:00
whitequark
6fd937cc44 [LLVM-C][OCaml] Add C and OCaml APIs for llvm::StructType::isLiteral
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342435 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18 01:47:37 +00:00
whitequark
0a0841da51 [OCaml] Add OCaml APIs for Invoke arguments and destinations
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342433 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18 01:47:18 +00:00
whitequark
7aa375cdfe [OCaml] Add GlobalIFunc value kind to OCaml API
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342429 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18 00:01:12 +00:00
whitequark
c753266f48 [OCaml] Add Token type to kind enum in OCaml API
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342428 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18 00:01:01 +00:00