Commit Graph

84 Commits

Author SHA1 Message Date
Chris Lattner a538967177 tblgen is now passing diagnostic group information in the .inc file, ignore it everywhere.
llvm-svn: 69269
2009-04-16 05:52:14 +00:00
Chris Lattner 22cb818913 implement framework for -fdiagnostics-show-option, but tblgen isn't
passing down the right info yet.

llvm-svn: 69268
2009-04-16 05:44:38 +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 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 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 534b6f27a0 Don't tip-to around BitstreamReader::JumpToBit jumping to the end of the stream. LLVM has been updated to allow this
llvm-svn: 69146
2009-04-15 04:54:29 +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
Chris Lattner 184e65d363 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.

llvm-svn: 69099
2009-04-14 23:22:57 +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 c3b1dd163b Print the number (and percentage) of identifiers read from the PCH file as part of its statistics
llvm-svn: 68985
2009-04-13 20:50:16 +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 a8854654ac Make the reading of the line table from a PCH file more robust against
the unlikely event that the filename IDs in the stored line table end
up being different from the filename IDs in the newly-created line
table.

llvm-svn: 68965
2009-04-13 17:12:42 +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
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
Chris Lattner 34321bcd0b add support for reading macros. This does all the reading (with a bunch of
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.

llvm-svn: 68828
2009-04-10 21:41:48 +00:00
Douglas Gregor bfbde53ce1 Encode the target triple in the PCH file, and check that target triple when using the PCH file
llvm-svn: 68824
2009-04-10 21:16:55 +00:00
Douglas Gregor 55abb2389d Implement serialization/deserialization of LangOptions in the PCH
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.

llvm-svn: 68820
2009-04-10 20:39:37 +00:00
Chris Lattner 2916a482fb add a new PP_MACRO_NAME hack so that I can test object-like macros.
llvm-svn: 68803
2009-04-10 18:22:18 +00:00
Chris Lattner 2199f5b4e5 emit tokens, constify the Preprocessor passed down into PCH writer.
llvm-svn: 68798
2009-04-10 18:08:30 +00:00
Chris Lattner baa52f47c1 emit function-like and object-like macros to the PCH file.
Note that we don't do anything useful with identifier infos yet
and don't emit the tokens that the macros are defined to.

llvm-svn: 68797
2009-04-10 18:00:12 +00:00
Douglas Gregor df47d734c2 Add PCH sources to CMake build files
llvm-svn: 68794
2009-04-10 17:28:42 +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
Chris Lattner 0910e3b92e improve punctuation
llvm-svn: 68791
2009-04-10 17:16:57 +00:00
Chris Lattner eeffaef7b9 Arrange for the preprocessor to be passed down into the PCH writer.
llvm-svn: 68790
2009-04-10 17:15:23 +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