From 31093801d491157c7085a5e12197c52061dec973 Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Wed, 2 Nov 2016 10:51:27 -0700 Subject: [PATCH] [traces] Move all trace-related files to checkers Summary: Other checkers are going to start using these, so they shouldn't live in the Quandary directory anymore Reviewed By: jvillard Differential Revision: D4117359 fbshipit-source-id: e3f151e --- .../src/{quandary => checkers}/Passthrough.ml | 0 .../{quandary => checkers}/Passthrough.mli | 0 infer/src/{quandary => checkers}/Sink.ml | 0 infer/src/checkers/Sink.mli | 27 +++++++++++++++++++ infer/src/{quandary => checkers}/Source.ml | 0 infer/src/checkers/Source.mli | 21 +++++++++++++++ infer/src/{quandary => checkers}/Trace.ml | 0 infer/src/{quandary => checkers}/Trace.mli | 0 infer/src/{quandary => checkers}/TraceElem.ml | 0 9 files changed, 48 insertions(+) rename infer/src/{quandary => checkers}/Passthrough.ml (100%) rename infer/src/{quandary => checkers}/Passthrough.mli (100%) rename infer/src/{quandary => checkers}/Sink.ml (100%) create mode 100644 infer/src/checkers/Sink.mli rename infer/src/{quandary => checkers}/Source.ml (100%) create mode 100644 infer/src/checkers/Source.mli rename infer/src/{quandary => checkers}/Trace.ml (100%) rename infer/src/{quandary => checkers}/Trace.mli (100%) rename infer/src/{quandary => checkers}/TraceElem.ml (100%) diff --git a/infer/src/quandary/Passthrough.ml b/infer/src/checkers/Passthrough.ml similarity index 100% rename from infer/src/quandary/Passthrough.ml rename to infer/src/checkers/Passthrough.ml diff --git a/infer/src/quandary/Passthrough.mli b/infer/src/checkers/Passthrough.mli similarity index 100% rename from infer/src/quandary/Passthrough.mli rename to infer/src/checkers/Passthrough.mli diff --git a/infer/src/quandary/Sink.ml b/infer/src/checkers/Sink.ml similarity index 100% rename from infer/src/quandary/Sink.ml rename to infer/src/checkers/Sink.ml diff --git a/infer/src/checkers/Sink.mli b/infer/src/checkers/Sink.mli new file mode 100644 index 000000000..6e91439f0 --- /dev/null +++ b/infer/src/checkers/Sink.mli @@ -0,0 +1,27 @@ +(* + * Copyright (c) 2016 - 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. + *) + +type 'a parameter = + { sink : 'a; + (** sink type of the parameter *) + index : int; + (** index of the parameter *) + report_reachable : bool; + (** if true, report if *any* value heap-reachable from the sink parameter is a source. + if false, report only if the value passed to the sink is itself a source *) + } + +val make_sink_param : 'a -> int -> report_reachable:bool -> 'a parameter + +module type S = sig + include TraceElem.S + + (** return the parameter index and sink kind for the given call site with the given actuals *) + val get : CallSite.t -> (Exp.t * Typ.t) list -> t parameter list +end diff --git a/infer/src/quandary/Source.ml b/infer/src/checkers/Source.ml similarity index 100% rename from infer/src/quandary/Source.ml rename to infer/src/checkers/Source.ml diff --git a/infer/src/checkers/Source.mli b/infer/src/checkers/Source.mli new file mode 100644 index 000000000..f349264d6 --- /dev/null +++ b/infer/src/checkers/Source.mli @@ -0,0 +1,21 @@ +(* + * Copyright (c) 2016 - 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. + *) + +module type S = sig + include TraceElem.S + + val is_footprint : t -> bool + + val make_footprint : AccessPath.t -> CallSite.t -> t + + val get_footprint_access_path: t -> AccessPath.t option + + (** return Some (kind) if the call site is a taint source, None otherwise *) + val get : CallSite.t -> t option +end diff --git a/infer/src/quandary/Trace.ml b/infer/src/checkers/Trace.ml similarity index 100% rename from infer/src/quandary/Trace.ml rename to infer/src/checkers/Trace.ml diff --git a/infer/src/quandary/Trace.mli b/infer/src/checkers/Trace.mli similarity index 100% rename from infer/src/quandary/Trace.mli rename to infer/src/checkers/Trace.mli diff --git a/infer/src/quandary/TraceElem.ml b/infer/src/checkers/TraceElem.ml similarity index 100% rename from infer/src/quandary/TraceElem.ml rename to infer/src/checkers/TraceElem.ml