File tree 3 files changed +37
-8
lines changed
3 files changed +37
-8
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ SRC = arith_tools.cpp base_type.cpp cmdline.cpp config.cpp symbol_table.cpp \
22
22
irep_ids.cpp byte_operators.cpp string2int.cpp file_util.cpp \
23
23
memory_info.cpp pipe_stream.cpp irep_hash.cpp endianness_map.cpp \
24
24
ssa_expr.cpp json_irep.cpp json_expr.cpp \
25
- string_utils.cpp
25
+ string_utils.cpp parameter_indices.cpp
26
26
27
27
INCLUDES = -I ..
28
28
Original file line number Diff line number Diff line change
1
+ /* ******************************************************************\
2
+
3
+ Module: Parameter indexing
4
+
5
+ Author: Chris Smowton, [email protected]
6
+
7
+ \*******************************************************************/
1
8
2
9
#include " parameter_indices.h"
3
10
4
- std::map<irep_idt,std::size_t > get_parameter_indices (const code_typet& fn_type)
11
+ /* ******************************************************************\
12
+
13
+ Function: get_parameter_indices
14
+
15
+ Inputs: Code type
16
+
17
+ Outputs: Map from parameter name to position
18
+
19
+ Purpose: Make a map useful for mapping from symbol expressions to
20
+ actual or formal parameter indices.
21
+
22
+ \*******************************************************************/
23
+
24
+ std::map<irep_idt, std::size_t > get_parameter_indices (const code_typet &fn_type)
5
25
{
6
- std::map<irep_idt,std::size_t > parameter_indices;
7
- for (std::size_t i = 0UL ; i != fn_type.parameters ().size (); ++i)
8
- parameter_indices.insert ({fn_type.parameters ().at (i).get_identifier (),i});
26
+ std::map<irep_idt, std::size_t > parameter_indices;
27
+ for (std::size_t i= 0 ; i!= fn_type.parameters ().size (); ++i)
28
+ parameter_indices.insert ({fn_type.parameters ().at (i).get_identifier (), i});
9
29
return parameter_indices;
10
30
}
Original file line number Diff line number Diff line change 1
- #ifndef PARAMETER_INDICES_H
2
- #define PARAMETER_INDICES_H
1
+ /* ******************************************************************\
2
+
3
+ Module: Parameter indexing
4
+
5
+ Author: Chris Smowton, [email protected]
6
+
7
+ \*******************************************************************/
8
+
9
+ #ifndef CPROVER_UTIL_PARAMETER_INDICES_H
10
+ #define CPROVER_UTIL_PARAMETER_INDICES_H
3
11
4
12
#include < unordered_map>
5
13
#include " std_types.h"
6
14
7
- std::map<irep_idt,std::size_t > get_parameter_indices (const code_typet& fn_type);
15
+ std::map<irep_idt, std::size_t >
16
+ get_parameter_indices (const code_typet &fn_type);
8
17
9
18
#endif
You can’t perform that action at this time.
0 commit comments