Skip to content
Snippets Groups Projects
Commit c34eb69b authored by Allan Blanchard's avatar Allan Blanchard
Browse files

[Builtin] Override Std becomes Builtin

parent 6c5f6649
No related branches found
No related tags found
No related merge requests found
Showing
with 44 additions and 44 deletions
...@@ -930,24 +930,24 @@ src/plugins/occurrence/options.mli: CEA_LGPL_OR_PROPRIETARY ...@@ -930,24 +930,24 @@ src/plugins/occurrence/options.mli: CEA_LGPL_OR_PROPRIETARY
src/plugins/occurrence/register.ml: CEA_LGPL_OR_PROPRIETARY src/plugins/occurrence/register.ml: CEA_LGPL_OR_PROPRIETARY
src/plugins/occurrence/register_gui.ml: CEA_LGPL_OR_PROPRIETARY src/plugins/occurrence/register_gui.ml: CEA_LGPL_OR_PROPRIETARY
src/plugins/occurrence/register_gui.mli: CEA_LGPL_OR_PROPRIETARY src/plugins/occurrence/register_gui.mli: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/basic_blocks.ml: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/basic_blocks.ml: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/basic_blocks.mli: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/basic_blocks.mli: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/configure.ac: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/builtin_cache.ml: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/Makefile.in: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/builtin_cache.mli: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/memcmp.ml: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/Builtin.mli: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/memcmp.mli: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/configure.ac: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/memcpy.ml: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/Makefile.in: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/memcpy.mli: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/memcmp.ml: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/memmove.ml: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/memcmp.mli: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/memmove.mli: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/memcpy.ml: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/options.ml: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/memcpy.mli: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/options.mli: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/memmove.ml: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/override_table.ml: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/memmove.mli: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/override_table.mli: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/options.ml: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/OverrideStd.mli: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/options.mli: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/register.ml: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/register.ml: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/transform.ml: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/transform.ml: CEA_LGPL_OR_PROPRIETARY
src/plugins/override_std/transform.mli: CEA_LGPL_OR_PROPRIETARY src/plugins/builtin/transform.mli: CEA_LGPL_OR_PROPRIETARY
src/plugins/pdg/Pdg.mli: CEA_LGPL_OR_PROPRIETARY src/plugins/pdg/Pdg.mli: CEA_LGPL_OR_PROPRIETARY
src/plugins/pdg/annot.ml: CEA_LGPL_OR_PROPRIETARY src/plugins/pdg/annot.ml: CEA_LGPL_OR_PROPRIETARY
src/plugins/pdg/annot.mli: CEA_LGPL_OR_PROPRIETARY src/plugins/pdg/annot.mli: CEA_LGPL_OR_PROPRIETARY
......
...@@ -34,10 +34,10 @@ endif ...@@ -34,10 +34,10 @@ endif
################### ###################
PLUGIN_DIR ?= . PLUGIN_DIR ?= .
PLUGIN_ENABLE := @ENABLE_OVERRIDE_STD@ PLUGIN_ENABLE := @ENABLE_BUILTIN@
PLUGIN_NAME := OverrideStd PLUGIN_NAME := Builtin
PLUGIN_CMI := PLUGIN_CMI :=
PLUGIN_CMO := options transform override_table basic_blocks memcpy memcmp memmove register PLUGIN_CMO := options transform builtin_cache basic_blocks memcpy memcmp memmove register
PLUGIN_DISTRIBUTED := $(PLUGIN_ENABLE) PLUGIN_DISTRIBUTED := $(PLUGIN_ENABLE)
PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure PLUGIN_DISTRIB_EXTERNAL:= Makefile.in configure.ac configure
#PLUGIN_NO_DEFAULT_TEST := no #PLUGIN_NO_DEFAULT_TEST := no
...@@ -59,6 +59,6 @@ else ...@@ -59,6 +59,6 @@ else
CONFIG_STATUS_DIR=. CONFIG_STATUS_DIR=.
endif endif
$(OverrideStd_DIR)/Makefile: $(OverrideStd_DIR)/Makefile.in \ $(Builtin_DIR)/Makefile: $(Builtin_DIR)/Makefile.in \
$(CONFIG_STATUS_DIR)/config.status $(CONFIG_STATUS_DIR)/config.status
cd $(CONFIG_STATUS_DIR) && ./config.status --file $@ cd $(CONFIG_STATUS_DIR) && ./config.status --file $@
...@@ -21,29 +21,29 @@ ...@@ -21,29 +21,29 @@
(**************************************************************************) (**************************************************************************)
module type Table = sig module type Table = sig
val get_override: Cil_types.typ -> Cil_types.varinfo val get_function: Cil_types.typ -> Cil_types.varinfo
val get_globals: Cil_types.location -> Cil_types.global list val get_globals: Cil_types.location -> Cil_types.global list
val mark_as_computed: ?project:Project.t -> unit -> unit val mark_as_computed: ?project:Project.t -> unit -> unit
end end
module type Override_generator = sig module type Generator = sig
val function_name: String.t val function_name: String.t
val build_prototype: Cil_types.typ -> Cil_types.varinfo val build_prototype: Cil_types.typ -> Cil_types.varinfo
val build_spec: Cil_types.varinfo -> Cil_types.location -> Cil_types.funspec val build_spec: Cil_types.varinfo -> Cil_types.location -> Cil_types.funspec
end end
module Make_internal_table (M: Override_generator) = module Make_internal_table (M: Generator) =
(State_builder.Hashtbl(Cil_datatype.Typ.Hashtbl) (Cil_datatype.Varinfo) (State_builder.Hashtbl(Cil_datatype.Typ.Hashtbl) (Cil_datatype.Varinfo)
(struct (struct
let size = 5 let size = 5
let dependencies = [Ast.self] let dependencies = [Ast.self]
let name = "Override." ^ M.function_name let name = "Builtins." ^ M.function_name
end)) end))
module Make (Generator: Override_generator) = struct module Make (Generator: Generator) = struct
module Internal_table = Make_internal_table(Generator) module Internal_table = Make_internal_table(Generator)
let get_override t = try let get_function t = try
Internal_table.find t Internal_table.find t
with Not_found -> with Not_found ->
let fct = Generator.build_prototype t in let fct = Generator.build_prototype t in
......
...@@ -20,16 +20,16 @@ ...@@ -20,16 +20,16 @@
(* *) (* *)
(**************************************************************************) (**************************************************************************)
module type Override_generator = sig module type Generator = sig
val function_name: String.t val function_name: String.t
val build_prototype: Cil_types.typ -> Cil_types.varinfo val build_prototype: Cil_types.typ -> Cil_types.varinfo
val build_spec: Cil_types.varinfo -> Cil_types.location -> Cil_types.funspec val build_spec: Cil_types.varinfo -> Cil_types.location -> Cil_types.funspec
end end
module type Table = sig module type Table = sig
val get_override: Cil_types.typ -> Cil_types.varinfo val get_function: Cil_types.typ -> Cil_types.varinfo
val get_globals: Cil_types.location -> Cil_types.global list val get_globals: Cil_types.location -> Cil_types.global list
val mark_as_computed: ?project:Project.t -> unit -> unit val mark_as_computed: ?project:Project.t -> unit -> unit
end end
module Make (M: Override_generator) : Table module Make (M: Generator) : Table
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
########################################################################## ##########################################################################
########################################## ##########################################
# Override stdlib C plugin # # Builtin stdlib C plugin #
########################################## ##########################################
m4_define([plugin_file],Makefile.in) m4_define([plugin_file],Makefile.in)
...@@ -35,8 +35,8 @@ m4_define([FRAMAC_SHARE], ...@@ -35,8 +35,8 @@ m4_define([FRAMAC_SHARE],
m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)]) m4_ifndef([FRAMAC_M4_MACROS], [m4_include(FRAMAC_SHARE/configure.ac)])
check_plugin(overridestd,PLUGIN_RELATIVE_PATH(plugin_file), check_plugin(builtin,PLUGIN_RELATIVE_PATH(plugin_file),
[support for override-std plug-in],yes) [support for builtin plug-in],yes)
####################### #######################
# Generating Makefile # # Generating Makefile #
......
...@@ -84,7 +84,7 @@ let generate_prototype t = ...@@ -84,7 +84,7 @@ let generate_prototype t =
Cil.setFormalsDecl vi fun_t ; Cil.setFormalsDecl vi fun_t ;
vi vi
module Table = Override_table.Make(struct module Table = Builtin_cache.Make(struct
let function_name = function_name let function_name = function_name
let build_prototype = generate_prototype let build_prototype = generate_prototype
let build_spec = generate_spec let build_spec = generate_spec
...@@ -104,7 +104,7 @@ let well_typed_parameters s1 s2 = ...@@ -104,7 +104,7 @@ let well_typed_parameters s1 s2 =
let create_call fct (s1, s2, len) = let create_call fct (s1, s2, len) =
if well_typed_parameters s1 s2 then if well_typed_parameters s1 s2 then
let typ = type_from_parameter s1 in let typ = type_from_parameter s1 in
let fct = Table.get_override typ in let fct = Table.get_function typ in
let s1 = Cil.stripCasts s1 in let s1 = Cil.stripCasts s1 in
let s2 = Cil.stripCasts s2 in let s2 = Cil.stripCasts s2 in
fct, (s1, s2, len) fct, (s1, s2, len)
......
...@@ -87,7 +87,7 @@ let generate_prototype t = ...@@ -87,7 +87,7 @@ let generate_prototype t =
Cil.setFormalsDecl vi fun_t ; Cil.setFormalsDecl vi fun_t ;
vi vi
module Table = Override_table.Make(struct module Table = Builtin_cache.Make(struct
let function_name = function_name let function_name = function_name
let build_prototype = generate_prototype let build_prototype = generate_prototype
let build_spec = generate_spec let build_spec = generate_spec
...@@ -107,7 +107,7 @@ let well_typed_parameters dest src = ...@@ -107,7 +107,7 @@ let well_typed_parameters dest src =
let create_call fct (dest, src, len) = let create_call fct (dest, src, len) =
if well_typed_parameters dest src then if well_typed_parameters dest src then
let typ = type_from_parameter dest in let typ = type_from_parameter dest in
let fct = Table.get_override typ in let fct = Table.get_function typ in
let dest = Cil.stripCasts dest in let dest = Cil.stripCasts dest in
let src = Cil.stripCasts src in let src = Cil.stripCasts src in
fct, (dest, src, len) fct, (dest, src, len)
......
...@@ -82,7 +82,7 @@ let generate_prototype t = ...@@ -82,7 +82,7 @@ let generate_prototype t =
Cil.setFormalsDecl vi fun_t ; Cil.setFormalsDecl vi fun_t ;
vi vi
module Table = Override_table.Make(struct module Table = Builtin_cache.Make(struct
let function_name = function_name let function_name = function_name
let build_prototype = generate_prototype let build_prototype = generate_prototype
let build_spec = generate_spec let build_spec = generate_spec
...@@ -102,7 +102,7 @@ let well_typed_parameters dest src = ...@@ -102,7 +102,7 @@ let well_typed_parameters dest src =
let create_call fct (dest, src, len) = let create_call fct (dest, src, len) =
if well_typed_parameters dest src then if well_typed_parameters dest src then
let typ = type_from_parameter dest in let typ = type_from_parameter dest in
let fct = Table.get_override typ in let fct = Table.get_function typ in
let dest = Cil.stripCasts dest in let dest = Cil.stripCasts dest in
let src = Cil.stripCasts src in let src = Cil.stripCasts src in
fct, (dest, src, len) fct, (dest, src, len)
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
(* *) (* *)
(**************************************************************************) (**************************************************************************)
let name = "Override Std" let name = "Builtin"
let shortname = "override-std" let shortname = "builtin"
include Plugin.Register include Plugin.Register
(struct (struct
...@@ -32,7 +32,7 @@ include Plugin.Register ...@@ -32,7 +32,7 @@ include Plugin.Register
module Enabled = False module Enabled = False
(struct (struct
let option_name = "-override-std" let option_name = "-builtin"
let help = "" let help = ""
end) end)
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
(* *) (* *)
(**************************************************************************) (**************************************************************************)
let category = File.register_code_transformation_category "override-std" let category = File.register_code_transformation_category "builtin"
let () = let () =
let perform file = let perform file =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment