aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriter.cpp
AgeCommit message (Collapse)Author
2009-04-13Partial PCH support for FileScopeAsmDecl and BlockDecl. Both requireDouglas Gregor
expression or statement serialization before we can test them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13PCH support for functions and their parameters.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13PCH support for record decls/types and their fields. Now that we canDouglas Gregor
handle the definition of __builtin_va_list on x86-64, eliminate the forced -triple in PCH tests to get better coverage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68988 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13Add PCH support for enumerations and enumerators.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68974 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13Include the SourceManager's line table in the PCH file. We can nowDouglas Gregor
properly cope with #line directives in PCH files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68963 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13implement the microsoft/gnu "__COUNTER__" macro: rdar://4329310Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68933 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-11now that we have an identifier table in the PCH file, finish hooking upChris Lattner
macro deserialization. We now correctly install II's in tokens, handle function-like macros, etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-11add some #includes for better compatibility with gcc 4.4,Chris Lattner
thanks to Tobias Stadler for pointing this out. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68868 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-11Store unique IDs for identifiers in the PCH file. Use some bitmanglingDouglas Gregor
so that we only need to perform the lookup and identifier resolution once per identifier in the PCH file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68846 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10Compare the predefines buffer in the PCH file with the predefinesDouglas Gregor
buffer generated for the current translation unit. If they are different, complain and then ignore the PCH file. This effectively checks for all compilation options that somehow would affect preprocessor state (-D, -U, -include, the dreaded -imacros, etc.). When we do accept the PCH file, throw away the contents of the predefines buffer rather than parsing them, since all of the results of that parsing are already stored in the PCH file. This eliminates the ugliness with the redefinition of __builtin_va_list, among other things. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68838 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10add support for reading macros. This does all the reading (with a bunch ofChris Lattner
fixme's, e.g. for tokens with identifiers) but does not actually install them. Some details with the predefines buffer needs to be sorted out first. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10Encode the target triple in the PCH file, and check that target triple when ↵Douglas Gregor
using the PCH file git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68824 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10Implement serialization/deserialization of LangOptions in the PCHDouglas Gregor
file. When de-serializing LangOptions, we check that the currently-provided language options are consistent with the options used to compile the PCH file. If they are not, we emit a diagnostic and ignore the PCH file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68820 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10add a new PP_MACRO_NAME hack so that I can test object-like macros.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10emit tokens, constify the Preprocessor passed down into PCH writer.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10emit function-like and object-like macros to the PCH file.Chris Lattner
Note that we don't do anything useful with identifier infos yet and don't emit the tokens that the macros are defined to. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10Various minor fixes to PCH reading and writing, with generalDouglas Gregor
cleanup. Aside from a minor tweak to the PCH file format, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68793 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10improve punctuationChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68791 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10Arrange for the preprocessor to be passed down into the PCH writer.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-10PCH serialization/deserialization of the source manager. With thisDouglas Gregor
improvement, source locations read from the PCH file will properly resolve to the source files that were used to build the PCH file itself. Once we have the preprocessor state stored in the PCH file, source locations that refer to macro instantiations that occur in the PCH file should have the appropriate instantiation information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-09Implementation of pre-compiled headers (PCH) based on lazyDouglas Gregor
de-serialization of abstract syntax trees. PCH support serializes the contents of the abstract syntax tree (AST) to a bitstream. When the PCH file is read, declarations are serialized as-needed. For example, a declaration of a variable "x" will be deserialized only when its VarDecl can be found by a client, e.g., based on name lookup for "x" or traversing the entire contents of the owner of "x". This commit provides the framework for serialization and (lazy) deserialization, along with support for variable and typedef declarations (along with several kinds of types). More declarations/types, along with important auxiliary structures (source manager, preprocessor, etc.), will follow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68732 91177308-0d34-0410-b5e6-96231b3b80d8