extensive rewrite of generation & execution of run-time initialization

This commit is contained in:
Vern Paxson 2021-11-07 17:00:19 -08:00
parent bc3bf4ea6c
commit e1a760e674
26 changed files with 3459 additions and 1580 deletions

View file

@ -51,13 +51,25 @@ template <class T> string CPPTracker<T>::KeyName(const T* key)
auto hash = map[key];
ASSERT(hash != 0);
auto rep = reps[hash];
if ( gi_s.count(rep) > 0 )
return gi_s[rep]->Name();
auto index = map2[hash];
string scope;
if ( IsInherited(hash) )
scope = scope_prefix(scope2[hash]);
return scope + string(base_name) + "_" + Fmt(index) + "__CPP";
string ind = Fmt(index);
string full_name;
if ( single_global )
full_name = base_name + "__CPP[" + ind + "]";
else
full_name = base_name + "_" + ind + "__CPP";
return scope + full_name;
}
template <class T> void CPPTracker<T>::LogIfNew(IntrusivePtr<T> key, int scope, FILE* log_file)