diff options
author | Robert Widmann <devteam.codafi@gmail.com> | 2019-01-08 06:23:22 +0000 |
---|---|---|
committer | Robert Widmann <devteam.codafi@gmail.com> | 2019-01-08 06:23:22 +0000 |
commit | 40dc48be0ead4682b96af15b487b981cbd48572e (patch) | |
tree | ebf3ef260adeefcb3e69ac33d2b3c5c85471f87d /llvm/lib/IR | |
parent | f286bee9fe8c981659e2d4c2c527881b82ab644a (diff) | |
download | bcm5719-llvm-40dc48be0ead4682b96af15b487b981cbd48572e.tar.gz bcm5719-llvm-40dc48be0ead4682b96af15b487b981cbd48572e.zip |
[LLVM-C] Allow Specifying Signedness in Int Cast
Summary: Fix an old outstanding problem with the int cast builder binding always assuming the cast is signed by introducing a new LLVMBuildIntCast2 operation and deprecating the old prototype.
Reviewers: whitequark, deadalnix
Reviewed By: whitequark
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D56280
llvm-svn: 350607
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/Core.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index 4064b674fa0..921c830cbf7 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -3534,6 +3534,13 @@ LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef B, LLVMValueRef Val, return wrap(unwrap(B)->CreatePointerCast(unwrap(Val), unwrap(DestTy), Name)); } +LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef B, LLVMValueRef Val, + LLVMTypeRef DestTy, LLVMBool IsSigned, + const char *Name, size_t NameLen) { + return wrap(unwrap(B)->CreateIntCast(unwrap(Val), unwrap(DestTy), + IsSigned, StringRef(Name, NameLen))); +} + LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef B, LLVMValueRef Val, LLVMTypeRef DestTy, const char *Name) { return wrap(unwrap(B)->CreateIntCast(unwrap(Val), unwrap(DestTy), |