Make CompHash computation/recovery for functions deterministic

Functions are now assigned a unique integer on construction which
CompositeHash can base hashes on.  Recovery then just involves
looking up the function pointer associated with that unique number.
This commit is contained in:
Jon Siwek 2011-10-06 14:29:03 -05:00
parent 3ecd872291
commit 1cc675e30f
6 changed files with 64 additions and 27 deletions

View file

@ -53,6 +53,19 @@ extern RETSIGTYPE sig_handler(int signo);
const Expr* calling_expr = 0;
bool did_builtin_init = false;
vector<Func*> Func::unique_ids;
Func::Func() : scope(0), id(0), return_value(0)
{
unique_id = unique_ids.size();
unique_ids.push_back(this);
}
Func::Func(Kind arg_kind) : scope(0), kind(arg_kind), id(0), return_value(0)
{
unique_id = unique_ids.size();
unique_ids.push_back(this);
}
Func::~Func()
{