aboutsummaryrefslogtreecommitdiffstats
path: root/backend/FirstNop.v
diff options
context:
space:
mode:
Diffstat (limited to 'backend/FirstNop.v')
-rw-r--r--backend/FirstNop.v30
1 files changed, 30 insertions, 0 deletions
diff --git a/backend/FirstNop.v b/backend/FirstNop.v
new file mode 100644
index 00000000..b3c765e4
--- /dev/null
+++ b/backend/FirstNop.v
@@ -0,0 +1,30 @@
+(* *************************************************************)
+(* *)
+(* The Compcert verified compiler *)
+(* *)
+(* David Monniaux CNRS, VERIMAG *)
+(* *)
+(* Copyright VERIMAG. All rights reserved. *)
+(* This file is distributed under the terms of the INRIA *)
+(* Non-Commercial License Agreement. *)
+(* *)
+(* *************************************************************)
+
+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 := Pos.succ (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.
+