aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Rename.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2015-04-17 16:30:43 +0200
committerXavier Leroy <xavier.leroy@inria.fr>2015-04-17 16:30:43 +0200
commit1b5db339bb05f773a6a132be4c0b8cea54d50461 (patch)
tree5c7c767bc107eca66fdf6795777821572c5ec5af /cparser/Rename.ml
parent3d751c114fe4611a5b72e160127be09cf6c6cfec (diff)
downloadcompcert-kvx-1b5db339bb05f773a6a132be4c0b8cea54d50461.tar.gz
compcert-kvx-1b5db339bb05f773a6a132be4c0b8cea54d50461.zip
Experiment: support a subset of GCC's extended asm statements.
Diffstat (limited to 'cparser/Rename.ml')
-rw-r--r--cparser/Rename.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/cparser/Rename.ml b/cparser/Rename.ml
index 2b7ec2ca..0d533b56 100644
--- a/cparser/Rename.ml
+++ b/cparser/Rename.ml
@@ -150,6 +150,8 @@ let decl env (sto, id, ty, int) =
match int with None -> None | Some i -> Some(init env' i)),
env')
+let asm_operand env (lbl, cstr, e) = (lbl, cstr, exp env e)
+
let rec stmt env s =
{ sdesc = stmt_desc env s.sdesc; sloc = s.sloc }
@@ -170,7 +172,11 @@ and stmt_desc env = function
| Sreturn a -> Sreturn (optexp env a)
| Sblock sl -> let (sl', _) = mmap stmt_or_decl env sl in Sblock sl'
| Sdecl d -> assert false
- | Sasm txt -> Sasm txt
+ | Sasm(attr, txt, outputs, inputs, flags) ->
+ Sasm(attr, txt,
+ List.map (asm_operand env) outputs,
+ List.map (asm_operand env) inputs,
+ flags)
and stmt_or_decl env s =
match s.sdesc with