llvm-project/clang/lib/Lex
Argyrios Kyrtzidis 61ef3db222 Boost the efficiency of SourceManager::getMacroArgExpandedLocation.
Currently getMacroArgExpandedLocation is very inefficient and for the case
of a location pointing at the main file it will end up checking almost all of
the SLocEntries. Make it faster:

-Use a map of macro argument chunks to their expanded source location. The map
 is for a single source file, it's stored in the file's ContentCache and lazily
 computed, like the source lines cache.
-In SLocEntry's FileInfo add an 'unsigned NumCreatedFIDs' field that keeps track
 of the number of FileIDs (files and macros) that were created during preprocessing
 of that particular file SLocEntry. This is useful when computing the macro argument
 map in skipping included files while scanning for macro arg FileIDs that lexed from
 a specific source file. Due to padding, the new field does not increase the size
 of SLocEntry.

llvm-svn: 138225
2011-08-21 23:33:04 +00:00
..
CMakeLists.txt Add CMake dependencies so that LLVM_USED_LIBS order doesn't matter. 2011-02-11 23:46:38 +00:00
HeaderMap.cpp remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports 2011-07-23 10:55:15 +00:00
HeaderSearch.cpp Use the "Bar.h" -> <Foo/Bar.h> remapping for index header maps only as 2011-07-30 06:28:34 +00:00
Lexer.cpp Make Lexer::GetBeginningOfToken able to handle macro arg expansion locations. 2011-08-17 00:31:23 +00:00
LiteralSupport.cpp Warn about and truncate UCNs that are too big for their character literal type. 2011-08-19 03:20:12 +00:00
MacroArgs.cpp Add support for C++0x unicode string and character literals, from Craig Topper! 2011-07-27 05:40:30 +00:00
MacroArgs.h Make the Preprocessor more memory efficient and improve macro instantiation diagnostics. 2011-07-07 03:40:34 +00:00
MacroInfo.cpp Rename getDecomposedInstantiationLoc to getDecomposedExpansionLoc. 2011-07-25 20:52:32 +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 Add support for C++0x unicode string and character literals, from Craig Topper! 2011-07-27 05:40:30 +00:00
PPExpressions.cpp A couple fixes for preprocessor expressions: 2011-08-03 00:04:13 +00:00
PPLexerChange.cpp Boost the efficiency of SourceManager::getMacroArgExpandedLocation. 2011-08-21 23:33:04 +00:00
PPMacroExpansion.cpp [libclang] Support code-completion inside macro arguments. 2011-08-18 19:41:28 +00:00
PTHLexer.cpp remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports 2011-07-23 10:55:15 +00:00
Pragma.cpp Add support for C++0x unicode string and character literals, from Craig Topper! 2011-07-27 05:40:30 +00:00
PreprocessingRecord.cpp For the MacroExpands preprocessor callback, also pass the SourceRange 2011-08-18 01:05:45 +00:00
Preprocessor.cpp Change Preprocessor::getTotalMemory() to use llvm::capacity_in_bytes(). 2011-07-27 18:41:23 +00:00
PreprocessorLexer.cpp Boost the efficiency of SourceManager::getMacroArgExpandedLocation. 2011-08-21 23:33:04 +00:00
ScratchBuffer.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
TokenConcatenation.cpp Raw string followup. Pass a couple StringRefs by value. 2011-08-11 05:10:55 +00:00
TokenLexer.cpp For assigning SourceLocations to macro arg tokens, reserve a single SLocEntry 2011-08-19 22:34:17 +00:00