diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-01-22 19:49:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-01-22 19:49:59 +0000 |
commit | 33e9abd21083a0191a7676a04b497006d2da184d (patch) | |
tree | fc940943935ee6e5460a2f0c580183a48fd21989 /include/clang/Lex/Preprocessor.h | |
parent | 372ade25bd4c56355172210dfc2a308cfa75b55a (diff) |
Teach CIndex's cursor visitor to restrict its traversal to a specific
region of interest (if provided). Implement clang_getCursor() in terms
of this traversal rather than using the Index library; the unified
cursor visitor is more complete, and will be The Way Forward.
Minor other tweaks needed to make this work:
- Extend Preprocessor::getLocForEndOfToken() to accept an offset
from the end, making it easy to move to the last character in the
token (rather than just past the end of the token).
- In Lexer::MeasureTokenLength(), the length of whitespace is zero.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94200 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 1e664c07a4..dedbbd868a 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -602,7 +602,12 @@ public: /// the returned source location would not be meaningful (e.g., if /// it points into a macro), this routine returns an invalid /// source location. - SourceLocation getLocForEndOfToken(SourceLocation Loc); + /// + /// \param Offset an offset from the end of the token, where the source + /// location should refer to. The default offset (0) produces a source + /// location pointing just past the end of the token; an offset of 1 produces + /// a source location pointing to the last character in the token, etc. + SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset = 0); /// DumpToken - Print the token to stderr, used for debugging. /// |