cprover
locals.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: Local variables
4
5
Author: Daniel Kroening
6
7
Date: March 2013
8
9
\*******************************************************************/
10
13
14
#include "
locals.h
"
15
16
#include <
util/std_expr.h
>
17
18
void
localst::build
(
const
goto_functiont
&goto_function)
19
{
20
forall_goto_program_instructions
(it, goto_function.
body
)
21
{
22
if
(it->is_decl())
23
locals
.insert(it->get_decl().get_identifier());
24
}
25
26
locals
.insert(
27
goto_function.
parameter_identifiers
.begin(),
28
goto_function.
parameter_identifiers
.end());
29
}
30
31
void
localst::output
(std::ostream &out)
const
32
{
33
for
(
const
auto
&local :
locals
)
34
out << local <<
"\n"
;
35
}
goto_functiont::body
goto_programt body
Definition:
goto_function.h:30
localst::output
void output(std::ostream &out) const
Definition:
locals.cpp:31
localst::locals
locals_sett locals
Definition:
locals.h:38
locals.h
Local variables whose address is taken.
goto_functiont
A goto function, consisting of function type (see type), function body (see body),...
Definition:
goto_function.h:28
localst::build
void build(const goto_functiont &goto_function)
Definition:
locals.cpp:18
goto_functiont::parameter_identifiers
parameter_identifierst parameter_identifiers
The identifiers of the parameters of this function.
Definition:
goto_function.h:42
std_expr.h
API to expression classes.
forall_goto_program_instructions
#define forall_goto_program_instructions(it, program)
Definition:
goto_program.h:1196
analyses
locals.cpp
Generated by
1.8.20