CBMC
call_stack.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Symbolic Execution
4 
5 Author: Romain Brenguier, romain.brenguier@diffblue.com
6 
7 \*******************************************************************/
8 
9 #ifndef CPROVER_GOTO_SYMEX_CALL_STACK_H
10 #define CPROVER_GOTO_SYMEX_CALL_STACK_H
11 
12 #include "frame.h"
13 
14 class call_stackt : public std::vector<framet>
15 {
16 public:
18  {
19  PRECONDITION(!empty());
20  return back();
21  }
22 
23  const framet &top() const
24  {
25  PRECONDITION(!empty());
26  return back();
27  }
28 
29  framet &
30  new_frame(symex_targett::sourcet calling_location, const guardt &guard)
31  {
32  emplace_back(calling_location, guard);
33  return back();
34  }
35 
36  void pop()
37  {
38  PRECONDITION(!empty());
39  pop_back();
40  }
41 
43  {
44  return *(--(--end()));
45  }
46 };
47 
48 #endif // CPROVER_GOTO_SYMEX_CALL_STACK_H
static exprt guard(const exprt::operandst &guards, exprt cond)
const framet & top() const
Definition: call_stack.h:23
void pop()
Definition: call_stack.h:36
framet & new_frame(symex_targett::sourcet calling_location, const guardt &guard)
Definition: call_stack.h:30
const framet & previous_frame()
Definition: call_stack.h:42
framet & top()
Definition: call_stack.h:17
Stack frames – these are used for function calls and for exceptions.
Definition: solver_types.h:41
Class for stack frames.
#define PRECONDITION(CONDITION)
Definition: invariant.h:463
Identifies source in the context of symbolic execution.
Definition: symex_target.h:37