]> granicus.if.org Git - clang/commit
Teach CIndex's cursor visitor to restrict its traversal to a specific
authorDouglas Gregor <dgregor@apple.com>
Fri, 22 Jan 2010 19:49:59 +0000 (19:49 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 22 Jan 2010 19:49:59 +0000 (19:49 +0000)
commit33e9abd21083a0191a7676a04b497006d2da184d
treefc940943935ee6e5460a2f0c580183a48fd21989
parent372ade25bd4c56355172210dfc2a308cfa75b55a
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
12 files changed:
include/clang/Lex/Preprocessor.h
lib/AST/Decl.cpp
lib/Lex/Lexer.cpp
lib/Lex/Preprocessor.cpp
test/Index/TestClassDecl.m
test/Index/TestClassForwardDecl.m
test/Index/c-index-api-fn-scan.m [deleted file]
test/Index/c-index-api-loadTU-test.m
test/Index/c-index-getCursor-test.m
test/Index/find-decls.c [deleted file]
test/Index/find-defs.c [deleted file]
tools/CIndex/CIndex.cpp