[IR] Do not use JBasics.java_lang_object in IR/backend

Summary:
In order to have only InferJava depend on JBasics, do not use
JBasics.java_lang_object in the IR or backend.  Note that this implies
that the Java frontend should ideally translate JBasics.java_lang_object
to Typename.Java.java_lang_Object.

Reviewed By: jeremydubreil

Differential Revision: D3956468

fbshipit-source-id: def64dd
master
Josh Berdine 8 years ago committed by Facebook Github Bot
parent 609d1f9058
commit 3ddc23d7e5

@ -48,6 +48,7 @@ let module Java = {
fun fun
| TN_csu (Class Java) _ => true | TN_csu (Class Java) _ => true
| _ => false; | _ => false;
let java_lang_Object = from_string "java.lang.Object";
}; };
type typename_t = t; type typename_t = t;

@ -40,6 +40,7 @@ let module Java: {
/** [is_class name] holds if [name] names a Java class */ /** [is_class name] holds if [name] names a Java class */
let is_class: t => bool; let is_class: t => bool;
let java_lang_Object: t;
}; };
let module Set: Set.S with type elt = t; let module Set: Set.S with type elt = t;

@ -1524,7 +1524,7 @@ let expand_hpred_pointer =
module Subtyping_check = module Subtyping_check =
struct struct
let object_type = Typename.Java.from_string JConfig.object_cl let object_type = Typename.Java.java_lang_Object
let serializable_type = Typename.Java.from_string "java.io.Serializable" let serializable_type = Typename.Java.from_string "java.io.Serializable"

@ -19,7 +19,7 @@ let sources0 = [
{ {
classname = "com.facebook.infer.builtins.InferTaint"; classname = "com.facebook.infer.builtins.InferTaint";
method_name = "inferSecretSource"; method_name = "inferSecretSource";
ret_type = JConfig.object_cl; ret_type = "java.lang.Object";
params = []; params = [];
is_static = true; is_static = true;
taint_kind = Tk_unknown; taint_kind = Tk_unknown;
@ -28,7 +28,7 @@ let sources0 = [
{ {
classname = "com.facebook.infer.builtins.InferTaint"; classname = "com.facebook.infer.builtins.InferTaint";
method_name = "inferSecretSourceUndefined"; method_name = "inferSecretSourceUndefined";
ret_type = JConfig.object_cl; ret_type = "java.lang.Object";
params = []; params = [];
is_static = true; is_static = true;
taint_kind = Tk_unknown; taint_kind = Tk_unknown;
@ -66,7 +66,7 @@ let sinks = [
classname = "com.facebook.infer.builtins.InferTaint"; classname = "com.facebook.infer.builtins.InferTaint";
method_name = "inferSensitiveSink"; method_name = "inferSensitiveSink";
ret_type = "void"; ret_type = "void";
params = [JConfig.object_cl]; params = ["java.lang.Object"];
is_static = true; is_static = true;
taint_kind = Tk_unknown; taint_kind = Tk_unknown;
language = Config.Java language = Config.Java
@ -75,7 +75,7 @@ let sinks = [
classname = "com.facebook.infer.builtins.InferTaint"; classname = "com.facebook.infer.builtins.InferTaint";
method_name = "inferSensitiveSinkUndefined"; method_name = "inferSensitiveSinkUndefined";
ret_type = "void"; ret_type = "void";
params = [JConfig.object_cl]; params = ["java.lang.Object"];
is_static = true; is_static = true;
taint_kind = Tk_unknown; taint_kind = Tk_unknown;
language = Config.Java language = Config.Java

@ -26,7 +26,7 @@ type taint_spec = {
let type_is_object typ = let type_is_object typ =
match typ with match typ with
| Typ.Tptr (Tstruct name, _) -> string_equal (Typename.name name) JConfig.object_cl | Typ.Tptr (Tstruct name, _) -> Typename.equal name Typename.Java.java_lang_Object
| _ -> false | _ -> false
let java_proc_name_with_class_method pn_java class_with_path method_name = let java_proc_name_with_class_method pn_java class_with_path method_name =

@ -61,7 +61,7 @@ let default_format_type_name
| "c" -> "java.lang.Character" | "c" -> "java.lang.Character"
| "b" -> "java.lang.Boolean" | "b" -> "java.lang.Boolean"
| "s" -> "java.lang.String" | "s" -> "java.lang.String"
| "h" | "H" -> JConfig.object_cl | "h" | "H" -> "java.lang.Object"
| _ -> "unknown" | _ -> "unknown"
let format_type_matches_given_type let format_type_matches_given_type

@ -22,8 +22,6 @@ let infer_array_cl = builtins_package ^ ".InferArray"
let infer_undefined_cl = builtins_package ^ ".InferUndefined" let infer_undefined_cl = builtins_package ^ ".InferUndefined"
let object_cl = JBasics.cn_name JBasics.java_lang_object
let obj_type = (JBasics.TObject (JBasics.TClass JBasics.java_lang_object)) let obj_type = (JBasics.TObject (JBasics.TClass JBasics.java_lang_object))
let bool_type = JBasics.TBasic `Bool let bool_type = JBasics.TBasic `Bool

Loading…
Cancel
Save