| 470 | } |
| 471 | |
| 472 | void 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 | |
| 512 | bool Compiler::AddModuleFunction(const char* module, void (NCDECL *ptr)(), const char* name, int index) |
| 513 | { |
nothing calls this directly
no test coverage detected