script optimization fixes:

new initialization model for standalone C++ scripts
 type coercion fix
 ZAM fix for compiling using C++ optimizer
 disambiguate empty constructors
This commit is contained in:
Vern Paxson 2022-11-20 12:16:25 -08:00
parent dbb2aa88a6
commit 134f8f2ef5
14 changed files with 80 additions and 96 deletions

View file

@ -16,9 +16,6 @@ template <class T> void CPPTracker<T>::AddKey(IntrusivePtr<T> key, p_hash_type h
if ( HasKey(key) )
return;
if ( h == 0 )
h = Hash(key);
if ( map2.count(h) == 0 )
{
auto index = keys.size();
@ -57,16 +54,6 @@ template <class T> string CPPTracker<T>::KeyName(const T* key)
return full_name;
}
template <class T> p_hash_type CPPTracker<T>::Hash(IntrusivePtr<T> key) const
{
ODesc d;
d.SetDeterminism(true);
key->Describe(&d);
string desc = d.Description();
auto h = hash<string>{}(base_name + desc);
return p_hash_type(h);
}
// Instantiate the templates we'll need.
template class CPPTracker<Type>;
template class CPPTracker<Attributes>;