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

Method getFileId

src/SourceCompile/PreprocessFile.cpp:1202–1227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1200}
1201
1202PathId PreprocessFile::getFileId(uint32_t line) const {
1203 const uint32_t size = m_lineTranslationVec.size();
1204 if (isMacroBody() && m_macroInfo) {
1205 return m_macroInfo->m_fileId;
1206 } else {
1207 if (size) {
1208 if (size == 1) {
1209 if (line >= m_lineTranslationVec[0].m_originalLine) {
1210 return (m_lineTranslationVec[0].m_pretendFileId);
1211 }
1212 } else {
1213 uint32_t index = size - 1;
1214 while (true) {
1215 if (line >= m_lineTranslationVec[index].m_originalLine) {
1216 return (m_lineTranslationVec[index].m_pretendFileId);
1217 }
1218 if (index == 0) break;
1219 index--;
1220 }
1221 }
1222 return m_fileId;
1223 } else {
1224 return m_fileId;
1225 }
1226 }
1227}
1228
1229uint32_t PreprocessFile::getLineNb(uint32_t line) {
1230 if (isMacroBody() && m_macroInfo) {

Callers 3

syntaxErrorMethod · 0.45
getIncluderFileIdMethod · 0.45
evaluateMacro_Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected