Clear out the function overloading tables between compiles.

Fixes some issues with multiple compiles (especially mixed languages!).
This commit is contained in:
Bill Currie 2012-11-01 20:52:22 +09:00
parent ea34a5b753
commit ed4018fd8d
3 changed files with 11 additions and 0 deletions

View File

@ -111,5 +111,6 @@ void build_function (function_t *f);
void finish_function (function_t *f);
void emit_function (function_t *f, struct expr_s *e);
int function_parms (function_t *f, byte *parm_size);
void clear_functions (void);
#endif//__function_h

View File

@ -662,3 +662,12 @@ function_parms (function_t *f, byte *parm_size)
parm_size[i] = type_size (f->sym->type->t.func.param_types[i]);
return f->sym->type->t.func.num_params;
}
void
clear_functions (void)
{
if (overloaded_functions)
Hash_FlushTable (overloaded_functions);
if (function_map)
Hash_FlushTable (function_map);
}

View File

@ -343,6 +343,7 @@ compile_to_obj (const char *file, const char *obj, lang_t lang)
return !options.preprocess_only;
InitData ();
clear_functions ();
clear_frame_macros ();
clear_classes ();
clear_immediates ();