aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHReader.cpp
AgeCommit message (Collapse)Author
2010-07-16Add a little more data to chained PCHs. WIPSebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16Suppress !+Asserts warning.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14Add a callback interface that allows interested parties to get notified ↵Sebastian Redl
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108383 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14Pass StringRefs by value.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108375 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14Increase the max PCH level for declarations to 7. Add a FromPCH flag to types.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108354 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14Make PCHReader cope with PCH files containing more than one predefines buffer.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108340 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09Introduce -f{no-}spell-checking options to enable/disableDouglas Gregor
spell-checking. By default, spell-checking is enabled for Clang (obviously) but disabled in CIndex for performance reasons. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107992 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08Introduce PCHReader::GetTranslationUnitDecl() and use it instead of ↵Argyrios Kyrtzidis
ReadDeclRecord when initializing. ReadDeclRecord would hit assertion if the translation unit declaration was already loaded during IdentifierInfo initialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107885 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08For TagType and TemplateSpecializationType, isDependent calculation may be ↵Argyrios Kyrtzidis
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07Fix broken reading of NestedNameSpecifiers from PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107784 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07Delay passing InterestingDecls to the Consumer until when we know we are not ↵Argyrios Kyrtzidis
in recursive loading and the declarations are fully initialized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107783 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06Add to PCH missing Sema information about VTable uses and dynamic classes.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-04Fix a regression of a previous commit of mine (rdar://8158953).Argyrios Kyrtzidis
Some of the invariant checks for creating Record/Enum types don't hold true during PCH reading. Introduce more suitable ASTContext::getRecordType() and getEnumType(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107598 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-04Don't try to install the __[u]int128_t identifier if it is already installed ↵Argyrios Kyrtzidis
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Read/write CastExpr's CXXBaseSpecifierArray for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107542 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Fully read/write CXXRecordDecl for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107475 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Fix reading of DependentNameType.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107474 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Allow reading of InjectedClassNameType from PCH even when its decl is ↵Argyrios Kyrtzidis
currently initializing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Fix broken reading of member pointer from PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02- Allow a typedef type to be read from PCH even if its decl is currently ↵Argyrios Kyrtzidis
initializing. - Fix creation of TemplateSpecializationType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02Fix broken reading of "#lines" from PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-30Support DependentSizedArrayType for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107267 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-28Modify the way sub-statements are stored and retrieved from PCH.Argyrios Kyrtzidis
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107087 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-28Fix PCH emitting/reading for template arguments that contain expressions.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-28Fix various bugs in recent commits for C++ PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-26Implement support for -fwrapv, rdar://7221421Chris Lattner
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-25Support DependentTemplateSpecializationType and ElaboratedType for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24Support a couple more C++ Exprs for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106727 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-23Support C++ class template specializations and partial specializations for PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106625 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-23improve altivec vector bool/pixel support, patch by Anton YartsevChris Lattner
with several tweaks by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106619 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22-Introduce PCHReader::ReadTemplateArgumentLoc()Argyrios Kyrtzidis
-Introduce PCHWriter::AddTemplateArgumentLocInfo() -Modify PCHWriter::AddTemplateArgumentLoc() to also write TemplateArgumentLoc's TemplateArgument and move the existing calls of AddTemplateArgumentLoc() to AddTemplateArgumentLocInfo(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106533 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-19Initial support for reading templates from PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106392 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-19Initial support for writing templates to PCH.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106391 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11Split DependentNameType into two types. DependentNameType represents theJohn McCall
case of an elaborated-type-specifier like 'typename A<T>::foo', and DependentTemplateSpecializationType represents the case of an elaborated-type-specifier like 'typename A<T>::template B<T>'. The TypeLoc representation of a DependentTST conveniently exactly matches that of an ElaboratedType wrapping a TST. Kill off the explicit rebuild methods for RebuildInCurrentInstantiation; the standard implementations work fine because the nested name specifier is computable in the newly-entered context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105801 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-02Fix undefined behavior, noticed by GCC 4.5. Patch by Dimitry Andric!Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105329 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-01Alter the ExternalASTSource interface to permit by-name lookups. PCH ↵John McCall
continues to bring in the entire lookup table at once. Also, give ExternalSemaSource's vtable a home. This is important because otherwise any reference to it will cause RTTI to be emitted, and since clang is compiled with -fno-rtti, that RTTI will contain unresolved references (to ExternalASTSource's RTTI). So this change makes it possible to subclass ExternalSemaSource from projects compiled with RTTI, as long as the subclass's home is compiled with -fno-rtti. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-19Added basic source locations to Elaborated and DependentName types.Abramo Bagnara
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104169 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-15Substantially alter the design of the Objective C type AST by introducingJohn McCall
ObjCObjectType, which is basically just a pair of one of {primitive-id, primitive-Class, user-defined @class} with a list of protocols. An ObjCObjectPointerType is therefore just a pointer which always points to one of these types (possibly sugared). ObjCInterfaceType is now just a kind of ObjCObjectType which happens to not carry any protocols. Alter a rather large number of use sites to use ObjCObjectType instead of ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather than hashing them in a FoldingSet. Remove some number of methods that are no longer used, at least after this patch. By simplifying ObjCObjectPointerType, we are now able to easily remove and apply pointers to Objective-C types, which is crucial for a certain kind of ObjC++ metaprogramming common in WebKit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103870 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-14Revert r103770, "Added basic source locations to Elaborated and DependentNameDaniel Dunbar
types.", it is breaking Clang bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103775 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-14Added basic source locations to Elaborated and DependentName types.Abramo Bagnara
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103770 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11Merged Elaborated and QualifiedName types.Abramo Bagnara
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103517 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10pchify CXXTemporary, CXXBindTemporaryExpr, and Chris Lattner
CXXExprWithTemporaries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103387 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07add PCH support for a bunch of C++ Decls, patch byChris Lattner
Andrew Sutton! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103301 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-23More work toward implementingFariborz Jahanian
NeXt's -fno-constant-cfstrings - wip. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102189 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22Check for -fno-constant-cfstrings consistencyFariborz Jahanian
in pch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are notChandler Carruth
implemented precisely the same as GCC, but the distinction GCC makes isn't useful to represent. This allows parsing code which uses GCC-specific keywords ('asm', etc.) without parsing in a fully GNU mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09On Windows, disable the modification-time check for files used inDouglas Gregor
precompiled headers and/or when reading the contents of the file into memory. These checks seem to be causing spurious regression-test failures on Windows. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100866 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06Make code-completion for Objective-C message sends to "id" work in theDouglas Gregor
presence of precompiled headers by forcibly loading all of the methods we know about from the PCH file before constructing our code-completion list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05Match MemoryBuffer API changes.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100484 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31Rename TypenameType to DependentNameType in anticipation of someDouglas Gregor
refactoring work in this area. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100019 91177308-0d34-0410-b5e6-96231b3b80d8