[llvm] [OCaml][NPM] Add OCaml bindings to new pass manager (PR #66421)

Josh Berdine via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 13:31:05 PDT 2023


================
@@ -0,0 +1,85 @@
+(*===-- llvm_passbuilder.mli - LLVM OCaml Interface ------------*- OCaml -*-===*
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===----------------------------------------------------------------------===*)
+
+type llpassbuilder_options
+
+(** [run_passes m passes tm opts] runs a set of passes over a module. The
+    format of the string [passes] is the same as opt's -passes argument for
+    the new pass manager. Individual passes may be specified, separated by
+    commas. Full pipelines may also be invoked. *)
----------------
jberdine wrote:

Would it be helpful to add a crossref to `LLVMRunPasses`, or whatever the corresponding C++ function in the doxygen is?

I think it would be good to explicitly state what the two cases of the `result` mean in LLVM terms, in particular to state that the returned string is obtained from `LLVMGetErrorMessage`, if only for users who are familiar with LLVM-C.

https://github.com/llvm/llvm-project/pull/66421


More information about the llvm-commits mailing list