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

Method addGeneric

src/ast/ast_module.cpp:665–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

663 }
664
665 bool Module::addGeneric ( const FunctionPtr & fn, bool canFail ) {
666 fn->module = this;
667 auto mangledName = fn->getMangledName();
668 fn->module = nullptr;
669 if ( generics.insert(mangledName, fn) ) {
670 genericsByName[hash64z(fn->name.c_str())].push_back(fn);
671 fn->module = this;
672 return true;
673 } else {
674 if ( !canFail ) {
675 DAS_FATAL_ERROR("can't add duplicate generic function %s to module %s\n", mangledName.c_str(), name.c_str() );
676 }
677 return false;
678 }
679 }
680
681 TypeDeclPtr Module::findAlias ( const string & na ) const {
682 return aliasTypes.find(na);

Callers 4

implAddGenericFunctionFunction · 0.45
getOrCreateDummyMethod · 0.45
addModuleGenericFunction · 0.45

Calls 5

hash64zFunction · 0.85
getMangledNameMethod · 0.45
insertMethod · 0.45
push_backMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected