Граф коммитов

63 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 3251ceb90b Write the identifier table into the PCH file as an on-disk hash table
that also includes the contents of the IdentifierInfo itself (the
various fields and flags, along with the chain of identifiers visible
at the top level that have that name).

We don't make any use of the hash table yet, except that our
identifier ID -> string mapping points into the hash table now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 20:36:09 +00:00
Steve Naroff 33feeb019a Add pch reader/writer support for ObjCContainerDecl, ObjCInterfaceDecl, & ObjCIvarDecl.
Next step: Add selector support to PCHWriter::AddDeclarationName().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69619 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 20:09:33 +00:00
Chris Lattner cf2a7211b4 the __gnuc_inline__ attribute is actually named __gnu_inline__,
PR4023


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69618 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 19:12:28 +00:00
Steve Naroff 53c9d8a4b8 Add pch reader/writer support for ObjCMethodDecl.
Test will be enabled with ObjCInterfaceDecl is added.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 15:06:07 +00:00
Chris Lattner ad56d68425 Add location info for indirect goto.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 01:04:21 +00:00
Douglas Gregor ad1de006ea 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18 05:55:16 +00:00
Douglas Gregor 250fc9c859 Lazy deserialization of function bodies for PCH files. For the Carbon
"Hello, World!", this takes us from deserializing 6469
statements/expressions down to deserializing 1
statement/expression. It only translated into a 1% improvement on the
Carbon-prefixed 403.gcc, but (a) it's the right thing to do, and (b)
we expect this to matter more once we lazily deserialize identifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18 00:07:54 +00:00
Douglas Gregor 3e1af84bb0 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69393 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 22:13:46 +00:00
Douglas Gregor cd7d5a9dc5 PCH support for inline assembly statements.
This completes support for all of C (+ extensions). We can (again)
build a PCH file for Carbon.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 20:57:14 +00:00
Douglas Gregor f7dac085f8 PCH tests for va_arg expressions. Verified that the blocks test does create a BlockDeclRefExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 20:06:59 +00:00
Douglas Gregor 84af7c27cd PCH support for blocks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69373 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 19:21:43 +00:00
Douglas Gregor 6a2dd55b0b PCH support for GNU statement expressions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69370 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 19:05:30 +00:00
Douglas Gregor 7d5c2f241c PCH support for indirect gotos and address-of-label expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69369 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 18:58:21 +00:00
Douglas Gregor 1de05feeea PCH support for labels and goto.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 18:18:49 +00:00
Douglas Gregor 84f2170062 PCH support for declaration statements, and a test for PredefinedExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 16:55:36 +00:00
Douglas Gregor 0de9d8857b PCH support for return statements.
Optimize PCH encoding for switch-case statements slightly, by making
the switch-case numbering local to a particular statement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 16:34:57 +00:00
Douglas Gregor 67d8249924 PCH support for do-while and for loops
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69334 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 00:29:51 +00:00
Douglas Gregor d921cf976b PCH support for while and continue statements
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69332 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 00:16:09 +00:00
Douglas Gregor 025452fa0e PCH support for the first batch of statements, including null,
compound, case, default, if, switch, and break statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69329 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 00:04:06 +00:00
Douglas Gregor cb70bb2899 Clean up the declaration-decoding step in the PCH reader, using the
same ueber-easy visitor scheme used for expressions/statements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69320 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 22:29:51 +00:00
Douglas Gregor c9490c000f Prepare PCH reader and writer for (de-)serialization of statements. No
functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 22:23:12 +00:00
Douglas Gregor 63f5c2646e Eliminate pch::TYPE_ATTR, which is never used
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69256 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 02:45:14 +00:00
Douglas Gregor ba6d7e7fa5 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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69255 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 02:33:48 +00:00
Douglas Gregor d077d759d0 PCH support for InitListExpr, DesignatedInitExpr, and ImplicitValueInitExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69251 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 00:55:48 +00:00
Douglas Gregor 94cd5d1397 PCH support for ShuffleVectorExpr and BlockDeclRefExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69244 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 00:01:45 +00:00
Douglas Gregor 44cae0c866 PCH support for TypesCompatibleExpr, ChooseExpr, and GNUNullExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69242 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 23:33:31 +00:00
Douglas Gregor d3c98a02c7 PCH support for ExtVectorElementExpr and VAArgExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 23:02:49 +00:00
Douglas Gregor ad90e96fb7 PCH support for CompoundAssignOperator and ConditionalOperator
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69237 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 22:40:36 +00:00
Douglas Gregor cb2ca73c1d PCH support for ImaginaryLiteral and ArraySubscriptExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 22:19:53 +00:00
Douglas Gregor 6d47396712 PCH support for ExtQualType
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 22:00:08 +00:00
Douglas Gregor 68a2eb0cc7 PCH support for declaration attributes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69225 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 21:30:51 +00:00
Douglas Gregor 6a2bfb2ead PCH support for the string literal of a FileScopeAsmDecl.
Some minor cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69196 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 18:43:11 +00:00
Douglas Gregor f60e991869 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 18:05:10 +00:00
Douglas Gregor 1f0d0133b0 PCH support for MemberExpr and CallExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69186 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 17:43:59 +00:00
Douglas Gregor 673ecd6a4a PCH support for string literals
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 16:35:07 +00:00
Douglas Gregor 0b0b77fa29 PCH support for UnaryOperator, SizeOfAlignOfExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69169 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 15:58:59 +00:00
Douglas Gregor 62e445c4df Don't tip-to around BitstreamReader::JumpToBit jumping to the end of the stream. LLVM has been updated to allow this
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69146 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 04:54:29 +00:00
Douglas Gregor db600c330a PCH support for CStyleCastExpr and BinaryOperator expression kinds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 00:25:59 +00:00
Douglas Gregor c04db4feef PCH support for ParenExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69106 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14 23:59:37 +00:00
Douglas Gregor 087fd53680 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14 23:32:43 +00:00
Chris Lattner 2c78b873f4 Change Lexer::MeasureTokenLength to take a LangOptions reference.
This allows it to accurately measure tokens, so that we get:

t.cpp:8:13: error: unknown type name 'X'
static foo::X  P;
       ~~~~~^

instead of the woefully inferior:

t.cpp:8:13: error: unknown type name 'X'
static foo::X  P;
       ~~~~ ^

Most of this is just plumbing to push the reference around.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14 23:22:57 +00:00
Douglas Gregor 17fc223395 Add PCH support for PredefinedExpr and FloatingLiteral expressions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69084 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14 21:55:33 +00:00
Douglas Gregor 0b7489194f 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69075 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14 21:18:50 +00:00
Douglas Gregor fdd0172ca1 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14 00:24:19 +00:00
Douglas Gregor 1028bc67d5 Partial PCH support for FileScopeAsmDecl and BlockDecl. Both require
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-13 22:49:25 +00:00
Douglas Gregor 3a2f7e4251 PCH support for functions and their parameters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 22:18:37 +00:00
Douglas Gregor 8c70006581 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68988 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 21:20:57 +00:00
Douglas Gregor 2d41cc1a8c Print the number (and percentage) of identifiers read from the PCH file as part of its statistics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 20:50:16 +00:00
Douglas Gregor b4e715beeb Introduce PCH (de-)serialization for most compound types, excluding
Objective-C types and record types for the moment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68984 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 20:46:52 +00:00
Douglas Gregor 0a2b45e588 Add PCH support for enumerations and enumerators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68974 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 18:14:40 +00:00