Summary: Cleanup `Typ` by moving all constant types to `StdTyp`. Also remove `Typ.typ` as it's just `Typ.t` now. Reviewed By: jberdine Differential Revision: D24620397 fbshipit-source-id: 4764f87efmaster
parent
310c3f2c34
commit
8c40ed53d7
@ -0,0 +1,71 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
type t = Typ.t
|
||||
|
||||
let boolean = Typ.mk (Tint IBool)
|
||||
|
||||
let char = Typ.mk (Tint IChar)
|
||||
|
||||
let double = Typ.mk (Tfloat FDouble)
|
||||
|
||||
let float = Typ.mk (Tfloat FFloat)
|
||||
|
||||
let int = Typ.mk (Tint IInt)
|
||||
|
||||
let long = Typ.mk (Tint ILong)
|
||||
|
||||
let uint = Typ.mk (Tint IUInt)
|
||||
|
||||
let void = Typ.mk Tvoid
|
||||
|
||||
let void_star = Typ.mk_ptr void
|
||||
|
||||
module Name = struct
|
||||
type t = Typ.Name.t
|
||||
|
||||
module Java = struct
|
||||
open Typ.Name.Java
|
||||
|
||||
let java_io_serializable = from_string "java.io.Serializable"
|
||||
|
||||
let java_lang_class = from_string "java.lang.Class"
|
||||
|
||||
let java_lang_cloneable = from_string "java.lang.Cloneable"
|
||||
|
||||
let java_lang_object = from_string "java.lang.Object"
|
||||
|
||||
let java_lang_string = from_string "java.lang.String"
|
||||
end
|
||||
|
||||
module Objc = struct
|
||||
open Typ.Name.Objc
|
||||
|
||||
let ns_enumerator = from_string "NSEnumerator"
|
||||
end
|
||||
end
|
||||
|
||||
module Java = struct
|
||||
let byte = Typ.mk (Tint ISChar)
|
||||
|
||||
let char = Typ.mk (Tint IUShort)
|
||||
|
||||
let short = Typ.mk (Tint IShort)
|
||||
|
||||
let pointer_to_java_lang_class = Typ.mk_ptr (Typ.mk_struct Name.Java.java_lang_class)
|
||||
|
||||
let pointer_to_java_lang_object = Typ.mk_ptr (Typ.mk_struct Name.Java.java_lang_object)
|
||||
|
||||
let pointer_to_java_lang_string = Typ.mk_ptr (Typ.mk_struct Name.Java.java_lang_string)
|
||||
end
|
||||
|
||||
module Objc = struct
|
||||
let pointer_to_nszone =
|
||||
Typ.(mk_ptr (mk_struct (CStruct (QualifiedCppName.of_qual_string "NSZone"))))
|
||||
end
|
@ -0,0 +1,67 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
type t = Typ.t
|
||||
|
||||
val boolean : t
|
||||
|
||||
val char : t [@@warning "-32"]
|
||||
|
||||
val double : t
|
||||
|
||||
val float : t
|
||||
|
||||
val int : t
|
||||
|
||||
val long : t
|
||||
|
||||
val uint : t
|
||||
|
||||
val void : t
|
||||
|
||||
val void_star : t
|
||||
(** [void*] type *)
|
||||
|
||||
module Name : sig
|
||||
type t = Typ.Name.t
|
||||
|
||||
module Java : sig
|
||||
val java_io_serializable : t
|
||||
|
||||
val java_lang_class : t
|
||||
|
||||
val java_lang_cloneable : t
|
||||
|
||||
val java_lang_object : t
|
||||
|
||||
val java_lang_string : t
|
||||
end
|
||||
|
||||
module Objc : sig
|
||||
val ns_enumerator : t
|
||||
end
|
||||
end
|
||||
|
||||
module Java : sig
|
||||
val byte : t
|
||||
|
||||
val char : t
|
||||
|
||||
val short : t
|
||||
|
||||
val pointer_to_java_lang_class : t
|
||||
|
||||
val pointer_to_java_lang_object : t
|
||||
|
||||
val pointer_to_java_lang_string : t
|
||||
end
|
||||
|
||||
module Objc : sig
|
||||
val pointer_to_nszone : t
|
||||
end
|
Loading…
Reference in new issue