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

Function BeginSwitch

NULLC/Callbacks.cpp:4773–4791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4771}
4772
4773void BeginSwitch(const char* pos)
4774{
4775 CodeInfo::lastKnownStartPos = pos;
4776 assert(CodeInfo::nodeList.size() >= 1);
4777 assert(cycleDepth.size() != 0);
4778 cycleDepth.back()++;
4779
4780 BeginBlock();
4781
4782 TypeInfo *type = CodeInfo::nodeList.back()->typeInfo;
4783 if(type->type == TypeInfo::TYPE_COMPLEX && type != typeObject && type != typeTypeid)
4784 {
4785 AddInplaceVariable(pos);
4786 CodeInfo::nodeList.push_back(new NodeDereference());
4787 CodeInfo::nodeList.push_back(new NodeSwitchExpr(true));
4788 }else{
4789 CodeInfo::nodeList.push_back(new NodeSwitchExpr());
4790 }
4791}
4792
4793void AddCaseNode(const char* pos)
4794{

Callers 1

ParseSwitchExprFunction · 0.85

Calls 5

assertFunction · 0.85
BeginBlockFunction · 0.85
AddInplaceVariableFunction · 0.85
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected