Skip to content
Snippets Groups Projects
Commit 091bfbc7 authored by David Bühler's avatar David Bühler
Browse files

[Eva] Callstack: renames [last_caller] to [top_caller].

parent 5b7da9d7
No related branches found
No related tags found
No related merge requests found
...@@ -122,7 +122,7 @@ struct ...@@ -122,7 +122,7 @@ struct
| (kf, stmt) :: _ -> kf, Cil_types.Kstmt stmt | (kf, stmt) :: _ -> kf, Cil_types.Kstmt stmt
| [] -> cs.entry_point, Cil_types.Kglobal | [] -> cs.entry_point, Cil_types.Kglobal
let last_caller cs = let top_caller cs =
match cs.stack with match cs.stack with
| _ :: (kf, _) :: _ -> Some kf | _ :: (kf, _) :: _ -> Some kf
| [_] -> Some cs.entry_point | [_] -> Some cs.entry_point
......
...@@ -51,7 +51,7 @@ sig ...@@ -51,7 +51,7 @@ sig
val top_kf : t -> Cil_types.kernel_function val top_kf : t -> Cil_types.kernel_function
val top_callsite : t -> Cil_types.stmt option val top_callsite : t -> Cil_types.stmt option
val top_call : t -> Cil_types.kernel_function * Cil_types.kinstr val top_call : t -> Cil_types.kernel_function * Cil_types.kinstr
val last_caller : t -> Cil_types.kernel_function option val top_caller : t -> Cil_types.kernel_function option
val to_kf_list : t -> Cil_types.kernel_function list val to_kf_list : t -> Cil_types.kernel_function list
val to_stmt_list : t -> Cil_types.stmt list val to_stmt_list : t -> Cil_types.stmt list
......
...@@ -166,7 +166,7 @@ module Callstack: sig ...@@ -166,7 +166,7 @@ module Callstack: sig
val top_call : t -> Cil_types.kernel_function * Cil_types.kinstr val top_call : t -> Cil_types.kernel_function * Cil_types.kinstr
(** Returns the function that called the topmost function of the callstack. *) (** Returns the function that called the topmost function of the callstack. *)
val last_caller : t -> Cil_types.kernel_function option val top_caller : t -> Cil_types.kernel_function option
(** {2 Conversion} *) (** {2 Conversion} *)
......
...@@ -53,7 +53,7 @@ let register_call kinstr kf = ...@@ -53,7 +53,7 @@ let register_call kinstr kf =
let kf', kinstr' = Callstack.top_call callstack in let kf', kinstr' = Callstack.top_call callstack in
assert (Kernel_function.equal kf kf'); assert (Kernel_function.equal kf kf');
assert (Cil_datatype.Kinstr.equal kinstr kinstr'); assert (Cil_datatype.Kinstr.equal kinstr kinstr');
match kinstr, Callstack.last_caller callstack with match kinstr, Callstack.top_caller callstack with
| Kglobal, _ -> CallersTable.add kf Kernel_function.Map.empty | Kglobal, _ -> CallersTable.add kf Kernel_function.Map.empty
| Kstmt _, None -> assert false | Kstmt _, None -> assert false
| Kstmt stmt, Some caller -> | Kstmt stmt, Some caller ->
......
...@@ -71,7 +71,7 @@ val top_callsite : t -> Cil_types.stmt option ...@@ -71,7 +71,7 @@ val top_callsite : t -> Cil_types.stmt option
val top_call : t -> Cil_types.kernel_function * Cil_types.kinstr val top_call : t -> Cil_types.kernel_function * Cil_types.kinstr
(** Returns the function that called the topmost function of the callstack. *) (** Returns the function that called the topmost function of the callstack. *)
val last_caller : t -> Cil_types.kernel_function option val top_caller : t -> Cil_types.kernel_function option
(** {2 Conversion} *) (** {2 Conversion} *)
......
...@@ -287,7 +287,7 @@ let display fmt = ...@@ -287,7 +287,7 @@ let display fmt =
;; ;;
let caller_callee_callinfo callstack = let caller_callee_callinfo callstack =
match Callstack.last_caller callstack with match Callstack.top_caller callstack with
| Some caller_kf -> | Some caller_kf ->
let callee_kf = Callstack.top_kf callstack in let callee_kf = Callstack.top_kf callstack in
let caller_flat = Kernel_function.Hashtbl.find flat caller_kf in let caller_flat = Kernel_function.Hashtbl.find flat caller_kf in
......
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