Verified Commit cb22d975 authored by Camil Staps's avatar Camil Staps 🙂

Minor fixes for use of C tools in WebAssembly

- Prevent overriding start warning when bcgen main function is called
  several times
- We must have several code_dummy versions for the types to match
parent a89d6024
Pipeline #43649 passed with stages
in 14 minutes and 24 seconds
......@@ -138,7 +138,7 @@ void load_instruction_table(void) {
put_instruction_name("get_node_arity", parse_instruction_n, code_get_node_arity );
put_instruction_name("get_thunk_arity", parse_instruction, code_get_thunk_arity );
put_instruction_name("get_thunk_desc", parse_instruction, code_get_thunk_desc );
put_instruction_name("getWL", parse_instruction_n, code_dummy );
put_instruction_name("getWL", parse_instruction_n, code_dummy_n );
put_instruction_name("gtI", parse_instruction, code_gtI );
put_instruction_name("halt", parse_instruction, code_halt );
put_instruction_name("incI", parse_instruction, code_incI );
......@@ -356,7 +356,7 @@ void load_instruction_table(void) {
put_instruction_name(".ai", parse_directive_ai, code_ai );
put_instruction_name(".algtype", parse_instruction_n, code_algtype );
put_instruction_name(".caf", parse_instruction_a_n_n, code_caf );
put_instruction_name(".code", parse_directive_n_n_n, code_dummy );
put_instruction_name(".code", parse_directive_n_n_n, code_dummy_n_n_n );
put_instruction_name(".comp", parse_directive_n_l, code_comp );
put_instruction_name(".d", parse_directive_n_n_t, code_d );
put_instruction_name(".depend", parse_directive_depend, code_depend );
......@@ -374,12 +374,12 @@ void load_instruction_table(void) {
put_instruction_name(".implib", parse_directive_implib_impobj, code_dummy );
put_instruction_name(".impobj", parse_directive_implib_impobj, code_dummy );
put_instruction_name(".inline", parse_directive_label, code_dummy );
put_instruction_name(".keep", parse_instruction_n_n, code_dummy );
put_instruction_name(".keep", parse_instruction_n_n, code_dummy_n_n );
put_instruction_name(".module", parse_directive_module, code_module );
put_instruction_name(".n", parse_directive_n, code_n );
put_instruction_name(".nu", parse_directive_nu, code_nu );
put_instruction_name(".o", parse_directive_n_n_t, code_o );
put_instruction_name(".pb", parse_directive_pb, code_dummy );
put_instruction_name(".pb", parse_directive_pb, code_dummy_s2 );
put_instruction_name(".pd", parse_directive, code_dummy );
put_instruction_name(".pe", parse_directive, code_dummy );
put_instruction_name(".pl", parse_directive, code_dummy );
......
......@@ -4881,7 +4881,19 @@ void code_string(char label_name[],char string[],int string_length) {
printf("\t.text\n");
}
void code_dummy(void) {
void code_dummy (void) {
}
void code_dummy_n (int ignored1) {
}
void code_dummy_n_n (int ignored1,int ignored2) {
}
void code_dummy_n_n_n (int ignored1,int ignored2,int ignored3) {
}
void code_dummy_s2 (char *ignored1,int ignored2) {
}
#endif
......@@ -5168,4 +5180,7 @@ void free_generated_program(void) {
free_program(&pgrm);
if (labels!=NULL)
free_label_node(labels);
/* This prevents overriding warning in case we generate multiple times in one run. */
start_label=NULL;
}
......@@ -393,4 +393,8 @@ void code_start(char *label_name);
void code_string(char label_name[], char string[], int string_length);
void code_dummy(void);
void code_dummy_n (int ignored1);
void code_dummy_n_n (int ignored1,int ignored2);
void code_dummy_n_n_n(int ignored1,int ignored2,int ignored3);
void code_dummy_s2 (char *ignored1,int ignored2);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment