refonte location_of pas sûr
This commit is contained in:
parent
9aa28054f7
commit
5a17c4164e
1 changed files with 6 additions and 6 deletions
|
@ -554,12 +554,12 @@ module FrameManager (IS : InstructionSelector) : FrameManager = struct
|
||||||
|
|
||||||
|
|
||||||
let location_of fd id : T.address =
|
let location_of fd id : T.address =
|
||||||
(* TODO: use fd *)
|
|
||||||
{ offset = Some (Lab (data_label_of_global id))
|
match S.IdMap.find_opt id fd.stack_map with
|
||||||
; base = Some RIP
|
(* Si on retrouve id dans la stack map, alors c'est une variable locale*)
|
||||||
; idx = None
|
| Some o -> {offset = Some (Lit o); base = Some (RBP); idx = None; scale = `One;}
|
||||||
; scale = `One
|
(* Sinon, variable globale*)
|
||||||
}
|
| None -> {offset = Some (Lab (data_label_of_global id)); base = Some (RIP); idx = None; scale = `One;}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
open T (* Necessaire pour pouvoir créer des instructions*)
|
open T (* Necessaire pour pouvoir créer des instructions*)
|
||||||
|
|
Reference in a new issue