Summary: public Move the representation of data-structure into it own module, so that it can be used by modules `Sil` depends from like `Procname`. Reviewed By: jberdine Differential Revision: D2772791 fb-gh-sync-id: cda4e3amaster
parent
bf9dc57a9b
commit
4143d4eb2d
@ -0,0 +1,42 @@
|
||||
(*
|
||||
* Copyright (c) 2015 - present Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*)
|
||||
|
||||
open Utils
|
||||
|
||||
(** Internal representation of data structure for Java, Objective-C and C++ classes,
|
||||
C-style structs struct and union,
|
||||
And Objective C protocol *)
|
||||
|
||||
type t =
|
||||
| Class
|
||||
| Struct
|
||||
| Union
|
||||
| Protocol
|
||||
|
||||
let name = function
|
||||
| Class -> "class"
|
||||
| Struct -> "struct"
|
||||
| Union -> "union"
|
||||
| Protocol -> "protocol"
|
||||
|
||||
let compare dstruct1 dstruct2 =
|
||||
match dstruct1, dstruct2 with
|
||||
| Class, Class -> 0
|
||||
| Class, _ -> -1
|
||||
| _, Class -> 1
|
||||
| Struct, Struct -> 0
|
||||
| Struct, _ -> -1
|
||||
| _, Struct -> 1
|
||||
| Union, Union -> 0
|
||||
| Union, _ -> -1
|
||||
| _, Union -> 1
|
||||
| Protocol, Protocol -> 0
|
||||
|
||||
let equal tn1 tn2 =
|
||||
compare tn1 tn2 = 0
|
@ -0,0 +1,24 @@
|
||||
(*
|
||||
* Copyright (c) 2015 - present Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*)
|
||||
|
||||
(** Internal representation of data structure for Java, Objective-C and C++ classes,
|
||||
C-style structs struct and union,
|
||||
And Objective C protocol *)
|
||||
|
||||
type t =
|
||||
| Class
|
||||
| Struct
|
||||
| Union
|
||||
| Protocol
|
||||
|
||||
val name : t -> string
|
||||
|
||||
val compare : t -> t -> int
|
||||
|
||||
val equal : t -> t -> bool
|
Loading…
Reference in new issue