@@ -71,17 +71,33 @@ void convert(
71
71
case goto_trace_stept::typet::ASSIGNMENT:
72
72
case goto_trace_stept::typet::DECL:
73
73
{
74
- irep_idt identifier=step.lhs_object .get_identifier ();
74
+ auto lhs_object=step.get_lhs_object ();
75
+ irep_idt identifier=
76
+ lhs_object.has_value ()?lhs_object->get_identifier ():irep_idt ();
75
77
xmlt &xml_assignment=dest.new_element (" assignment" );
76
78
77
79
if (xml_location.name !=" " )
78
80
xml_assignment.new_element ().swap (xml_location);
79
81
80
- std::string value_string, type_string,
81
- full_lhs_string, full_lhs_value_string;
82
+ {
83
+ auto lhs_object=step.get_lhs_object ();
84
+
85
+ const symbolt *symbol;
86
+
87
+ if (lhs_object.has_value () &&
88
+ !ns.lookup (lhs_object->get_identifier (), symbol))
89
+ {
90
+ std::string type_string=from_type (ns, symbol->name , symbol->type );
82
91
83
- if (step.lhs_object_value .is_not_nil ())
84
- value_string=from_expr (ns, identifier, step.lhs_object_value );
92
+ xml_assignment.set_attribute (" mode" , id2string (symbol->mode ));
93
+ xml_assignment.set_attribute (" identifier" , id2string (symbol->name ));
94
+ xml_assignment.set_attribute (" base_name" , id2string (symbol->base_name ));
95
+ xml_assignment.set_attribute (" display_name" , id2string (symbol->display_name ()));
96
+ xml_assignment.new_element (" type" ).data =type_string;
97
+ }
98
+ }
99
+
100
+ std::string full_lhs_string, full_lhs_value_string;
85
101
86
102
if (step.full_lhs .is_not_nil ())
87
103
full_lhs_string=from_expr (ns, identifier, step.full_lhs );
@@ -90,43 +106,17 @@ void convert(
90
106
full_lhs_value_string=
91
107
from_expr (ns, identifier, step.full_lhs_value );
92
108
93
- if (step.lhs_object_value .type ().is_not_nil ())
94
- type_string=
95
- from_type (ns, identifier, step.lhs_object_value .type ());
96
-
97
- const symbolt *symbol;
98
- irep_idt base_name, display_name;
99
-
100
- if (!ns.lookup (identifier, symbol))
101
- {
102
- base_name=symbol->base_name ;
103
- display_name=symbol->display_name ();
104
- if (type_string==" " )
105
- type_string=from_type (ns, identifier, symbol->type );
106
-
107
- xml_assignment.set_attribute (" mode" , id2string (symbol->mode ));
108
- }
109
-
110
- xml_assignment.new_element (" type" ).data =type_string;
111
109
xml_assignment.new_element (" full_lhs" ).data =full_lhs_string;
112
110
xml_assignment.new_element (" full_lhs_value" ).data =full_lhs_value_string;
113
- xml_assignment.new_element (" value" ).data =value_string;
114
111
115
112
xml_assignment.set_attribute_bool (" hidden" , step.hidden );
116
113
xml_assignment.set_attribute (" thread" , std::to_string (step.thread_nr ));
117
- xml_assignment.set_attribute (" identifier" , id2string (identifier));
118
- xml_assignment.set_attribute (" base_name" , id2string (base_name));
119
- xml_assignment.set_attribute (" display_name" , id2string (display_name));
120
114
xml_assignment.set_attribute (" step_nr" , std::to_string (step.step_nr ));
121
115
122
116
xml_assignment.set_attribute (" assignment_type" ,
123
117
step.assignment_type ==
124
118
goto_trace_stept::assignment_typet::ACTUAL_PARAMETER?
125
119
" actual_parameter" :" state" );
126
-
127
- if (step.lhs_object_value .is_not_nil ())
128
- xml_assignment.new_element (" value_expression" ).
129
- new_element (xml (step.lhs_object_value , ns));
130
120
}
131
121
break ;
132
122
0 commit comments