File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 66
77\*******************************************************************/
88
9-
109#include " c_bit_field_replacement_type.h"
1110
11+ #include < util/invariant.h>
12+
1213typet c_bit_field_replacement_type (
1314 const c_bit_field_typet &src,
1415 const namespacet &ns)
@@ -23,21 +24,18 @@ typet c_bit_field_replacement_type(
2324 result.set_width (src.get_width ());
2425 return std::move (result);
2526 }
26- else if (subtype. id ()==ID_c_enum_tag)
27+ else
2728 {
29+ PRECONDITION (subtype.id () == ID_c_enum_tag);
30+
2831 const typet &sub_subtype=
2932 ns.follow_tag (to_c_enum_tag_type (subtype)).subtype ();
3033
31- if (sub_subtype.id ()==ID_signedbv ||
32- sub_subtype.id ()==ID_unsignedbv)
33- {
34- bitvector_typet result=to_bitvector_type (sub_subtype);
35- result.set_width (src.get_width ());
36- return std::move (result);
37- }
38- else
39- return nil_typet ();
34+ PRECONDITION (
35+ sub_subtype.id () == ID_signedbv || sub_subtype.id () == ID_unsignedbv);
36+
37+ bitvector_typet result = to_bitvector_type (sub_subtype);
38+ result.set_width (src.get_width ());
39+ return std::move (result);
4040 }
41- else
42- return nil_typet ();
4341}
You can’t perform that action at this time.
0 commit comments