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

Method ClearState

NULLC/Compiler.cpp:472–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470}
471
472void Compiler::ClearState()
473{
474 CodeInfo::varInfo.clear();
475
476 CodeInfo::typeInfo.resize(buildInTypes.size());
477 memcpy(&CodeInfo::typeInfo[0], &buildInTypes[0], buildInTypes.size() * sizeof(TypeInfo*));
478 for(unsigned int i = 0; i < buildInTypes.size(); i++)
479 {
480 assert(CodeInfo::typeInfo[i]->typeIndex == i);
481 CodeInfo::typeInfo[i]->typeIndex = i;
482 if(CodeInfo::typeInfo[i]->refType && CodeInfo::typeInfo[i]->refType->typeIndex >= buildInTypes.size())
483 CodeInfo::typeInfo[i]->refType = NULL;
484 if(CodeInfo::typeInfo[i]->unsizedType && CodeInfo::typeInfo[i]->unsizedType->typeIndex >= buildInTypes.size())
485 CodeInfo::typeInfo[i]->unsizedType = NULL;
486 CodeInfo::typeInfo[i]->arrayType = NULL;
487 }
488
489 for(unsigned int i = 0; i < CodeInfo::typeInfo.size(); i++)
490 CodeInfo::typeInfo[i]->fullName = NULL;
491
492 TypeInfo::SetPoolTop(typeTop);
493
494 funcMap.clear();
495 CodeInfo::funcInfo.resize(0);
496 FunctionInfo::SetPoolTop(0);
497
498 CodeInfo::nodeList.clear();
499
500 ClearStringList();
501
502 VariableInfo::SetPoolTop(0);
503
504 CallbackInitialize();
505
506 CodeInfo::lastError = CompilerError();
507
508 CodeInfo::cmdInfoList.Clear();
509 CodeInfo::cmdList.clear();
510}
511
512bool Compiler::AddModuleFunction(const char* module, void (NCDECL *ptr)(), const char* name, int index)
513{

Callers

nothing calls this directly

Calls 8

assertFunction · 0.85
ClearStringListFunction · 0.85
CallbackInitializeFunction · 0.85
CompilerErrorClass · 0.85
clearMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected