File tree 1 file changed +14
-12
lines changed 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change 20
20
21
21
void ansi_c_declaratort::build (irept &src)
22
22
{
23
- typet *p= static_cast <typet *>( &src) ;
23
+ irept *p = &src;
24
24
25
25
// walk down subtype until we hit symbol_type or "abstract"
26
26
while (true )
27
27
{
28
- typet &t=*p;
29
-
30
- if (t.id () == ID_symbol_type || t.id () == ID_symbol)
28
+ if (p->id () == ID_symbol_type || p->id () == ID_symbol)
31
29
{
32
- set_base_name (t.get (ID_C_base_name));
33
- add_source_location ()=t.source_location ();
34
- t.make_nil ();
30
+ set_base_name (p->get (ID_C_base_name));
31
+ add_source_location () =
32
+ static_cast <const source_locationt &>(p->find (ID_C_source_location));
33
+ p->make_nil ();
35
34
break ;
36
35
}
37
- else if (t.id ().empty () ||
38
- t.is_nil ())
36
+ else if (p->id ().empty () || p->is_nil ())
39
37
{
40
38
UNREACHABLE;
41
39
}
42
- else if (t. id ()== ID_abstract)
40
+ else if (p-> id () == ID_abstract)
43
41
{
44
- t. make_nil ();
42
+ p-> make_nil ();
45
43
break ;
46
44
}
47
- else if (t. id ()== ID_merged_type)
45
+ else if (p-> id () == ID_merged_type)
48
46
{
49
47
// we always walk down the _last_ member of a merged type
48
+ typet &t = static_cast <typet &>(*p);
50
49
assert (!t.subtypes ().empty ());
51
50
p=&(t.subtypes ().back ());
52
51
}
53
52
else
53
+ {
54
+ typet &t = static_cast <typet &>(*p);
54
55
p=&t.subtype ();
56
+ }
55
57
}
56
58
57
59
type ()=static_cast <const typet &>(src);
You can’t perform that action at this time.
0 commit comments