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

Method getLineNb

src/SourceCompile/PreprocessFile.cpp:1229–1244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1227}
1228
1229uint32_t PreprocessFile::getLineNb(uint32_t line) {
1230 if (isMacroBody() && m_macroInfo) {
1231 return (m_macroInfo->m_startLine + line - 1);
1232 } else if (!m_lineTranslationVec.empty()) {
1233 uint32_t index = m_lineTranslationVec.size() - 1;
1234 while (true) {
1235 if (line >= m_lineTranslationVec[index].m_originalLine) {
1236 return (m_lineTranslationVec[index].m_pretendLine +
1237 (line - m_lineTranslationVec[index].m_originalLine));
1238 }
1239 if (index == 0) break;
1240 index--;
1241 }
1242 }
1243 return line;
1244}
1245
1246std::string PreprocessFile::getPreProcessedFileContent() {
1247 FileSystem* const fileSystem = FileSystem::getInstance();

Callers 1

evaluateMacro_Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected