[OCaml] Fix bindings after br -> uncondbr+condbr split (#186176)
Update opcode lists after https://github.com/llvm/llvm-project/pull/184027.
This commit is contained in:
parent
8d61e15675
commit
48c7004986
@ -180,7 +180,7 @@ module Opcode = struct
|
||||
| Invalid (* not an instruction *)
|
||||
(* Terminator Instructions *)
|
||||
| Ret
|
||||
| Br
|
||||
| Invalid3
|
||||
| Switch
|
||||
| IndirectBr
|
||||
| Invoke
|
||||
@ -252,6 +252,9 @@ module Opcode = struct
|
||||
| FNeg
|
||||
| CallBr
|
||||
| Freeze
|
||||
| PtrToAddr
|
||||
| UncondBr
|
||||
| CondBr
|
||||
end
|
||||
|
||||
module LandingPadClauseTy = struct
|
||||
@ -1089,7 +1092,7 @@ let is_terminator llv =
|
||||
let open ValueKind in
|
||||
let open Opcode in
|
||||
match classify_value llv with
|
||||
| Instruction (Br | IndirectBr | Invoke | Resume | Ret | Switch | Unreachable)
|
||||
| Instruction (UncondBr | CondBr | IndirectBr | Invoke | Resume | Ret | Switch | Unreachable)
|
||||
-> true
|
||||
| _ -> false
|
||||
|
||||
@ -1133,12 +1136,13 @@ external set_condition : llvalue -> llvalue -> unit
|
||||
external is_conditional : llvalue -> bool = "llvm_is_conditional"
|
||||
|
||||
let get_branch llv =
|
||||
if classify_value llv <> ValueKind.Instruction Opcode.Br then
|
||||
None
|
||||
else if is_conditional llv then
|
||||
let kind = classify_value llv in
|
||||
if kind = ValueKind.Instruction Opcode.UncondBr then
|
||||
Some (`Unconditional (successor llv 0))
|
||||
else if kind = ValueKind.Instruction Opcode.CondBr then
|
||||
Some (`Conditional (condition llv, successor llv 0, successor llv 1))
|
||||
else
|
||||
Some (`Unconditional (successor llv 0))
|
||||
None
|
||||
|
||||
(*--... Operations on phi nodes ............................................--*)
|
||||
external add_incoming : (llvalue * llbasicblock) -> llvalue -> unit
|
||||
|
||||
@ -206,7 +206,7 @@ module Opcode : sig
|
||||
| Invalid (** Not an instruction *)
|
||||
|
||||
| Ret (** Terminator Instructions *)
|
||||
| Br
|
||||
| Invalid3
|
||||
| Switch
|
||||
| IndirectBr
|
||||
| Invoke
|
||||
@ -278,6 +278,9 @@ module Opcode : sig
|
||||
| FNeg
|
||||
| CallBr
|
||||
| Freeze
|
||||
| PtrToAddr
|
||||
| UncondBr
|
||||
| CondBr
|
||||
end
|
||||
|
||||
(** The type of a clause of a [landingpad] instruction.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user