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

Function AddTypeAllocation

NULLC/Callbacks.cpp:2696–2711  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2694 CodeInfo::nodeList.push_back(new NodeFuncCall(func, func->funcType->funcType));
2695}
2696void AddTypeAllocation(const char* pos, bool arrayType)
2697{
2698 if(currType == typeVoid)
2699 ThrowError(pos, "ERROR: cannot allocate space for void type");
2700 CodeInfo::nodeList.push_back(new NodeZeroOP(typeInt));
2701 CodeInfo::nodeList.push_back(new NodeUnaryOp(cmdPushTypeID, (currType->arrLevel ? currType->subType : currType)->typeIndex));
2702 if(!arrayType)
2703 {
2704 CallAllocationFunction(pos, "__newS");
2705 CodeInfo::nodeList.back()->typeInfo = CodeInfo::GetReferenceType(currType);
2706 }else{
2707 assert(currType->arrSize == TypeInfo::UNSIZED_ARRAY);
2708 CallAllocationFunction(pos, "__newA");
2709 CodeInfo::nodeList.back()->typeInfo = currType;
2710 }
2711}
2712
2713void AddDefaultConstructorCall(const char* pos, const char* name)
2714{

Callers 1

ParseTerminalFunction · 0.85

Calls 4

ThrowErrorFunction · 0.85
CallAllocationFunctionFunction · 0.85
assertFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected