Commit Graph

228 Commits

Author SHA1 Message Date
Douglas Gregor d4ed114e23 PCH support for CompoundAssignOperator and ConditionalOperator
llvm-svn: 69237
2009-04-15 22:40:36 +00:00
Douglas Gregor 978887b6b0 PCH support for ImaginaryLiteral and ArraySubscriptExpr
llvm-svn: 69233
2009-04-15 22:19:53 +00:00
Daniel Dunbar 7dd749e6fd Defer generation of tentative definitions.
- PR3980.

 - <rdar://problem/6762287> [irgen] crash when generating tentative
   definition of incomplete structure

 - This also avoids creating common definitions for things which are
   later overwritten.

 - XFAIL'ed external-defs.c, it isn't completing types properly yet.

llvm-svn: 69231
2009-04-15 22:08:45 +00:00
Douglas Gregor 455b8f4106 PCH support for ExtQualType
llvm-svn: 69230
2009-04-15 22:00:08 +00:00
Douglas Gregor bc8a78d5a4 PCH support for declaration attributes
llvm-svn: 69225
2009-04-15 21:30:51 +00:00
Douglas Gregor e20a2e5fa3 PCH support for MemberExpr and CallExpr.
llvm-svn: 69186
2009-04-15 17:43:59 +00:00
Douglas Gregor 958dfc9bbd PCH support for string literals
llvm-svn: 69172
2009-04-15 16:35:07 +00:00
Douglas Gregor 0253c83610 PCH support for UnaryOperator, SizeOfAlignOfExpr
llvm-svn: 69169
2009-04-15 15:58:59 +00:00
Douglas Gregor 67fdb085b9 PCH support for CStyleCastExpr and BinaryOperator expression kinds.
llvm-svn: 69119
2009-04-15 00:25:59 +00:00
Douglas Gregor 954a830eca PCH support for ParenExpr
llvm-svn: 69106
2009-04-14 23:59:37 +00:00
Douglas Gregor f0b575f79d Add PCH support for ImplicitCastExprs. This is the first expression
kind PCH handles that has an expression as an operand, so most of this
work is in the infrastructure to rebuild expression trees from the
serialized representation. We now store expressions in post-order
(e.g., Reverse Polish Notation), so that we can easily rebuild the
appropriate expression tree.

llvm-svn: 69101
2009-04-14 23:32:43 +00:00
Douglas Gregor e0a3a51637 Add PCH support for PredefinedExpr and FloatingLiteral expressions
llvm-svn: 69084
2009-04-14 21:55:33 +00:00
Douglas Gregor feb84b0074 PCH support for a few very, very simple kinds of expressions. Hook up
expression (de-)serialization for VLAs, variable initializers,
enum constant initializers, and bitfield widths.

llvm-svn: 69075
2009-04-14 21:18:50 +00:00
Douglas Gregor db908332e3 Add a tricky, tricky test case for PCH that we currently don't handle. Committed with a FIXME so that we don't forget it
llvm-svn: 69052
2009-04-14 17:10:28 +00:00
Douglas Gregor 54feb84489 When building a PCH file, don't perform end-of-translation-unit
wrap-up (e.g., turning tentative definitions into definitions). Also,
very that, when we actually use the PCH file, we get the ride code
generation for tentative definitions and definitions that show up in
the PCH file.

llvm-svn: 69043
2009-04-14 16:27:31 +00:00
Douglas Gregor 1a0d0b9acc When writing a PCH file, keep track of all of the non-static,
non-inline external definitions (and tentative definitions) that are
found at the top level. The corresponding declarations are stored in a
record in the PCH file, so that they can be provided to the
ASTConsumer (via HandleTopLevelDecl) when the PCH file is read.

llvm-svn: 69005
2009-04-14 00:24:19 +00:00
Douglas Gregor 92f056fadf PCH support for functions and their parameters.
llvm-svn: 68997
2009-04-13 22:18:37 +00:00
Douglas Gregor 183671e2d2 PCH support for record decls/types and their fields. Now that we can
handle the definition of __builtin_va_list on x86-64, eliminate the
forced -triple in PCH tests to get better coverage.

llvm-svn: 68988
2009-04-13 21:20:57 +00:00
Douglas Gregor 85c0fcd66d Introduce PCH (de-)serialization for most compound types, excluding
Objective-C types and record types for the moment.

llvm-svn: 68984
2009-04-13 20:46:52 +00:00
Douglas Gregor 1daeb69f95 Add PCH support for enumerations and enumerators.
llvm-svn: 68974
2009-04-13 18:14:40 +00:00
Douglas Gregor 4c7626e7b6 Include the SourceManager's line table in the PCH file. We can now
properly cope with #line directives in PCH files.

llvm-svn: 68963
2009-04-13 16:31:14 +00:00
Chris Lattner 0af3ba1748 implement the microsoft/gnu "__COUNTER__" macro: rdar://4329310
llvm-svn: 68933
2009-04-13 01:29:17 +00:00
Chris Lattner c523d8e88c now that we have an identifier table in the PCH file, finish hooking up
macro deserialization.  We now correctly install II's in tokens, handle
function-like macros, etc.

llvm-svn: 68882
2009-04-11 21:15:38 +00:00
Chris Lattner 28d198177f test this in non-pch mode as well as in pch mode.
llvm-svn: 68881
2009-04-11 20:52:19 +00:00
Chris Lattner d959d753bc do a dance with predefines, and finally enable reading of macros from
PCH.  This works now, except for limitations not being able to do things
with identifiers.  The basic example in the testcase works though.

llvm-svn: 68832
2009-04-10 22:13:17 +00:00
Douglas Gregor 1e9bf3bad4 Various minor fixes to PCH reading and writing, with general
cleanup. Aside from a minor tweak to the PCH file format, no
functionality change. 

llvm-svn: 68793
2009-04-10 17:25:41 +00:00
Douglas Gregor a7f71a91c5 PCH serialization/deserialization of the source manager. With this
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.

llvm-svn: 68758
2009-04-10 03:52:48 +00:00
Douglas Gregor ef84c4b434 Implementation of pre-compiled headers (PCH) based on lazy
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.

llvm-svn: 68732
2009-04-09 22:27:44 +00:00