Clang: Use line and column instead of offset for diagnostics

Offsets can be get wrong because of the utf8 <-> utf16 differences. Line
and columns are not that sensitive to it.

Change-Id: I2e3e8c000621b6d694a4ada6df176f29427794f5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-12-02 20:07:29 +01:00
committed by Nikolai Kosjar
parent a4231de01c
commit 19d9dc0ce3
11 changed files with 179 additions and 62 deletions

View File

@@ -67,7 +67,7 @@ uint SourceLocation::offset() const
SourceLocationContainer SourceLocation::toSourceLocationContainer() const
{
return SourceLocationContainer(filePath_, line_, offset_);
return SourceLocationContainer(filePath_, line_, column_);
}
SourceLocation::SourceLocation(CXSourceLocation cxSourceLocation)
@@ -94,7 +94,8 @@ SourceLocation::SourceLocation(CXTranslationUnit cxTranslationUnit,
line,
column)),
filePath_(filePath),
line_(line)
line_(line),
column_(column)
{
}