File tree 4 files changed +22
-7
lines changed 4 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -724,15 +724,13 @@ void compilet::convert_symbols(goto_functionst &dest)
724
724
symbol_table.symbols .find (*it);
725
725
assert (s_it!=symbol_table.symbols .end ());
726
726
727
- if (s_it->second .type .id ()==ID_code &&
728
- !s_it->second .is_macro &&
729
- !s_it->second .is_type &&
730
- s_it->second .value .id ()!=" compiled" &&
731
- s_it->second .value .is_not_nil ())
727
+ if (
728
+ s_it->second .is_function () && !s_it->second .is_compiled () &&
729
+ s_it->second .value .is_not_nil ())
732
730
{
733
731
debug () << " Compiling " << s_it->first << eom;
734
732
converter.convert_function (s_it->first , dest.function_map [s_it->first ]);
735
- symbol_table.get_writeable_ref (*it).value = exprt ( " compiled " );
733
+ symbol_table.get_writeable_ref (*it).set_compiled ( );
736
734
}
737
735
}
738
736
}
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ void goto_convert_functionst::convert_function(
152
152
f.type =to_code_type (symbol.type );
153
153
154
154
if (symbol.value .is_nil () ||
155
- symbol.value . id ()== " compiled " ) /* goto_inline may have removed the body */
155
+ symbol.is_compiled () ) /* goto_inline may have removed the body */
156
156
return ;
157
157
158
158
if (symbol.value .id ()!=ID_code)
Original file line number Diff line number Diff line change @@ -699,6 +699,7 @@ IREP_ID_ONE(w_ok)
699
699
IREP_ID_ONE(super_class)
700
700
IREP_ID_ONE(exceptions_thrown_list)
701
701
IREP_ID_TWO(C_java_method_type, #java_method_type)
702
+ IREP_ID_ONE(compiled)
702
703
703
704
// Projects depending on this code base that wish to extend the list of
704
705
// available ids should provide a file local_irep_ids.def in their source tree
Original file line number Diff line number Diff line change 20
20
#include < iosfwd>
21
21
22
22
#include " expr.h"
23
+ #include " invariant.h"
23
24
24
25
/* ! \brief Symbol table entry.
25
26
\ingroup gr_symbol_table
@@ -107,6 +108,21 @@ class symbolt
107
108
{
108
109
return !is_type && !is_macro && type.id ()==ID_code;
109
110
}
111
+
112
+ // / Returns true iff the the symbol's value has been compiled to a goto
113
+ // / program.
114
+ bool is_compiled () const
115
+ {
116
+ return type.id () == ID_code && value == exprt (ID_compiled);
117
+ }
118
+
119
+ // / Set the symbol's value to "compiled"; to be used once the code-typed value
120
+ // / has been converted to a goto program.
121
+ void set_compiled ()
122
+ {
123
+ PRECONDITION (type.id () == ID_code);
124
+ value = exprt (ID_compiled);
125
+ }
110
126
};
111
127
112
128
std::ostream &operator <<(std::ostream &out, const symbolt &symbol);
You can’t perform that action at this time.
0 commit comments