MCPcopy Create free account
hub / github.com/WheretIB/nullc / AddAliasType

Function AddAliasType

NULLC/Callbacks.cpp:5237–5256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5235}
5236
5237void AddAliasType(InplaceStr aliasName)
5238{
5239 AliasInfo *info = TypeInfo::CreateAlias(aliasName, currType);
5240 if(newType && (!currDefinedFunc.size() || newType->definitionDepth > currDefinedFunc.back()->vTopSize)) // If we're inside a class definition, but _not_ inside a function
5241 {
5242 // Create alias and add it to type alias list, so that after type definition is finished, local aliases will be deleted
5243 info->next = newType->childAlias;
5244 newType->childAlias = info;
5245 }else if(currDefinedFunc.size()){ // If we're inside a function
5246 // Create alias and add it to function alias list, so that after function is finished, local aliases will be deleted
5247 info->next = currDefinedFunc.back()->childAlias;
5248 currDefinedFunc.back()->childAlias = info;
5249 }else{
5250 // Create alias and add it to global alias list
5251 info->next = CodeInfo::globalAliases;
5252 CodeInfo::globalAliases = info;
5253 }
5254 // Insert hash->type pair to class map, so that target type can be found by alias name
5255 CodeInfo::classMap.insert(GetStringHash(aliasName.begin, aliasName.end), currType);
5256}
5257
5258void AddUnfixedArraySize()
5259{

Callers 3

ImportModuleMethod · 0.85
ParseSelectTypeFunction · 0.85
ParseTypedefExprFunction · 0.85

Calls 3

insertMethod · 0.80
GetStringHashFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected