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

Method getFileLine

src/SourceCompile/SV3_1aTreeShapeHelper.cpp:168–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168std::tuple<PathId, uint32_t, uint16_t, uint32_t, uint16_t>
169SV3_1aTreeShapeHelper::getFileLine(antlr4::ParserRuleContext* ctx,
170 antlr4::Token* token) const {
171 ParseUtils::LineColumn lineCol =
172 (token == nullptr) ? ParseUtils::getLineColumn(m_tokens, ctx)
173 : ParseUtils::getLineColumn(token);
174 ParseUtils::LineColumn endLineCol =
175 (token == nullptr) ? ParseUtils::getEndLineColumn(m_tokens, ctx)
176 : ParseUtils::getEndLineColumn(token);
177 uint32_t line = 0;
178 uint16_t column = 0;
179 uint32_t endLine = 0;
180 uint16_t endColumn = 0;
181 PathId fileId;
182 if (m_ppOutputFileLocation || !m_pf->getPpFileId()) {
183 fileId = m_pf->getFileId(0);
184 line = lineCol.first;
185 column = lineCol.second;
186 endLine = endLineCol.first;
187 endColumn = endLineCol.second;
188 } else {
189 fileId = m_pf->getFileId(lineCol.first + m_lineOffset);
190 line = m_pf->getLineNb(lineCol.first + m_lineOffset);
191 column = lineCol.second;
192 endLine = m_pf->getLineNb(endLineCol.first + m_lineOffset);
193 endColumn = endLineCol.second;
194 }
195 return std::make_tuple(fileId, line, column, endLine, endColumn);
196}
197
198std::pair<double, TimeInfo::Unit> SV3_1aTreeShapeHelper::getTimeValue(
199 SV3_1aParser::Time_literalContext* ctx) {

Callers

nothing calls this directly

Calls 3

getPpFileIdMethod · 0.80
getFileIdMethod · 0.45
getLineNbMethod · 0.45

Tested by

no test coverage detected