llvm-project/clang/lib/Lex
Douglas Gregor 3f4bea0646 Introduce basic support for loading a precompiled preamble while
reparsing an ASTUnit. When saving a preamble, create a buffer larger
than the actual file we're working with but fill everything from the
end of the preamble to the end of the file with spaces (so the lexer
will quickly skip them). When we load the file, create a buffer of the
same size, filling it with the file and then spaces. Then, instruct
the lexer to start lexing after the preamble, therefore continuing the
parse from the spot where the preamble left off.

It's now possible to perform a simple preamble build + parse (+
reparse) with ASTUnit. However, one has to disable a bunch of checking
in the PCH reader to do so. That part isn't committed; it will likely
be handled with some other kind of flag (e.g., -fno-validate-pch).

As part of this, fix some issues with null termination of the memory
buffers created for the preamble; we were trying to explicitly
NULL-terminate them, even though they were also getting implicitly
NULL terminated, leading to excess warnings about NULL characters in
source files.

llvm-svn: 109445
2010-07-26 21:36:20 +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 Introduce basic support for loading a precompiled preamble while 2010-07-26 21:36:20 +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 Fix namespace polution. 2010-07-26 21:25:24 +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 Introduce basic support for loading a precompiled preamble while 2010-07-26 21:36:20 +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