Change Lexer::MeasureTokenLength to take a LangOptions reference.
This allows it to accurately measure tokens, so that we get:
t.cpp:8:13: error: unknown type name 'X'
static foo::X P;
~~~~~^
instead of the woefully inferior:
t.cpp:8:13: error: unknown type name 'X'
static foo::X P;
~~~~ ^
Most of this is just plumbing to push the reference around.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69099 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp
index bc754cb..b0b35e4 100644
--- a/lib/Frontend/PCHReader.cpp
+++ b/lib/Frontend/PCHReader.cpp
@@ -482,14 +482,15 @@
SourceLocation::getFromRawEncoding(Record[2]),
SourceLocation::getFromRawEncoding(Record[3]),
Lexer::MeasureTokenLength(SpellingLoc,
- SourceMgr));
+ SourceMgr,
+ PP.getLangOptions()));
break;
}
- case pch::SM_LINE_TABLE: {
+ case pch::SM_LINE_TABLE:
if (ParseLineTable(SourceMgr, Record))
return Failure;
- }
+ break;
}
}
}