Skip to content

Commit 71dec3d

Browse files
author
thk123
committed
Use ID_main as the default name for entry function
Rather than have a parameter which specifies the entry function, use the appropriate ID. This saves having three seperate places with the string "main" hard coded.
1 parent 2aea88d commit 71dec3d

File tree

5 files changed

+4
-7
lines changed

5 files changed

+4
-7
lines changed

src/ansi-c/ansi_c_entry_point.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ void record_function_outputs(
121121

122122
bool ansi_c_entry_point(
123123
symbol_tablet &symbol_table,
124-
const std::string &standard_main,
125124
message_handlert &message_handler)
126125
{
127126
// check if entry point is already there
@@ -168,7 +167,7 @@ bool ansi_c_entry_point(
168167
main_symbol=matches.front();
169168
}
170169
else
171-
main_symbol=standard_main;
170+
main_symbol=ID_main;
172171

173172
// look it up
174173
symbol_tablet::symbolst::const_iterator s_it=

src/ansi-c/ansi_c_entry_point.h

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Author: Daniel Kroening, [email protected]
1515

1616
bool ansi_c_entry_point(
1717
symbol_tablet &symbol_table,
18-
const std::string &standard_main,
1918
message_handlert &message_handler);
2019

2120
bool generate_ansi_c_start_function(

src/ansi-c/ansi_c_language.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ bool ansi_c_languaget::typecheck(
143143
bool ansi_c_languaget::final(symbol_tablet &symbol_table)
144144
{
145145
generate_opaque_method_stubs(symbol_table);
146-
147-
if(ansi_c_entry_point(symbol_table, "main", get_message_handler()))
146+
if(ansi_c_entry_point(symbol_table, get_message_handler()))
148147
return true;
149148

150149
return false;

src/cpp/cpp_language.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ bool cpp_languaget::typecheck(
152152

153153
bool cpp_languaget::final(symbol_tablet &symbol_table)
154154
{
155-
if(ansi_c_entry_point(symbol_table, "main", get_message_handler()))
155+
if(ansi_c_entry_point(symbol_table, get_message_handler()))
156156
return true;
157157

158158
return false;

src/goto-cc/compile.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ bool compilet::link()
368368
symbol_table.remove(goto_functionst::entry_point());
369369
compiled_functions.function_map.erase(goto_functionst::entry_point());
370370

371-
if(ansi_c_entry_point(symbol_table, "main", get_message_handler()))
371+
if(ansi_c_entry_point(symbol_table, get_message_handler()))
372372
return true;
373373

374374
// entry_point may (should) add some more functions.

0 commit comments

Comments
 (0)