Steve Naroff
aac654abeb
Add pch reader/writer support for ObjCContainerDecl, ObjCInterfaceDecl, & ObjCIvarDecl.
...
Next step: Add selector support to PCHWriter::AddDeclarationName().
llvm-svn: 69619
2009-04-20 20:09:33 +00:00
Chris Lattner
ddf6ca0355
the __gnuc_inline__ attribute is actually named __gnu_inline__,
...
PR4023
llvm-svn: 69618
2009-04-20 19:12:28 +00:00
Douglas Gregor
162dd0245e
Introduce the notion of a SemaConsumer, which is an ASTConsumer that
...
also gets access to the Sema object performing semantic analysis. This
will be used by the PCH writer to serialize Sema state.
No functionality change.
llvm-svn: 69595
2009-04-20 15:53:59 +00:00
Steve Naroff
04f2d14d6a
Add pch reader/writer support for ObjCMethodDecl.
...
Test will be enabled with ObjCInterfaceDecl is added.
llvm-svn: 69594
2009-04-20 15:06:07 +00:00
Chris Lattner
34d9a51892
Add location info for indirect goto.
...
llvm-svn: 69497
2009-04-19 01:04:21 +00:00
Douglas Gregor
13d190ffbc
Don't emit name-lookup tables for functions or methods in the PCH files
...
llvm-svn: 69449
2009-04-18 15:49:20 +00:00
Douglas Gregor
652d82a096
Store the type ID for __builtin_va_list in the PCH file, so that the
...
AST context's __builtin_va_list type will be set when the PCH file is
loaded. This fixes the crash when CodeGen'ing a va_arg expression
pulled in from a PCH file.
llvm-svn: 69421
2009-04-18 05:55:16 +00:00
Douglas Gregor
e3dcb2ddd1
FunctionDecl::getBody() is getting an ASTContext argument for use in
...
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.
llvm-svn: 69406
2009-04-18 00:02:19 +00:00
Douglas Gregor
08f0129003
Keep track of the number of statements/expressions written to and read
...
from a PCH file. It turns out that "Hello, World!" is bringing in 19%
of all of the statements in Carbon.h, so we need to be lazy.
llvm-svn: 69393
2009-04-17 22:13:46 +00:00
Douglas Gregor
f994f062fd
PCH support for inline assembly statements.
...
This completes support for all of C (+ extensions). We can (again)
build a PCH file for Carbon.h.
llvm-svn: 69385
2009-04-17 20:57:14 +00:00
Douglas Gregor
c95701da6c
PCH support for blocks
...
llvm-svn: 69373
2009-04-17 19:21:43 +00:00
Douglas Gregor
af97671954
PCH support for GNU statement expressions
...
llvm-svn: 69370
2009-04-17 19:05:30 +00:00
Douglas Gregor
779d865b48
PCH support for indirect gotos and address-of-label expressions.
...
llvm-svn: 69369
2009-04-17 18:58:21 +00:00
Douglas Gregor
6cc68a47b5
PCH support for labels and goto.
...
llvm-svn: 69364
2009-04-17 18:18:49 +00:00
Douglas Gregor
915b6c663d
PCH support for declaration statements, and a test for PredefinedExpr
...
llvm-svn: 69356
2009-04-17 16:55:36 +00:00
Douglas Gregor
f961e5921f
PCH support for return statements.
...
Optimize PCH encoding for switch-case statements slightly, by making
the switch-case numbering local to a particular statement.
llvm-svn: 69355
2009-04-17 16:34:57 +00:00
Douglas Gregor
71517c47e6
PCH support for do-while and for loops
...
llvm-svn: 69334
2009-04-17 00:29:51 +00:00
Douglas Gregor
e24cbc0f4b
PCH support for while and continue statements
...
llvm-svn: 69332
2009-04-17 00:16:09 +00:00
Douglas Gregor
a9af1d13da
PCH support for the first batch of statements, including null,
...
compound, case, default, if, switch, and break statements.
llvm-svn: 69329
2009-04-17 00:04:06 +00:00
Douglas Gregor
8f45df58b3
Prepare PCH reader and writer for (de-)serialization of statements. No
...
functionality change.
llvm-svn: 69319
2009-04-16 22:23:12 +00:00
Douglas Gregor
6d955a9d25
Eliminate pch::TYPE_ATTR, which is never used
...
llvm-svn: 69256
2009-04-16 02:45:14 +00:00
Douglas Gregor
4c5cd33527
PCH support for CompoundLiteralExpr. This is the last C expression
...
that does not require PCH support for statements. Only AddrLabelExpr,
StmtExpr, and BlockExpr remain (for C).
llvm-svn: 69255
2009-04-16 02:33:48 +00:00
Douglas Gregor
38676d50dc
PCH support for InitListExpr, DesignatedInitExpr, and ImplicitValueInitExpr.
...
llvm-svn: 69251
2009-04-16 00:55:48 +00:00
Douglas Gregor
a3c5590ec2
PCH support for ShuffleVectorExpr and BlockDeclRefExpr
...
llvm-svn: 69244
2009-04-16 00:01:45 +00:00
Douglas Gregor
8693ec4e58
PCH support for TypesCompatibleExpr, ChooseExpr, and GNUNullExpr.
...
llvm-svn: 69242
2009-04-15 23:33:31 +00:00
Douglas Gregor
2ebf8717a5
PCH support for ExtVectorElementExpr and VAArgExpr.
...
llvm-svn: 69240
2009-04-15 23:02:49 +00:00
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
Douglas Gregor
bc8a78d5a4
PCH support for declaration attributes
...
llvm-svn: 69225
2009-04-15 21:30:51 +00:00
Douglas Gregor
e95304ac93
PCH support for the string literal of a FileScopeAsmDecl.
...
Some minor cleanup.
llvm-svn: 69196
2009-04-15 18:43:11 +00:00
Douglas Gregor
8324327993
For source location entries that describe instantiations, encode the
...
token length in the PCH file rather than trying (and failing) to
reconstruct it be getting the spelling token's length.
llvm-svn: 69191
2009-04-15 18:05:10 +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
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
a541485bab
Partial PCH support for FileScopeAsmDecl and BlockDecl. Both require
...
expression or statement serialization before we can test them.
llvm-svn: 69002
2009-04-13 22:49:25 +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
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
225dd6c830
add some #includes for better compatibility with gcc 4.4,
...
thanks to Tobias Stadler for pointing this out.
llvm-svn: 68868
2009-04-11 18:40:46 +00:00
Douglas Gregor
3ed42cb0b3
Store unique IDs for identifiers in the PCH file. Use some bitmangling
...
so that we only need to perform the lookup and identifier resolution
once per identifier in the PCH file.
llvm-svn: 68846
2009-04-11 00:14:32 +00:00
Douglas Gregor
92863e475e
Compare the predefines buffer in the PCH file with the predefines
...
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.
llvm-svn: 68838
2009-04-10 23:10:45 +00:00