File tree 6 files changed +41
-18
lines changed
6 files changed +41
-18
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,22 @@ void cpp_languaget::modules_provided(std::set<std::string> &modules)
53
53
modules.insert (get_base_name (parse_path, true ));
54
54
}
55
55
56
+ // / Generate a _start function for a specific function
57
+ // / \param entry_function_symbol: The symbol for the function that should be
58
+ // / used as the entry point
59
+ // / \param symbol_table: The symbol table for the program. The new _start
60
+ // / function symbol will be added to this table
61
+ // / \return Returns false if the _start method was generated correctly
62
+ bool cpp_languaget::generate_start_function (
63
+ const symbolt &entry_function_symbol,
64
+ symbol_tablet &symbol_table)
65
+ {
66
+ return generate_ansi_c_start_function (
67
+ entry_function_symbol,
68
+ symbol_table,
69
+ *message_handler);
70
+ }
71
+
56
72
// / ANSI-C preprocessing
57
73
bool cpp_languaget::preprocess (
58
74
std::istream &instream,
Original file line number Diff line number Diff line change @@ -85,6 +85,10 @@ class cpp_languaget:public languaget
85
85
86
86
void modules_provided (std::set<std::string> &modules) override ;
87
87
88
+ virtual bool generate_start_function (
89
+ const class symbolt &entry_function_symbol,
90
+ class symbol_tablet &symbol_table) override ;
91
+
88
92
protected:
89
93
cpp_parse_treet cpp_parse_tree;
90
94
std::string parse_path;
Original file line number Diff line number Diff line change @@ -41,6 +41,22 @@ bool jsil_languaget::interfaces(symbol_tablet &symbol_table)
41
41
return false ;
42
42
}
43
43
44
+ // / Generate a _start function for a specific function
45
+ // / \param entry_function_symbol: The symbol for the function that should be
46
+ // / used as the entry point
47
+ // / \param symbol_table: The symbol table for the program. The new _start
48
+ // / function symbol will be added to this table
49
+ // / \return Returns false if the _start method was generated correctly
50
+ bool jsil_languaget::generate_start_function (
51
+ const symbolt &entry_function_symbol,
52
+ symbol_tablet &symbol_table)
53
+ {
54
+ // TODO(tkiley): This should be implemented if this language
55
+ // is used.
56
+ UNREACHABLE;
57
+ return true ;
58
+ }
59
+
44
60
bool jsil_languaget::preprocess (
45
61
std::istream &instream,
46
62
const std::string &path,
Original file line number Diff line number Diff line change @@ -69,6 +69,10 @@ class jsil_languaget:public languaget
69
69
virtual void modules_provided (std::set<std::string> &modules);
70
70
virtual bool interfaces (symbol_tablet &symbol_table);
71
71
72
+ virtual bool generate_start_function (
73
+ const class symbolt &entry_function_symbol,
74
+ class symbol_tablet &symbol_table) override ;
75
+
72
76
protected:
73
77
jsil_parse_treet parse_tree;
74
78
std::string parse_path;
Original file line number Diff line number Diff line change @@ -191,20 +191,3 @@ void languaget::generate_opaque_parameter_symbols(
191
191
symbol_table.add (param_symbol);
192
192
}
193
193
}
194
-
195
- // / Generate a entry function for a specific function. Should be overriden in
196
- // / derived languagets
197
- // / \param entry_function_symbol: The symbol for the function that should be
198
- // / used as the entry point
199
- // / \param symbol_table: The symbol table for the program. The new _start
200
- // / function symbol will be added to this table
201
- // / \return Returns false if the entry method was generated correctly
202
- bool languaget::generate_start_function (
203
- const symbolt &entry_function_symbol,
204
- symbol_tablet &symbol_table)
205
- {
206
- // Implement in derived languagets
207
- assert (0 );
208
- return true ;
209
- }
210
-
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ class languaget:public messaget
121
121
122
122
virtual bool generate_start_function (
123
123
const class symbolt &entry_function_symbol,
124
- class symbol_tablet &symbol_table);
124
+ class symbol_tablet &symbol_table)=0 ;
125
125
126
126
// constructor / destructor
127
127
You can’t perform that action at this time.
0 commit comments