Skip to content

Commit 9d786d7

Browse files
I forgot to update the prototype for LLVMBuildIntCast when correcting
the body to not pass the name for the isSigned parameter. However it seems that changing prototypes is a big-no-no, so here I revert the previous change and pass "true" for isSigned, meaning this always does a signed cast, which was the previous behaviour assuming the name was not NULL! Some other C function needs to be introduced for the general case of signed or unsigned casts. This hopefully unbreaks the ocaml binding. llvm-svn: 89648
1 parent 890a1d1 commit 9d786d7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/include/llvm-c/Core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val,
870870
LLVMTypeRef DestTy, const char *Name);
871871
LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val,
872872
LLVMTypeRef DestTy, const char *Name);
873-
LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val,
873+
LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, /*Signed cast!*/
874874
LLVMTypeRef DestTy, const char *Name);
875875
LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val,
876876
LLVMTypeRef DestTy, const char *Name);

llvm/lib/VMCore/Core.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,9 +1860,9 @@ LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef B, LLVMValueRef Val,
18601860
}
18611861

18621862
LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef B, LLVMValueRef Val,
1863-
LLVMTypeRef DestTy, int isSigned,
1864-
const char *Name) {
1865-
return wrap(unwrap(B)->CreateIntCast(unwrap(Val), unwrap(DestTy), isSigned, Name));
1863+
LLVMTypeRef DestTy, const char *Name) {
1864+
return wrap(unwrap(B)->CreateIntCast(unwrap(Val), unwrap(DestTy),
1865+
/*isSigned*/true, Name));
18661866
}
18671867

18681868
LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef B, LLVMValueRef Val,

0 commit comments

Comments
 (0)