Skip to content

Commit

Permalink
[swift] Llair to Textual: translate load and store
Browse files Browse the repository at this point in the history
Summary: Here we have direct correspondence in the two languages. Using the type inference.

Reviewed By: ngorogiannis

Differential Revision: D69992859

fbshipit-source-id: fd123f45a6975bd2b21978da04957df91324df88
  • Loading branch information
dulmarod authored and facebook-github-bot committed Feb 24, 2025
1 parent 1278f41 commit 402761c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion infer/src/swift/Llair2Textual.ml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,19 @@ let cmnd_to_instrs block =
let to_instr inst =
(* TODO translate instructions *)
match inst with
| Move _ | Load _ | Store _ | AtomicRMW _ | AtomicCmpXchg _ | Alloc _ | Free _ | Nondet _ ->
| Move _ ->
assert false
| Load {reg; ptr; loc} ->
let loc = to_textual_loc loc in
let id = reg_to_id reg in
let exp = to_textual_exp ptr in
Textual.Instr.Load {id; exp; typ= None; loc}
| Store {ptr; exp; loc} ->
let loc = to_textual_loc loc in
let exp1 = to_textual_exp ptr in
let exp2 = to_textual_exp exp in
Textual.Instr.Store {exp1; typ= None; exp2; loc}
| AtomicRMW _ | AtomicCmpXchg _ | Alloc _ | Free _ | Nondet _ ->
assert false
| Builtin {reg; name; args; loc} ->
to_textual_builtin reg name args loc
Expand Down

0 comments on commit 402761c

Please sign in to comment.