| 3604 | } |
| 3605 | |
| 3606 | void Program::buildMNLookup ( Context & context, const vector<FunctionPtr> & lookupFunctions, TextWriter & logs ) { |
| 3607 | context.tabMnLookup = make_shared<das_hash_map<uint64_t,SimFunction *>>(); |
| 3608 | context.tabMnLookup->clear(); |
| 3609 | for ( const auto & fn : lookupFunctions ) { |
| 3610 | auto mnh = fn->getMangledNameHash(); |
| 3611 | auto it = context.tabMnLookup->find(mnh); |
| 3612 | if ( it != context.tabMnLookup->end() ) { |
| 3613 | error("internal compiler error: function mangled name hash collision '" + fn->name + "'", |
| 3614 | "", "", LineInfo(), CompilationError::internal_function); |
| 3615 | return; |
| 3616 | } |
| 3617 | context.tabMnLookup->insert({mnh, context.functions + fn->index}); |
| 3618 | } |
| 3619 | if ( options.getBoolOption("log_mn_hash",false) ) { |
| 3620 | logs |
| 3621 | << "totalFunctions: " << context.totalFunctions << "\n" |
| 3622 | << "tabMnLookup:" << context.tabMnLookup->size() << "\n"; |
| 3623 | } |
| 3624 | } |
| 3625 | |
| 3626 | void Program::buildADLookup ( Context & context, TextWriter & logs ) { |
| 3627 | context.tabAdLookup = make_shared<das_hash_map<uint64_t,uint64_t>>(); |
nothing calls this directly
no test coverage detected