aboutsummaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2020-04-16 20:23:35 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2020-04-20 13:30:03 +0200
commit438d541dbe5fe7d7fe6b7aacaa6e6ef070c2e237 (patch)
treef2ca20b3130b302bdaf3841d6105c8138dd48583 /backend
parent0a2db0269809539ccc66f8ec73637c37fbd23580 (diff)
downloadcompcert-438d541dbe5fe7d7fe6b7aacaa6e6ef070c2e237.tar.gz
compcert-438d541dbe5fe7d7fe6b7aacaa6e6ef070c2e237.zip
Move reserved_registers to CPragmas.
The list of reserved_registers is never reset between the compilation of multiple files. Instead of storing them in IRC they are moved in the CPragmas file and reset in the a new reset function for Cpragmas whic is called per file.
Diffstat (limited to 'backend')
-rw-r--r--backend/IRC.ml4
-rw-r--r--backend/IRC.mli4
2 files changed, 1 insertions, 7 deletions
diff --git a/backend/IRC.ml b/backend/IRC.ml
index b359da35..e94d6fbb 100644
--- a/backend/IRC.ml
+++ b/backend/IRC.ml
@@ -252,12 +252,10 @@ let class_of_loc = function
let no_spill_class = 2
-let reserved_registers = ref ([]: mreg list)
-
let rec remove_reserved = function
| [] -> []
| hd :: tl ->
- if List.mem hd !reserved_registers
+ if List.mem hd !CPragmas.reserved_registers
then remove_reserved tl
else hd :: remove_reserved tl
diff --git a/backend/IRC.mli b/backend/IRC.mli
index 30b6d5c1..59471329 100644
--- a/backend/IRC.mli
+++ b/backend/IRC.mli
@@ -13,7 +13,6 @@
(* Iterated Register Coalescing: George and Appel's graph coloring algorithm *)
open Registers
-open Machregs
open Locations
open XTL
@@ -39,9 +38,6 @@ val add_pref: graph -> var -> var -> unit
(* Color the graph. Return an assignment of locations to variables. *)
val coloring: graph -> (var -> loc)
-(* Machine registers that are reserved and not available for allocation. *)
-val reserved_registers: mreg list ref
-
(* Auxiliaries to deal with register classes *)
val class_of_type: AST.typ -> int
val class_of_loc: loc -> int