liblangutil: SourceLocation: adds (shared) pointer to underlying CharStream source, eliminating sourceName

Also, adapted affecting code to those changes.
This commit is contained in:
Christian Parpart
2018-11-30 17:07:12 +01:00
parent 22eff22492
commit c48a5264be
17 changed files with 127 additions and 102 deletions
+2 -2
View File
@@ -122,8 +122,8 @@ void ASTJsonConverter::setJsonNode(
string ASTJsonConverter::sourceLocationToString(SourceLocation const& _location) const
{
int sourceIndex{-1};
if (_location.sourceName && m_sourceIndices.count(*_location.sourceName))
sourceIndex = m_sourceIndices.at(*_location.sourceName);
if (_location.source && m_sourceIndices.count(_location.source->name()))
sourceIndex = m_sourceIndices.at(_location.source->name());
int length = -1;
if (_location.start >= 0 && _location.end >= 0)
length = _location.end - _location.start;