@@ -24,40 +24,20 @@ vsd_configt vsd_configt::from_options(const optionst &options)
24
24
" --data-dependencies" };
25
25
}
26
26
27
- config.value_abstract_type = option_to_abstract_type (
28
- options,
29
- " values" ,
30
- value_option_mappings,
31
- CONSTANT
32
- );
27
+ config.value_abstract_type =
28
+ option_to_abstract_type (options, " values" , value_option_mappings, CONSTANT);
33
29
34
30
config.pointer_abstract_type = option_to_abstract_type (
35
- options,
36
- " pointers" ,
37
- pointer_option_mappings,
38
- POINTER_INSENSITIVE
39
- );
31
+ options, " pointers" , pointer_option_mappings, POINTER_INSENSITIVE);
40
32
41
33
config.struct_abstract_type = option_to_abstract_type (
42
- options,
43
- " structs" ,
44
- struct_option_mappings,
45
- STRUCT_INSENSITIVE
46
- );
34
+ options, " structs" , struct_option_mappings, STRUCT_INSENSITIVE);
47
35
48
36
config.array_abstract_type = option_to_abstract_type (
49
- options,
50
- " arrays" ,
51
- array_option_mappings,
52
- ARRAY_INSENSITIVE
53
- );
37
+ options, " arrays" , array_option_mappings, ARRAY_INSENSITIVE);
54
38
55
39
config.union_abstract_type = option_to_abstract_type (
56
- options,
57
- " unions" ,
58
- union_option_mappings,
59
- UNION_INSENSITIVE
60
- );
40
+ options, " unions" , union_option_mappings, UNION_INSENSITIVE);
61
41
62
42
// This should always be on (for efficeny with 3-way merge)
63
43
// Does not work with value set
@@ -105,61 +85,57 @@ vsd_configt vsd_configt::intervals()
105
85
}
106
86
107
87
const vsd_configt::option_mappingt vsd_configt::value_option_mappings = {
108
- { " intervals" , INTERVAL },
109
- { " constants" , CONSTANT },
110
- { " set-of-constants" , VALUE_SET }
111
- };
88
+ {" intervals" , INTERVAL},
89
+ {" constants" , CONSTANT},
90
+ {" set-of-constants" , VALUE_SET}};
112
91
113
92
const vsd_configt::option_mappingt vsd_configt::pointer_option_mappings = {
114
- { " top-bottom" , POINTER_INSENSITIVE },
115
- { " constants" , POINTER_SENSITIVE },
116
- { " value-set" , VALUE_SET }
117
- };
93
+ {" top-bottom" , POINTER_INSENSITIVE},
94
+ {" constants" , POINTER_SENSITIVE},
95
+ {" value-set" , VALUE_SET}};
118
96
119
97
const vsd_configt::option_mappingt vsd_configt::struct_option_mappings = {
120
- { " top-bottom" , STRUCT_INSENSITIVE },
121
- { " every-field" , STRUCT_SENSITIVE }
122
- };
98
+ {" top-bottom" , STRUCT_INSENSITIVE},
99
+ {" every-field" , STRUCT_SENSITIVE}};
123
100
124
101
const vsd_configt::option_mappingt vsd_configt::array_option_mappings = {
125
- { " top-bottom" , ARRAY_INSENSITIVE },
126
- { " every-element" , ARRAY_SENSITIVE }
127
- };
102
+ {" top-bottom" , ARRAY_INSENSITIVE},
103
+ {" every-element" , ARRAY_SENSITIVE}};
128
104
129
105
const vsd_configt::option_mappingt vsd_configt::union_option_mappings = {
130
- { " top-bottom" , UNION_INSENSITIVE }
131
- };
106
+ {" top-bottom" , UNION_INSENSITIVE}};
132
107
133
108
invalid_command_line_argument_exceptiont vsd_configt::invalid_argument (
134
- const std::string& option_name,
135
- const std::string& bad_argument,
136
- const option_mappingt& mapping
137
- ) {
109
+ const std::string & option_name,
110
+ const std::string & bad_argument,
111
+ const option_mappingt & mapping)
112
+ {
138
113
auto option = " --vsd-" + option_name;
139
114
auto choices = std::string (" " );
140
- for (auto & kv : mapping) {
115
+ for (auto &kv : mapping)
116
+ {
141
117
choices += (!choices.empty () ? " |" : " " );
142
118
choices += kv.first ;
143
119
}
144
120
145
- return invalid_command_line_argument_exceptiont {
146
- " Unknown argument '" + bad_argument + " '" ,
147
- option,
148
- option + " " + choices };
121
+ return invalid_command_line_argument_exceptiont{
122
+ " Unknown argument '" + bad_argument + " '" , option, option + " " + choices};
149
123
}
150
124
151
125
ABSTRACT_OBJECT_TYPET vsd_configt::option_to_abstract_type (
152
- const optionst& options,
153
- const std::string& option_name,
154
- const option_mappingt& mapping,
155
- ABSTRACT_OBJECT_TYPET default_type
156
- ) {
126
+ const optionst & options,
127
+ const std::string & option_name,
128
+ const option_mappingt & mapping,
129
+ ABSTRACT_OBJECT_TYPET default_type)
130
+ {
157
131
const auto argument = options.get_option (option_name);
158
132
159
- if (argument.empty ()) return default_type;
133
+ if (argument.empty ())
134
+ return default_type;
160
135
161
136
auto selected = mapping.find (argument);
162
- if (selected == mapping.end ()) {
137
+ if (selected == mapping.end ())
138
+ {
163
139
throw invalid_argument (option_name, argument, mapping);
164
140
}
165
141
return selected->second ;
@@ -243,7 +219,8 @@ abstract_object_pointert initialize_abstract_object(
243
219
}
244
220
245
221
ABSTRACT_OBJECT_TYPET
246
- variable_sensitivity_object_factoryt::get_abstract_object_type (const typet& type) const
222
+ variable_sensitivity_object_factoryt::get_abstract_object_type (
223
+ const typet &type) const
247
224
{
248
225
ABSTRACT_OBJECT_TYPET abstract_object_type = TWO_VALUE;
249
226
@@ -288,7 +265,7 @@ variable_sensitivity_object_factoryt::get_abstract_object(
288
265
const abstract_environmentt &environment,
289
266
const namespacet &ns) const
290
267
{
291
- const typet& followed_type = ns.follow (type);
268
+ const typet & followed_type = ns.follow (type);
292
269
ABSTRACT_OBJECT_TYPET abstract_object_type =
293
270
get_abstract_object_type (followed_type);
294
271
0 commit comments