summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH
Commit message (Collapse)AuthorAgeFilesLines
...
* Read/write declaration attributes from/to PCH properly. Embed them in the ↵Argyrios Kyrtzidis2010-10-181-0/+23
| | | | | | | | | declaration block instead of trying to create another block. The new block was messing with the assumption that after decls block comes the stmts block. Fixes http://llvm.org/PR8406 llvm-svn: 116737
* Merge header & cpp for test/PCH/attrs.c - more convenient to keep the tests ↵Argyrios Kyrtzidis2010-10-182-10/+12
| | | | | | in one source file. llvm-svn: 116736
* When performing typo correction, look through the set of knownDouglas Gregor2010-10-142-0/+12
| | | | | | | | | | | | | | | | | | | | identifiers to determine good typo-correction candidates. Once we've identified those candidates, we perform name lookup on each of them and the consider the results. This optimization makes typo correction > 2x faster on a benchmark example using a single typo (NSstring) in a tiny file that includes Cocoa.h from a precompiled header, since we are deserializing far less information now during typo correction. There is a semantic change here, which is interesting. The presence of a similarly-named entity that is not visible can now affect typo correction. This is both good (you won't get weird corrections if the thing you wanted isn't in scope) and bad (you won't get good corrections if there is a similarly-named-but-completely-unrelated thing). Time will tell whether it was a good choice or not. llvm-svn: 116528
* Store in PCH the key function of C++ class to avoid deserializing the ↵Argyrios Kyrtzidis2010-10-141-0/+1
| | | | | | | | complete declaration context in order to compute it. Progress for rdar://7260160. llvm-svn: 116508
* Allow deserialization of just the fields of a record, when we want to ↵Argyrios Kyrtzidis2010-10-141-0/+19
| | | | | | | | | | | | | iterate over them, instead of deserializing the complete declaration context of the record. Iterating over the fields of a record is very common (e.g to determine the layout), unfortunately we needlessly deserialize every declaration that the declaration context of the record contains; this can be bad for large C++ classes that contain a lot of methods. Fix this by allow deserialization of just the fields when we want to iterate over them. Progress for rdar://7260160. llvm-svn: 116507
* Serialize the "inline" bit for namespaces. Fixes <rdar://problem/8515069>.Douglas Gregor2010-10-052-0/+7
| | | | llvm-svn: 115667
* Fix a marvelous chained AST writing bug, where we end up with theDouglas Gregor2010-10-053-0/+30
| | | | | | | | | | | | | | | | | | | | | | | following amusing sequence: - AST writing schedules writing a type X* that it had never seen before - AST writing starts writing another declaration, ends up deserializing X* from a prior AST file. Now we have two type IDs for the same type! - AST writer tries to write X*. It only has the lower-numbered ID from the the prior AST file, so references to the higher-numbered ID that was scheduled for writing go off into lalaland. To fix this, keep the higher-numbered ID so we end up writing the type twice. Since this issue occurs so rarely, and type records are generally rather small, I deemed this better than the alternative: to keep a separate mapping from the higher-numbered IDs to the lower-numbered IDs, which we would end up having to check whenever we want to deserialize any type. Fixes <rdar://problem/8511624>, I think. llvm-svn: 115647
* Register the __builtin_va_list_type node when we parse it, rather thanDouglas Gregor2010-10-052-0/+18
| | | | | | | | waiting until we think we need it: we didn't catch all of the places where we actually needed it, and we probably wouldn't ever. Fixes a C++ PCH crasher. llvm-svn: 115617
* When we insert a category (or class extension) into an interface, markDouglas Gregor2010-10-023-0/+24
| | | | | | | | the interface as having changed since it was originally serialized. This ensures that we see class extensions/categories in chained PCH files. llvm-svn: 115421
* Implement chained PCH support for the macro definitions stored withinDouglas Gregor2010-10-022-5/+5
| | | | | | the "detailed" preprocessing record. llvm-svn: 115417
* When an identifier that has a macro definition in the original PCHDouglas Gregor2010-10-013-1/+4
| | | | | | | file is somehow changed in a chained PCH file, make sure that we write out the macro definition. Fixes part of <rdar://problem/8499034>. llvm-svn: 115259
* Add test case I forgot for r115159 (support implicit includes along with PCH).Argyrios Kyrtzidis2010-10-013-0/+8
| | | | llvm-svn: 115247
* Fix C++ PCH issue.Argyrios Kyrtzidis2010-09-131-0/+5
| | | | | | | | The canonical FunctionTemplateDecl contains the specializations but we cannot use getCanonicalDecl on Template because it may still be initializing. Write and read it from PCH. Fixes http://llvm.org/PR8134 llvm-svn: 113744
* Fix a C++ PCH problem which was exposed by r113019. ↵Argyrios Kyrtzidis2010-09-062-0/+12
| | | | | | CXXBaseOrMemberInitializer's IsWritten and source order is not set. llvm-svn: 113161
* AST writer support for having specializations of templates from earlier in ↵Sebastian Redl2010-08-243-2/+23
| | | | | | the chain. This ought to finish C++ chained PCH support. llvm-svn: 111986
* Add testcase for C++ chained PCH and fix the bugs it uncovered in name lookup.Sebastian Redl2010-08-243-0/+58
| | | | llvm-svn: 111882
* Fix an issue with writing to PCH another included PCH, introduced by the ↵Argyrios Kyrtzidis2010-08-203-0/+13
| | | | | | | | | | | "using an AST on-disk hash table for name lookup" commit. When including a PCH and later re-emitting to another PCH, the name lookup tables of DeclContexts may be incomplete, since we now lazily deserialize the visible decls of a particular name. Fix the issue by iterating over the un-deserialized visible decls and completing the lookup tables of DeclContexts before writing them out. llvm-svn: 111698
* Instead of modifying the ObjC AST to not modify existing declarations, teach ↵Sebastian Redl2010-08-132-0/+19
| | | | | | chained PCH to overwrite declarations from earlier PCH files in dependent ones. Tell Sema to note when it changes AST nodes so that they have to be reserialized. Finally, the ObjCProtocolDecls created in forward decls, like the ObjCInterfaceDecls in @class forward decls, are not lexically part of the decl context; only the definition is. llvm-svn: 110989
* -Make TokenID of IdentifierInfo read-only, remove setTokenID().Argyrios Kyrtzidis2010-08-112-0/+19
| | | | | | | | -There are 2 instances that change the TokenID for GNU libstdc++ 4.2 compatibility. To handler those cases introduce a RevertedTokenID bitfield, RevertTokenIDToIdentifier() and hasRevertedTokenIDToIdentifier() methods. Store the bitfield in PCH. llvm-svn: 110868
* tests: Add a missing -Xclang.Daniel Dunbar2010-08-111-1/+1
| | | | llvm-svn: 110776
* tests: Avoid unnecessary redirection.Daniel Dunbar2010-08-101-2/+2
| | | | llvm-svn: 110709
* tests: Tests which include system headers must use the driver, not -cc1.Daniel Dunbar2010-08-101-3/+3
| | | | llvm-svn: 110708
* Remove a FIXME.Argyrios Kyrtzidis2010-08-091-4/+3
| | | | llvm-svn: 110571
* Complete PCH support for ObjCPropertyImplDecl.Argyrios Kyrtzidis2010-08-092-1/+11
| | | | llvm-svn: 110570
* Support ObjC implementation decls for PCH.Argyrios Kyrtzidis2010-08-092-0/+20
| | | | | | Strictly speaking, implementations don't go in headers but there's no law against it. llvm-svn: 110567
* Store the pending implicit instantiations in the PCH and perform them at the ↵Argyrios Kyrtzidis2010-08-052-0/+14
| | | | | | | | end of the translation unit that included the PCH, as God intended. llvm-svn: 110324
* Support #pragma weak for PCH.Argyrios Kyrtzidis2010-08-052-0/+20
| | | | llvm-svn: 110323
* Make sure C++ variable definitions are actually passed to the consumer when ↵Argyrios Kyrtzidis2010-08-052-0/+3
| | | | | | loaded from PCH. llvm-svn: 110322
* Activate selectors in chained PCH. Chained PCH now works for Objective-C.Sebastian Redl2010-08-043-0/+47
| | | | llvm-svn: 110262
* Apart from storing/retrieving the previous redeclaration from PCH, also ↵Argyrios Kyrtzidis2010-08-032-2/+17
| | | | | | | | | | | | store/retrieve the most recent redeclaration. That way we are sure that the full redeclarations chain is loaded. When using chained PCHs, first declarations point to the most recent redeclarations in the same PCH. To address this use a REDECLS_UPDATE_LATEST record block to keep track of which first declarations need to point to a most recent redeclaration in another PCH. llvm-svn: 110125
* Query only the latest version of an identifier in the PCH chain. Make sure ↵Sebastian Redl2010-08-023-1/+20
| | | | | | this version holds the entire declaration chain. This is a much saner solution than trying to merge the info from all elements, and makes redeclarations work properly. Expand the declarations test case to cover more compliated cases. llvm-svn: 110052
* Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr ↵Argyrios Kyrtzidis2010-08-022-0/+12
| | | | | | for them that will deserialize them when needed. llvm-svn: 110031
* Correctly deal with using names for both functions and structs in chained PCH.Sebastian Redl2010-07-306-14/+31
| | | | llvm-svn: 109871
* Make macro weirdness in chained PCH work. This required changing the way ↵Sebastian Redl2010-07-303-0/+21
| | | | | | PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now. llvm-svn: 109823
* Weak references and variables that are not definitions are not required for ↵Argyrios Kyrtzidis2010-07-291-0/+7
| | | | | | early codegen/deserialization. llvm-svn: 109796
* Implement PCH support for offsetof(base-specifier).Argyrios Kyrtzidis2010-07-292-0/+7
| | | | llvm-svn: 109785
* Merge PCHWriterDecl.cpp's isRequiredDecl and ↵Argyrios Kyrtzidis2010-07-292-0/+4
| | | | | | | | | | | | | | | CodeGenModule::MayDeferGeneration into a new function, DeclIsRequiredFunctionOrFileScopedVar. This is essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes. Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext, thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen. This fixes current (and avoids future) codegen-from-PCH bugs. llvm-svn: 109784
* Support extended vector types in chained PCH.Sebastian Redl2010-07-283-0/+17
| | | | llvm-svn: 109675
* Add a test case for tentative definitions in chained PCH. Fix a bug that ↵Sebastian Redl2010-07-283-0/+78
| | | | | | completely messed up source locations and thus caused a crash whenever a diagnostic was emitted in chained PCH files. llvm-svn: 109660
* Add PTH test case for <rdar://problem/8227989>.Ted Kremenek2010-07-272-0/+19
| | | | llvm-svn: 109555
* Record macros in dependent PCHs. Also add various info tables to dependent ↵Sebastian Redl2010-07-273-0/+11
| | | | | | PCHs; tests for this to follow. llvm-svn: 109554
* Revert r109546, it broke linux build.Argyrios Kyrtzidis2010-07-272-4/+0
| | | | llvm-svn: 109550
* Merge PCHWriterDecl.cpp's isRequiredDecl and ↵Argyrios Kyrtzidis2010-07-272-0/+4
| | | | | | | | | | | | CodeGenModule::MayDeferGeneration into a new function, DeclIsRequiredFunctionOrFileScopedVar. This function is part of the public CodeGen interface since it's essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes. This fixes current (and avoids future) codegen-from-PCH bugs. llvm-svn: 109546
* Update the list of lexical decls in the TU for chained PCHs. This makes ↵Sebastian Redl2010-07-271-0/+4
| | | | | | -ast-print show the decls from the dependent PCH. llvm-svn: 109524
* Always deserialize from PCH file scoped variables with non trivial ↵Argyrios Kyrtzidis2010-07-272-0/+15
| | | | | | | | constructor/destructor. Fixes http://llvm.org/PR7692 llvm-svn: 109501
* Introduce basic support for loading a precompiled preamble whileDouglas Gregor2010-07-262-0/+22
| | | | | | | | | | | | | | | | | | | | | | | reparsing an ASTUnit. When saving a preamble, create a buffer larger than the actual file we're working with but fill everything from the end of the preamble to the end of the file with spaces (so the lexer will quickly skip them). When we load the file, create a buffer of the same size, filling it with the file and then spaces. Then, instruct the lexer to start lexing after the preamble, therefore continuing the parse from the spot where the preamble left off. It's now possible to perform a simple preamble build + parse (+ reparse) with ASTUnit. However, one has to disable a bunch of checking in the PCH reader to do so. That part isn't committed; it will likely be handled with some other kind of flag (e.g., -fno-validate-pch). As part of this, fix some issues with null termination of the memory buffers created for the preamble; we were trying to explicitly NULL-terminate them, even though they were also getting implicitly NULL terminated, leading to excess warnings about NULL characters in source files. llvm-svn: 109445
* Make declarations in the dependent PCH visible, for C at least.Sebastian Redl2010-07-233-0/+10
| | | | llvm-svn: 109292
* Test for selector-warning PCH patch.Fariborz Jahanian2010-07-232-0/+43
| | | | | | radar 6507158. llvm-svn: 109261
* Thread bitstream cursors all the way through the AST reading stuff. This ↵Sebastian Redl2010-07-223-0/+4
| | | | | | way, reading a trivial 2-element chained file actually works. llvm-svn: 109191
* Read/write C++0x static_assert for PCH.Argyrios Kyrtzidis2010-07-222-0/+20
| | | | llvm-svn: 109123
OpenPOWER on IntegriCloud