aboutsummaryrefslogtreecommitdiffstats
path: root/cfrontend
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2009-11-01 16:51:47 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2009-11-01 16:51:47 +0000
commit3ccc93675292bf9a44ac0d7111d3f44981e1f56d (patch)
tree2879f37d1625e035f21134bc2307fce427531ce4 /cfrontend
parent033aa0555a209fa3e825b1eeb8a5fc00ff8163e3 (diff)
downloadcompcert-3ccc93675292bf9a44ac0d7111d3f44981e1f56d.tar.gz
compcert-3ccc93675292bf9a44ac0d7111d3f44981e1f56d.zip
Preliminary support for small data area in PowerPC port.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1163 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend')
-rw-r--r--cfrontend/Cil2Csyntax.ml15
1 files changed, 15 insertions, 0 deletions
diff --git a/cfrontend/Cil2Csyntax.ml b/cfrontend/Cil2Csyntax.ml
index b8a88deb..20a5b7a6 100644
--- a/cfrontend/Cil2Csyntax.ml
+++ b/cfrontend/Cil2Csyntax.ml
@@ -1252,3 +1252,18 @@ let atom_is_readonly a =
with Not_found ->
false
+let atom_is_small_data a ofs =
+ match Configuration.system with
+ | "linux" ->
+ if !Clflags.option_fsda then begin
+ try
+ let v = Hashtbl.find varinfo_atom a in
+ let sz = Cil.bitsSizeOf v.vtype / 8 in
+ let ofs = camlint_of_coqint ofs in
+ sz <= 8 && ofs >= 0l && ofs < Int32.of_int sz
+ with Not_found ->
+ false
+ end else
+ false
+ | _ ->
+ false