diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-03-27 15:16:21 +0100 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2020-03-27 15:16:21 +0100 |
commit | b1c8e25e7756be73d16cc6dd08879f1f552ce5fc (patch) | |
tree | cff646ad7ee7471266e99a7e756912b26f722635 | |
parent | a846ae7397353959c0b2025e31d94b9f6a01435d (diff) | |
download | compcert-kvx-b1c8e25e7756be73d16cc6dd08879f1f552ce5fc.tar.gz compcert-kvx-b1c8e25e7756be73d16cc6dd08879f1f552ce5fc.zip |
pass to insert a nop at start position in functions
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | backend/FirstNop.v | 18 |
2 files changed, 19 insertions, 0 deletions
@@ -94,6 +94,7 @@ BACKEND=\ Unusedglob.v Unusedglobproof.v \ Machregs.v Locations.v Conventions1.v Conventions.v LTL.v \ ForwardMoves.v ForwardMovesproof.v \ + FirstNop.v \ Allnontrap.v Allnontrapproof.v \ Allocation.v Allocproof.v \ Tunneling.v Tunnelingproof.v \ diff --git a/backend/FirstNop.v b/backend/FirstNop.v new file mode 100644 index 00000000..3d2211bc --- /dev/null +++ b/backend/FirstNop.v @@ -0,0 +1,18 @@ +Require Import Coqlib Maps Errors Integers Floats Lattice Kildall. +Require Import AST Linking. +Require Import Memory Registers Op RTL. + +Definition transf_function (f: function) : function := + let start_pc := max_pc_function f in + {| fn_sig := f.(fn_sig); + fn_params := f.(fn_params); + fn_stacksize := f.(fn_stacksize); + fn_code := PTree.set start_pc (Inop f.(fn_entrypoint)) f.(fn_code); + fn_entrypoint := start_pc |}. + +Definition transf_fundef (fd: fundef) : fundef := + AST.transf_fundef transf_function fd. + +Definition transf_program (p: program) : program := + transform_program transf_fundef p. + |