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

Function AddDefaultConstructorCall

NULLC/Callbacks.cpp:2713–2754  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2711}
2712
2713void AddDefaultConstructorCall(const char* pos, const char* name)
2714{
2715 TypeInfo *type = CodeInfo::nodeList.back()->typeInfo;
2716
2717 if(const char* tmp = strrchr(name, '.'))
2718 name = tmp + 1;
2719
2720 assert(type->subType);
2721 if(!type->subType->arrLevel)
2722 {
2723 AddMemberFunctionCall(pos, name, 0);
2724 AddPopNode(pos);
2725 return;
2726 }
2727
2728 IncreaseCycleDepth();
2729 BeginBlock();
2730
2731 assert(type->refLevel && type->subType->arrLevel);
2732 type = type->subType->subType;
2733 assert(!type->refLevel && !type->funcType);
2734
2735 char *arrName = AllocateString(16);
2736 int length = sprintf(arrName, "$temp%d", inplaceVariableNum++);
2737 InplaceStr vName = InplaceStr(arrName, length);
2738
2739 AddGetVariableNode(pos);
2740 AddArrayIterator(pos, vName, NULL);
2741
2742 AddGetAddressNode(pos, vName);
2743 AddDefaultConstructorCall(pos, name);
2744
2745 EndBlock();
2746 AddForEachNode(pos);
2747
2748 NodeZeroOP *last = CodeInfo::nodeList.back();
2749 CodeInfo::nodeList.pop_back();
2750
2751 NodeOneOP *wrap = new NodeOneOP();
2752 wrap->SetFirstNode(last);
2753 CodeInfo::nodeList.push_back(wrap);
2754}
2755
2756NodeZeroOP* PrepareConstructorCall(const char* pos)
2757{

Callers 3

FunctionStartFunction · 0.85
ParseAddVariableFunction · 0.85
ParseTerminalFunction · 0.85

Calls 15

assertFunction · 0.85
AddMemberFunctionCallFunction · 0.85
AddPopNodeFunction · 0.85
IncreaseCycleDepthFunction · 0.85
BeginBlockFunction · 0.85
AllocateStringFunction · 0.85
InplaceStrClass · 0.85
AddGetVariableNodeFunction · 0.85
AddArrayIteratorFunction · 0.85
AddGetAddressNodeFunction · 0.85
EndBlockFunction · 0.85
AddForEachNodeFunction · 0.85

Tested by

no test coverage detected