To help with identifiying root cause of a crash we are seeing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365599
91177308-0d34-0410-b5e6-
96231b3b80d8
/// Can represent both expanded and spelled tokens.
class Token {
public:
- Token(SourceLocation Location, unsigned Length, tok::TokenKind Kind)
- : Location(Location), Length(Length), Kind(Kind) {}
+ Token(SourceLocation Location, unsigned Length, tok::TokenKind Kind);
/// EXPECTS: clang::Token is not an annotation token.
explicit Token(const clang::Token &T);
using namespace clang;
using namespace clang::syntax;
+syntax::Token::Token(SourceLocation Location, unsigned Length,
+ tok::TokenKind Kind)
+ : Location(Location), Length(Length), Kind(Kind) {
+ assert(Location.isValid());
+}
+
syntax::Token::Token(const clang::Token &T)
: Token(T.getLocation(), T.getLength(), T.getKind()) {
assert(!T.isAnnotation());