Skip to content

Commit 0182c85

Browse files
authored
[OCaml] Remove deprecated const_nuw_neg and build_nuw_neg APIs (llvm#171466)
I think we usually remove deprecated C API functions from the OCaml bindings right away. These two at least should be essentially useless.
1 parent a22d1b5 commit 0182c85

File tree

4 files changed

+0
-31
lines changed

4 files changed

+0
-31
lines changed

llvm/bindings/ocaml/llvm/llvm.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@ external align_of : lltype -> llvalue = "llvm_align_of"
649649
external size_of : lltype -> llvalue = "llvm_size_of"
650650
external const_neg : llvalue -> llvalue = "llvm_const_neg"
651651
external const_nsw_neg : llvalue -> llvalue = "llvm_const_nsw_neg"
652-
external const_nuw_neg : llvalue -> llvalue = "llvm_const_nuw_neg"
653652
external const_not : llvalue -> llvalue = "llvm_const_not"
654653
external const_add : llvalue -> llvalue -> llvalue = "llvm_const_add"
655654
external const_nsw_add : llvalue -> llvalue -> llvalue = "llvm_const_nsw_add"
@@ -1264,8 +1263,6 @@ external build_neg : llvalue -> string -> llbuilder -> llvalue
12641263
= "llvm_build_neg"
12651264
external build_nsw_neg : llvalue -> string -> llbuilder -> llvalue
12661265
= "llvm_build_nsw_neg"
1267-
external build_nuw_neg : llvalue -> string -> llbuilder -> llvalue
1268-
= "llvm_build_nuw_neg"
12691266
external build_fneg : llvalue -> string -> llbuilder -> llvalue
12701267
= "llvm_build_fneg"
12711268
external build_not : llvalue -> string -> llbuilder -> llvalue

llvm/bindings/ocaml/llvm/llvm.mli

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,11 +1096,6 @@ val const_neg : llvalue -> llvalue
10961096
See the method [llvm::ConstantExpr::getNSWNeg]. *)
10971097
val const_nsw_neg : llvalue -> llvalue
10981098

1099-
(** [const_nuw_neg c] returns the arithmetic negation of the constant [c] with
1100-
no unsigned wrapping. The result is undefined if the negation overflows.
1101-
See the method [llvm::ConstantExpr::getNUWNeg]. *)
1102-
val const_nuw_neg : llvalue -> llvalue
1103-
11041099
(** [const_not c] returns the bitwise inverse of the constant [c].
11051100
See the method [llvm::ConstantExpr::getNot]. *)
11061101
val const_not : llvalue -> llvalue
@@ -2212,13 +2207,6 @@ val build_neg : llvalue -> string -> llbuilder -> llvalue
22122207
See the method [llvm::LLVMBuilder::CreateNeg]. *)
22132208
val build_nsw_neg : llvalue -> string -> llbuilder -> llvalue
22142209

2215-
(** [build_nuw_neg x name b] creates a
2216-
[%name = nuw sub 0, %x]
2217-
instruction at the position specified by the instruction builder [b].
2218-
[-0.0] is used for floating point types to compute the correct sign.
2219-
See the method [llvm::LLVMBuilder::CreateNeg]. *)
2220-
val build_nuw_neg : llvalue -> string -> llbuilder -> llvalue
2221-
22222210
(** [build_fneg x name b] creates a
22232211
[%name = fsub 0, %x]
22242212
instruction at the position specified by the instruction builder [b].

llvm/bindings/ocaml/llvm/llvm_ocaml.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,12 +1164,6 @@ value llvm_const_nsw_neg(value Value) {
11641164
return to_val(NegValue);
11651165
}
11661166

1167-
/* llvalue -> llvalue */
1168-
value llvm_const_nuw_neg(value Value) {
1169-
LLVMValueRef NegValue = LLVMConstNUWNeg(Value_val(Value));
1170-
return to_val(NegValue);
1171-
}
1172-
11731167
/* llvalue -> llvalue */
11741168
value llvm_const_not(value Value) {
11751169
LLVMValueRef NotValue = LLVMConstNot(Value_val(Value));
@@ -2360,12 +2354,6 @@ value llvm_build_nsw_neg(value X, value Name, value B) {
23602354
LLVMBuildNSWNeg(Builder_val(B), Value_val(X), String_val(Name)));
23612355
}
23622356

2363-
/* llvalue -> string -> llbuilder -> llvalue */
2364-
value llvm_build_nuw_neg(value X, value Name, value B) {
2365-
return to_val(
2366-
LLVMBuildNUWNeg(Builder_val(B), Value_val(X), String_val(Name)));
2367-
}
2368-
23692357
/* llvalue -> string -> llbuilder -> llvalue */
23702358
value llvm_build_fneg(value X, value Name, value B) {
23712359
return to_val(LLVMBuildFNeg(Builder_val(B), Value_val(X), String_val(Name)));

llvm/test/Bindings/OCaml/core.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ let test_constants () =
263263
group "constant arithmetic";
264264
(* CHECK: @const_neg = global i64 sub
265265
* CHECK: @const_nsw_neg = global i64 sub nsw
266-
* CHECK: @const_nuw_neg = global i64 sub
267266
* CHECK: @const_not = global i64 xor
268267
* CHECK: @const_add = global i64 add
269268
* CHECK: @const_nsw_add = global i64 add nsw
@@ -279,7 +278,6 @@ let test_constants () =
279278
let foldbomb = const_ptrtoint foldbomb_gv i64_type in
280279
ignore (define_global "const_neg" (const_neg foldbomb) m);
281280
ignore (define_global "const_nsw_neg" (const_nsw_neg foldbomb) m);
282-
ignore (define_global "const_nuw_neg" (const_nuw_neg foldbomb) m);
283281
ignore (define_global "const_not" (const_not foldbomb) m);
284282
ignore (define_global "const_add" (const_add foldbomb five) m);
285283
ignore (define_global "const_nsw_add" (const_nsw_add foldbomb five) m);
@@ -1318,7 +1316,6 @@ let test_builder () =
13181316
* CHECK: %build_xor = xor i32 %P1, %P2
13191317
* CHECK: %build_neg = sub i32 0, %P1
13201318
* CHECK: %build_nsw_neg = sub nsw i32 0, %P1
1321-
* CHECK: %build_nuw_neg = sub nuw i32 0, %P1
13221319
* CHECK: %build_fneg = fneg float %F1
13231320
* CHECK: %build_not = xor i32 %P1, -1
13241321
* CHECK: %build_freeze = freeze i32 %P1
@@ -1350,7 +1347,6 @@ let test_builder () =
13501347
ignore (build_xor p1 p2 "build_xor" b);
13511348
ignore (build_neg p1 "build_neg" b);
13521349
ignore (build_nsw_neg p1 "build_nsw_neg" b);
1353-
ignore (build_nuw_neg p1 "build_nuw_neg" b);
13541350
ignore (build_fneg f1 "build_fneg" b);
13551351
ignore (build_not p1 "build_not" b);
13561352
ignore (build_freeze p1 "build_freeze" b);

0 commit comments

Comments
 (0)