MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / buildMNLookup

Method buildMNLookup

src/ast/ast_simulate.cpp:3606–3624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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>>();

Callers

nothing calls this directly

Calls 8

getBoolOptionMethod · 0.80
LineInfoClass · 0.50
clearMethod · 0.45
getMangledNameHashMethod · 0.45
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected