diff options
Diffstat (limited to 'include/clang/Lex')
| -rw-r--r-- | include/clang/Lex/Lexer.h | 3 | ||||
| -rw-r--r-- | include/clang/Lex/Token.h | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/clang/Lex/Lexer.h b/include/clang/Lex/Lexer.h index 0f36df43e232..6a6e319463f0 100644 --- a/include/clang/Lex/Lexer.h +++ b/include/clang/Lex/Lexer.h @@ -199,6 +199,9 @@ public: /// the current file. SourceLocation getSourceLocation() { return getSourceLocation(BufferPtr); } + /// \brief Return the current location in the buffer. + const char *getBufferLocation() const { return BufferPtr; } + /// Stringify - Convert the specified string into a C string by escaping '\' /// and " characters. This does not add surrounding ""'s to the string. /// If Charify is true, this escapes the ' character instead of ". diff --git a/include/clang/Lex/Token.h b/include/clang/Lex/Token.h index 604eae1027aa..b5dde9a700e8 100644 --- a/include/clang/Lex/Token.h +++ b/include/clang/Lex/Token.h @@ -124,6 +124,10 @@ public: UintData = L.getRawEncoding(); } + SourceLocation getLastLoc() const { + return isAnnotation() ? getAnnotationEndLoc() : getLocation(); + } + /// getAnnotationRange - SourceRange of the group of tokens that this /// annotation token represents. SourceRange getAnnotationRange() const { |
