llvm-project/clang/lib/Lex
Douglas Gregor cd8bdd025f Improve performance during cursor traversal when a region of interest
is present. 

Rather than using clang_getCursorExtent(), which requires
us to lex the token at the ending position to determine its
length. Then, we'd be comparing [a, b) source ranges that cover the
characters in the range rather than the normal behavior for Clang's
source ranges, which covers the tokens in the range. However, relexing
causes us to read the source file (which may come from a precompiled
header), which is rather unfortunate and affects performance.

In the new scheme, we only use Clang-style source ranges that cover
the tokens in the range. At the entry points where this matters
(clang_annotateTokens, clang_getCursor), we make sure to move source
locations to the start of the token.

Addresses most of <rdar://problem/8049381>.

llvm-svn: 109134
2010-07-22 20:22:31 +00:00
..
CMakeLists.txt Introduce the notion of a "preprocessing record", which keeps track of 2010-03-18 17:52:52 +00:00
HeaderMap.cpp Simplify code. No functionality change. 2010-01-10 09:51:00 +00:00
HeaderSearch.cpp stringref'ize a bunch of filename handling logic. Much 2010-01-10 01:35:12 +00:00
Lexer.cpp Improve performance during cursor traversal when a region of interest 2010-07-22 20:22:31 +00:00
LiteralSupport.cpp Complain when string literals are too long for the active language 2010-07-20 14:33:20 +00:00
MacroArgs.cpp Audit all Preprocessor::getSpelling() callers, improving failure 2010-03-16 22:30:13 +00:00
MacroArgs.h The PreExpArgTokens array is indexed with an argument #, 2009-12-28 06:17:16 +00:00
MacroInfo.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
Makefile BUILD_ARCHIVE is the default for libraries, no need to set it. 2010-07-18 00:14:47 +00:00
PPCaching.cpp Remove the check for repeated tok::eofs, we are not supposed to go past eof so this code is 2010-07-12 21:41:41 +00:00
PPDirectives.cpp push some source location information down through the compiler, 2010-04-20 20:35:58 +00:00
PPExpressions.cpp Introduce optional "Invalid" parameters to routines that invoke the 2010-03-16 05:20:39 +00:00
PPLexerChange.cpp push some source location information down through the compiler, 2010-04-20 20:35:58 +00:00
PPMacroExpansion.cpp More clang support for darwin tls. Add a __has_feature macro and 2010-06-24 02:02:00 +00:00
PTHLexer.cpp Switch over IdentifierInfoLookup to StringRef 2010-03-12 08:23:34 +00:00
Pragma.cpp Modify the pragma handlers to accept and use StringRefs instead of IdentifierInfos. 2010-07-13 09:07:17 +00:00
PreprocessingRecord.cpp Robustify PreprocessingRecord slightly, by only creating macro 2010-03-19 21:58:23 +00:00
Preprocessor.cpp Modify the pragma handlers to accept and use StringRefs instead of IdentifierInfos. 2010-07-13 09:07:17 +00:00
PreprocessorLexer.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
ScratchBuffer.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
TokenConcatenation.cpp make the token paste avoidance logic turn "..." into ".. ." instead of ". . ." 2010-04-14 03:57:19 +00:00
TokenLexer.cpp Add another terrible VC++ compatibility hack: allow users to 2010-07-17 16:24:30 +00:00