[llvm] [RemoveDIs] Add a 'BeforeDbgRecords' parameter to C API isnt insertion functions (PR #92417)

via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 16:13:26 PDT 2024


================
@@ -1152,6 +1154,7 @@ let builder_before context i = builder_at context (Before i)
 let builder_at_end context bb = builder_at context (At_end bb)
 
 let position_before i = position_builder (Before i)
+let position_before_dbg_records i = position_builder2 (Before i) true
----------------
alan-j-hu wrote:

Whoops, this didn't get attached to my code review.

I am wondering about whether positioning after the debug records is the correct "default" behavior.

Would an optional argument be an appropriate choice here?

In `llvm.mli`:

```ocaml
val position_before : ?before_dbg_records:bool -> llpos -> llbuilder -> unit
```

In `llvm.ml`:

```ocaml
let position_builder (?before_dbg_records=true) i = position_builder2 (Before i) before_dbg_records
```

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


More information about the llvm-commits mailing list