MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / makeDiffCompUnitReport

Method makeDiffCompUnitReport

src/ErrorReporting/Report.cpp:92–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92std::pair<bool, bool> Report::makeDiffCompUnitReport(CommandLineParser* clp,
93 SymbolTable* st) {
94 // std::mutex m;
95 // m.lock();
96 constexpr std::string_view kDiffLogFileName = "diff.log";
97 FileSystem* const fileSystem = FileSystem::getInstance();
98 const PathId outputDirId = clp->getOutputDirId();
99 const PathId allLogFileId = fileSystem->getLogFile(false, st);
100 const PathId unitLogFileId = fileSystem->getLogFile(true, st);
101 const PathId diffFileId =
102 fileSystem->getChild(outputDirId, kDiffLogFileName, st);
103
104 bool readAll = false;
105 bool readUnit = false;
106 Result readAllResult;
107 Result readUnitResult;
108
109 while ((!readAll) || (!readUnit)) {
110 std::this_thread::sleep_for(std::chrono::microseconds(1000));
111 if (!readAll) {
112 readAll = parseReportFile(allLogFileId, readAllResult);
113 }
114 if (!readUnit) {
115 readUnit = parseReportFile(unitLogFileId, readUnitResult);
116 }
117 }
118
119 std::cout << "|-------|------------------|-------------------|" << std::endl;
120 std::cout << "| | FILE UNIT COMP | ALL COMPILATION |" << std::endl;
121 std::cout << "|-------|------------------|-------------------|" << std::endl;
122 std::cout << "| FATAL | " << std::setw(9) << readUnitResult.m_nbFatal
123 << " | " << std::setw(9) << readAllResult.m_nbFatal
124 << " |" << std::endl;
125 std::cout << "|SYNTAX | " << std::setw(9) << readUnitResult.m_nbSyntax
126 << " | " << std::setw(9) << readAllResult.m_nbSyntax
127 << " |" << std::endl;
128 std::cout << "| ERROR | " << std::setw(9) << readUnitResult.m_nbError
129 << " | " << std::setw(9) << readAllResult.m_nbError
130 << " |" << std::endl;
131 std::cout << "|WARNING| " << std::setw(9) << readUnitResult.m_nbWarning
132 << " | " << std::setw(9) << readAllResult.m_nbWarning
133 << " |" << std::endl;
134 std::cout << "| INFO | " << std::setw(9) << readUnitResult.m_nbInfo
135 << " | " << std::setw(9) << readAllResult.m_nbInfo
136 << " |" << std::endl;
137 std::cout << "| NOTE | " << std::setw(9) << readUnitResult.m_nbNote
138 << " | " << std::setw(9) << readAllResult.m_nbNote
139 << " |" << std::endl;
140 std::cout << "|-------|------------------|-------------------|" << std::endl;
141 std::cout << std::endl;
142 std::cout << "FILE UNIT LOG: " << PathIdPP(unitLogFileId) << std::endl;
143 std::cout << "ALL FILES LOG: " << PathIdPP(allLogFileId) << std::endl;
144
145 const PathId allCompileDirId = fileSystem->getCompileDir(false, st);
146 const PathId unitCompileDirId = fileSystem->getCompileDir(true, st);
147 const fs::path allCompileDir = fileSystem->toPlatformAbsPath(allCompileDirId);
148 const fs::path unitCompileDir =
149 fileSystem->toPlatformAbsPath(unitCompileDirId);

Callers 1

executeCompilationFunction · 0.80

Calls 9

parseReportFileFunction · 0.85
PathIdPPClass · 0.85
StrCatFunction · 0.85
getOutputDirIdMethod · 0.80
getChildMethod · 0.80
getCompileDirMethod · 0.80
toPlatformAbsPathMethod · 0.80
getLogFileMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected