hanchenye-llvm-project/clang/lib/Serialization
Douglas Gregor 925296b4c2 Revamp the SourceManager to separate the representation of parsed
source locations from source locations loaded from an AST/PCH file.

Previously, loading an AST/PCH file involved carefully pre-allocating
space at the beginning of the source manager for the source locations
and FileIDs that correspond to the prefix, and then appending the
source locations/FileIDs used for parsing the remaining translation
unit. This design forced us into loading PCH files early, as a prefix,
whic has become a rather significant limitation.

This patch splits the SourceManager space into two parts: for source
location "addresses", the lower values (growing upward) are used to
describe parsed code, while upper values (growing downward) are used
for source locations loaded from AST/PCH files. Similarly, positive
FileIDs are used to describe parsed code while negative FileIDs are
used to file/macro locations loaded from AST/PCH files. As a result,
we can load PCH/AST files even during parsing, making various
improvemnts in the future possible, e.g., teaching #include <foo.h> to
look for and load <foo.h.gch> if it happens to be already available.

This patch was originally written by Sebastian Redl, then brought
forward to the modern age by Jonathan Turner, and finally
polished/finished by me to be committed.

llvm-svn: 135484
2011-07-19 16:10:42 +00:00
..
ASTCommon.cpp Make yet another placeholder type, this one marking that an expression is a bound 2011-04-26 20:42:42 +00:00
ASTCommon.h Add a decl update when a static data member of a class template is instantiated in a different PCH than its containing class. Otherwise we get double definition errors. Fixes a Boost.MPL problem that affects Boost.Accumulators and probably a lot more of Boost. 2011-04-29 08:19:30 +00:00
ASTReader.cpp Revamp the SourceManager to separate the representation of parsed 2011-07-19 16:10:42 +00:00
ASTReaderDecl.cpp Objective-C fast enumeration loop variables are not retained in ARC, but 2011-06-17 06:42:21 +00:00
ASTReaderStmt.cpp Add serialization support for SubstNonTypeTemplateParmExpr. 2011-07-15 07:00:14 +00:00
ASTWriter.cpp Revamp the SourceManager to separate the representation of parsed 2011-07-19 16:10:42 +00:00
ASTWriterDecl.cpp Introduce the notion of instantiation dependence into Clang's AST. A 2011-07-01 01:22:09 +00:00
ASTWriterStmt.cpp Add serialization support for SubstNonTypeTemplateParmExpr. 2011-07-15 07:00:14 +00:00
CMakeLists.txt Fix CMake build. 2011-03-09 21:12:34 +00:00
ChainedIncludesSource.cpp Augment the interface of ExternalASTSource::FindExternalLexicalDecls() 2011-07-15 21:46:17 +00:00
GeneratePCH.cpp Allow resolving headers from a PCH even after headers+PCH were moved to another path. 2011-02-15 17:54:22 +00:00
Makefile Reintroduce the serialization library, with fixed dependencies. 2010-08-17 20:43:28 +00:00