aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cleanup.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2018-04-10 08:50:34 +0200
committerXavier Leroy <xavier.leroy@inria.fr>2018-04-10 08:50:34 +0200
commite417b9467400b997b2e92deff1fa597d0dce479f (patch)
tree27a6e6bc3d0cb40a0fe4a29e362e84cc6304e09e /cparser/Cleanup.ml
parenta51d625ac5005c2b2f701396e2c75d82eb102e30 (diff)
downloadcompcert-kvx-e417b9467400b997b2e92deff1fa597d0dce479f.tar.gz
compcert-kvx-e417b9467400b997b2e92deff1fa597d0dce479f.zip
Revert "preserve static initialized variables (#81)"
This part of PR#81 causes problems with long double static variables in math.h. Revert to the old behavior of not including static variables unless actually referenced.
Diffstat (limited to 'cparser/Cleanup.ml')
-rw-r--r--cparser/Cleanup.ml11
1 files changed, 2 insertions, 9 deletions
diff --git a/cparser/Cleanup.ml b/cparser/Cleanup.ml
index 75ee0e5a..c10eeb55 100644
--- a/cparser/Cleanup.ml
+++ b/cparser/Cleanup.ml
@@ -123,18 +123,11 @@ let add_enum e =
Externally-visible globals include a minima:
- Definitions of functions, unless "static" or "inline".
- Declaration of variables with default storage.
-
- We choose to also treat as visible and therefore to keep:
- - "static" initialized variables, so that the checks on initializers
- performed in C2C are performed on all initializers.
- If the variable turns out to be unused, it will be removed
- later by the Unusedglob pass.
*)
let visible_decl (sto, id, ty, init) =
- init <> None ||
- (sto = Storage_default &&
- match ty with TFun _ -> false | _ -> true)
+ sto = Storage_default &&
+ match ty with TFun _ -> false | _ -> true
let visible_fundef f =
match f.fd_storage with