| 64 | } |
| 65 | |
| 66 | bool CompileProgram::compile() { |
| 67 | const FileContent* fC = m_program->m_fileContents[0]; |
| 68 | NodeId nodeId = m_program->m_nodeIds[0]; |
| 69 | |
| 70 | Location loc(fC->getFileId(nodeId), fC->Line(nodeId), fC->Column(nodeId), |
| 71 | m_symbols->registerSymbol(m_program->getName())); |
| 72 | |
| 73 | Error err1(ErrorDefinition::COMP_COMPILE_PROGRAM, loc); |
| 74 | ErrorContainer* errors = |
| 75 | new ErrorContainer(m_symbols, m_errors->getLogListener()); |
| 76 | errors->registerCmdLine( |
| 77 | m_compileDesign->getCompiler()->getCommandLineParser()); |
| 78 | errors->addError(err1); |
| 79 | errors->printMessage( |
| 80 | err1, |
| 81 | m_compileDesign->getCompiler()->getCommandLineParser()->muteStdout()); |
| 82 | delete errors; |
| 83 | |
| 84 | Error err2(ErrorDefinition::COMP_PROGRAM_OBSOLETE_USAGE, loc); |
| 85 | m_errors->addError(err2); |
| 86 | |
| 87 | if (!collectObjects_(CollectType::FUNCTION)) return false; |
| 88 | if (!collectObjects_(CollectType::DEFINITION)) return false; |
| 89 | if (!collectObjects_(CollectType::OTHER)) return false; |
| 90 | |
| 91 | return true; |
| 92 | } |
| 93 | |
| 94 | bool CompileProgram::collectObjects_(CollectType collectType) { |
| 95 | const FileContent* fC = m_program->m_fileContents[0]; |
no test coverage detected