Douglas Gregor
ce3a8293a0
Implement -fno-validate-pch at the -cc1 level, which suppresses most
...
of the usual consistency checks used to determine when a precompiled
header is incompatible with the translation unit it's being loaded
into.
Enable this option when loading a precompiled preamble, because the
preamble loader will be performing all of this checking itself. Enable
the preamble-based test now that it's working.
This option is also useful for debugging Clang's PCH
(<rdar://problem/7532213>).
llvm-svn: 109475
2010-07-27 00:27:13 +00:00
Sebastian Redl
66c5eef182
- Fix recording of offsets of types in dependent PCHs.
...
- Stop reading in (and thus deserializing) every declaration in the TU when creating a dependent PCH.
- Switch the storage of a decl context's lexical declarations to a blob containing the IDs instead of a record. This is the only sane way of supporting update records later on.
llvm-svn: 109474
2010-07-27 00:17:23 +00:00
Nick Lewycky
19b9f958e1
Add source location information to C++ base specifiers.
...
llvm-svn: 109396
2010-07-26 16:56:01 +00:00
Sebastian Redl
ff4a2951d9
Make declarations in the dependent PCH visible, for C at least.
...
llvm-svn: 109292
2010-07-23 23:49:55 +00:00
Fariborz Jahanian
c51609a0b5
PCH read/write for selector reference pool.
...
Finishes off radar 6507158.
llvm-svn: 109256
2010-07-23 19:11:11 +00:00
Sebastian Redl
c67764eb4b
Thread bitstream cursors all the way through the AST reading stuff. This way, reading a trivial 2-element chained file actually works.
...
llvm-svn: 109191
2010-07-22 22:43:28 +00:00
Sebastian Redl
5c415f3e32
Allow loading declcontext information from any file in the chain. Properly write source locations to dependent files. WIP
...
llvm-svn: 109119
2010-07-22 17:01:13 +00:00
Sebastian Redl
4e6c567653
Allow loading macros from any file in the chain. WIP
...
llvm-svn: 109048
2010-07-21 22:31:37 +00:00
Sebastian Redl
fa0614458a
Promote some macro-related stuff to per-file data. Fix a cache-inefficient nested loop by inverting the nesting. Store the size of each file in the chain; will need this later for statement offsets.
...
llvm-svn: 109030
2010-07-21 20:07:32 +00:00
Sebastian Redl
c713b9665b
Allow loading identifiers from any file in the chain. WIP
...
llvm-svn: 108974
2010-07-21 00:46:22 +00:00
Sebastian Redl
b2831dbff7
Apparently not every system thinks that references in pairs are as cool as I think.
...
llvm-svn: 108959
2010-07-20 22:55:31 +00:00
Sebastian Redl
3462779369
Allow loading declarations from any file in the chain. WIP
...
llvm-svn: 108956
2010-07-20 22:46:15 +00:00
Sebastian Redl
837a6cbe03
Allow loading types from any file in the chain. WIP
...
llvm-svn: 108954
2010-07-20 22:37:49 +00:00
Sebastian Redl
0675030cf9
Allow loading source locations from any file in the chain. WIP
...
llvm-svn: 108942
2010-07-20 21:50:20 +00:00
Sebastian Redl
b293a45d28
More work on getting PCHReader to handle multiple files. Promote SLocOffsets to per-file data. WIP
...
llvm-svn: 108930
2010-07-20 21:20:32 +00:00
Sebastian Redl
bd1b5befee
Promote IdentifierOffsets to per-file data.
...
llvm-svn: 108762
2010-07-19 22:28:42 +00:00
Sebastian Redl
9e687994f3
Promote DeclOffsets and TypeOffsets to per-file data.
...
llvm-svn: 108760
2010-07-19 22:06:55 +00:00
Sebastian Redl
393f8b76c0
Promote the identifier table to per-file data. Also, if a CHAINED_METADATA record exists, it has to be the first thing in the PCH file.
...
llvm-svn: 108748
2010-07-19 20:52:06 +00:00
Sebastian Redl
c2e6dbfa19
Teach the PCH reader to load the dependency when encountering a chain metadata record. WIP
...
llvm-svn: 108578
2010-07-17 00:12:06 +00:00
Sebastian Redl
2abc0383ce
Separate out the initial loading of a PCH so that loading chained PCHs can reuse it.
...
llvm-svn: 108551
2010-07-16 20:41:52 +00:00
Sebastian Redl
34522813e7
First baby steps towards PCHReader being able to keep track of multiple PCH files. WIP
...
llvm-svn: 108537
2010-07-16 17:50:48 +00:00
Sebastian Redl
1ea025bef9
Add a little more data to chained PCHs. WIP
...
llvm-svn: 108528
2010-07-16 16:36:56 +00:00
Daniel Dunbar
01ad0a78d0
Suppress !+Asserts warning.
...
llvm-svn: 108480
2010-07-16 00:00:11 +00:00
Sebastian Redl
85b2a6a430
Add a callback interface that allows interested parties to get notified whenever PCHReader deserializes a type or decl (and possibly other things in the future). Have PCHWriter implement these callbacks as noops and register to receive them if we're chaining PCHs. This will allow PCHWriter to track the IDs of these things, which it needs to write the dependent files. WIP
...
llvm-svn: 108383
2010-07-14 23:45:08 +00:00
Benjamin Kramer
8d5609b604
Pass StringRefs by value.
...
llvm-svn: 108375
2010-07-14 23:19:41 +00:00
Sebastian Redl
409183ff7c
Increase the max PCH level for declarations to 7. Add a FromPCH flag to types.
...
llvm-svn: 108354
2010-07-14 20:26:45 +00:00
Sebastian Redl
75fbb3b5e5
Make PCHReader cope with PCH files containing more than one predefines buffer.
...
llvm-svn: 108340
2010-07-14 17:49:11 +00:00
Douglas Gregor
8ed0c0b99d
Introduce -f{no-}spell-checking options to enable/disable
...
spell-checking. By default, spell-checking is enabled for Clang
(obviously) but disabled in CIndex for performance reasons.
llvm-svn: 107992
2010-07-09 17:35:33 +00:00
Argyrios Kyrtzidis
7e8996c7e6
Introduce PCHReader::GetTranslationUnitDecl() and use it instead of ReadDeclRecord when initializing.
...
ReadDeclRecord would hit assertion if the translation unit declaration was already loaded during
IdentifierInfo initialization.
llvm-svn: 107885
2010-07-08 17:13:02 +00:00
Argyrios Kyrtzidis
a4ed18191c
For TagType and TemplateSpecializationType, isDependent calculation may be invalid because some decls that the
...
calculation is using may still be initializing.
Thus, store the isDependent flag to PCH and restore directly to Type.
llvm-svn: 107873
2010-07-08 13:09:53 +00:00
Argyrios Kyrtzidis
ad65c6926b
Fix broken reading of NestedNameSpecifiers from PCH.
...
llvm-svn: 107784
2010-07-07 15:46:30 +00:00
Argyrios Kyrtzidis
903ccd6121
Delay passing InterestingDecls to the Consumer until when we know we are not in recursive loading and the
...
declarations are fully initialized.
llvm-svn: 107783
2010-07-07 15:46:26 +00:00
Argyrios Kyrtzidis
af2eac2869
Add to PCH missing Sema information about VTable uses and dynamic classes.
...
llvm-svn: 107664
2010-07-06 15:37:04 +00:00
Argyrios Kyrtzidis
b5fcdc21c2
Fix a regression of a previous commit of mine (rdar://8158953).
...
Some of the invariant checks for creating Record/Enum types don't hold true during PCH reading.
Introduce more suitable ASTContext::getRecordType() and getEnumType().
llvm-svn: 107598
2010-07-04 21:44:47 +00:00
Argyrios Kyrtzidis
e862cbc5f6
Don't try to install the __[u]int128_t identifier if it is already installed by PCHReader.
...
Currently, adding it to visible decls of a PCH'ed translation unit has no effect because
adding visible decls before deserialization has no effect (the decls won't be visible).
This will be fixed in a future commit; then it will force deserialization of visible decls, so avoid pointlessly installing it.
llvm-svn: 107595
2010-07-04 21:44:19 +00:00
Argyrios Kyrtzidis
3701fcd759
Read/write CastExpr's CXXBaseSpecifierArray for PCH.
...
llvm-svn: 107542
2010-07-02 23:30:27 +00:00
Argyrios Kyrtzidis
2c2167ac3d
Fully read/write CXXRecordDecl for PCH.
...
llvm-svn: 107475
2010-07-02 11:55:32 +00:00
Argyrios Kyrtzidis
e929095f4a
Fix reading of DependentNameType.
...
llvm-svn: 107474
2010-07-02 11:55:24 +00:00
Argyrios Kyrtzidis
dab33c5d33
Allow reading of InjectedClassNameType from PCH even when its decl is currently initializing.
...
llvm-svn: 107473
2010-07-02 11:55:20 +00:00
Argyrios Kyrtzidis
ee776bcb7a
Fix broken reading of member pointer from PCH.
...
llvm-svn: 107472
2010-07-02 11:55:15 +00:00
Argyrios Kyrtzidis
45a83f9acc
- Allow a typedef type to be read from PCH even if its decl is currently initializing.
...
- Fix creation of TemplateSpecializationType.
llvm-svn: 107471
2010-07-02 11:55:11 +00:00
Argyrios Kyrtzidis
e3029a7e7b
Fix broken reading of "#lines" from PCH.
...
llvm-svn: 107470
2010-07-02 11:55:05 +00:00
Argyrios Kyrtzidis
4a57bd0d62
Support DependentSizedArrayType for PCH.
...
llvm-svn: 107267
2010-06-30 08:49:25 +00:00
Argyrios Kyrtzidis
d0795b2d78
Modify the way sub-statements are stored and retrieved from PCH.
...
Before this commit, sub-stmts were stored as encountered and when they were placed in the Stmts stack we had to know what index
each stmt operand has. This complicated supporting variable sub-stmts and sub-stmts that were contained in TypeSourceInfos, e.g.
x = sizeof(int[1]);
would crash PCH.
Now, sub-stmts are stored in reverse order, from last to first, so that when reading them, in order to get the next sub-stmt we just
need to pop the last stmt from the stack. This greatly simplified the way stmts are written and read (just use PCHWriter::AddStmt and
PCHReader::ReadStmt accordingly) and allowed variable stmt operands and TypeSourceInfo exprs.
llvm-svn: 107087
2010-06-28 22:28:35 +00:00
Argyrios Kyrtzidis
ddf5f211d0
Fix PCH emitting/reading for template arguments that contain expressions.
...
llvm-svn: 106996
2010-06-28 09:31:42 +00:00
Argyrios Kyrtzidis
0b0369a6b3
Fix various bugs in recent commits for C++ PCH.
...
llvm-svn: 106995
2010-06-28 09:31:34 +00:00
Chris Lattner
51924e517b
Implement support for -fwrapv, rdar://7221421
...
As part of this, pull together trapv handling into the same enum.
This also add support for NSW multiplies.
This also makes PCH disagreement on overflow behavior silent, since it
really doesn't matter except for warnings and codegen (no macros get
defined etc).
llvm-svn: 106956
2010-06-26 21:25:03 +00:00
Argyrios Kyrtzidis
f0f7a792d7
Support DependentTemplateSpecializationType and ElaboratedType for PCH.
...
llvm-svn: 106858
2010-06-25 16:24:58 +00:00
Argyrios Kyrtzidis
bfcacee9b3
Support a couple more C++ Exprs for PCH.
...
llvm-svn: 106727
2010-06-24 08:57:31 +00:00
Argyrios Kyrtzidis
818c5db054
Support C++ class template specializations and partial specializations for PCH.
...
llvm-svn: 106625
2010-06-23 13:48:30 +00:00