aboutsummaryrefslogtreecommitdiff
path: root/clang/test/PCH/Inputs
AgeCommit message (Collapse)AuthorFilesLines
2013-05-30Objective-C: Implements gcc's -Wselector optionFariborz Jahanian1-1/+1
which diagnoses type mismatches of identical selectors declared in classes throughout. // rdar://14007194 llvm-svn: 182964
2012-11-28Store on the CXXRecordDecl whether the class has, or would have, a copyRichard Smith1-0/+3
constructor/assignment operator with a const-qualified parameter type. The prior method for determining this incorrectly used overload resolution. llvm-svn: 168775
2012-10-31[PCH] Remove the stat cache from the PCH file.Argyrios Kyrtzidis1-0/+5
The stat cache became essentially useless ever since we started validating all file entries in the PCH. But the motivating reason for removing it now is that it also affected correctness in this situation: -You have a header without include guards (using "#pragma once" or #import) -When creating the PCH: -The same header is referenced in an #include with different filename cases. -In the PCH, of course, we record only one file entry for the header file -But we cache in the PCH file the stat info for both filename cases -Then the source files are updated and the header file is updated in a way that its size and modification time are the same but its inode changes -When using the PCH: -We validate the headers, we check that header file and we create a file entry with its current inode -There's another #include with a filename with different case than the previously created file entry -In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode -because of the different inodes, we think they are different files so we go ahead and include its contents. Removing the stat cache will potentially break clients that are attempting to use the stat cache as a way of avoiding having the actual input files available. If that use case is important, patches are welcome to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with literal strings, line/column computations, etc.). This fixes rdar://5502805 llvm-svn: 167172
2012-10-25Move the input files for test/PCH/badpch.c under test/PCH/Inputs/.Kaelyn Uhrain2-0/+0
llvm-svn: 166711
2012-10-09Rework the (de-)serialization of macros, as stored inDouglas Gregor2-0/+7
MacroInfo*. Instead of simply dumping an offset into the current file, give each macro definition a proper ID with all of the standard modules-remapping facilities. Additionally, when a macro is modified in a subsequent AST file (e.g., #undef'ing a macro loaded from another module or from a precompiled header), provide a macro update record rather than rewriting the entire macro definition. This gives us greater consistency with the way we handle declarations, and ties together macro definitions much more cleanly. Note that we're still not actually deserializing macro history (we never were), but it's far easy to do properly now. llvm-svn: 165560
2012-10-02Added a test for C++11 statement attributes serialization.Alexander Kornienko1-0/+14
Summary: Uses [[clang::fallthrough]] attribute in a template function, and -Wimplicit-fallthrough to check the attribute presence in an instantiation. Reviewers: rsmith Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D55 llvm-svn: 165068
2012-07-01PR13189: va_list broken with precompiled headersMeador Inge1-0/+5
For some targets a structure named __va_list_tag is built to help define the __builtin_va_list type. However, __va_list_tag was not being treated as a predefined type thus causing problems when serializing the AST. This commit fixes that oversight by adding the necessary support to treat __va_list_tag as a predefined type. llvm-svn: 159508
2011-12-19objc-arc: bridge casts in non-arc mode are nowFariborz Jahanian1-2/+8
error. // rdar://10597832 llvm-svn: 146918
2011-08-30When writing out the entries in a lookup table for a DeclContext, makeDouglas Gregor1-0/+6
sure that all of the CXXConversionDecls go into the same bucket. Otherwise, name lookup might not find them all. Fixes <rdar://problem/10041960>. llvm-svn: 138824
2011-06-28Add support for C++ namespace-aware typo correction, e.g., correctingDouglas Gregor1-0/+8
vector<int> to std::vector<int> Patch by Kaelyn Uhrain, with minor tweaks + PCH support from me. Fixes PR5776/<rdar://problem/8652971>. Thanks Kaelyn! llvm-svn: 134007
2011-06-15Automatic Reference Counting.John McCall1-0/+20
Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
2011-03-08When writing file references in a pch, make sure to ask the file manager for ↵Anders Carlsson1-0/+5
the absolute path. llvm-svn: 127248
2010-10-19Putting back safe fixes 116836,116837,116838Andrew Trick2-51/+0
llvm-svn: 116866
2010-10-19Reverting 116836,116837,116838 until we resolve the getLangStandardForKind ↵Andrew Trick2-0/+51
failures. llvm-svn: 116859
2010-10-19Merge headers into test/PCH/chain-cxx.cpp for convenience.Argyrios Kyrtzidis2-51/+0
llvm-svn: 116836
2010-10-14When performing typo correction, look through the set of knownDouglas Gregor1-0/+6
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
2010-10-05Serialize the "inline" bit for namespaces. Fixes <rdar://problem/8515069>.Douglas Gregor1-0/+4
llvm-svn: 115667
2010-10-05Fix a marvelous chained AST writing bug, where we end up with theDouglas Gregor2-0/+18
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
2010-10-05Register the __builtin_va_list_type node when we parse it, rather thanDouglas Gregor1-0/+2
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
2010-10-02When we insert a category (or class extension) into an interface, markDouglas Gregor2-0/+8
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
2010-10-01When an identifier that has a macro definition in the original PCHDouglas Gregor2-0/+2
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
2010-08-24AST writer support for having specializations of templates from earlier in ↵Sebastian Redl2-1/+17
the chain. This ought to finish C++ chained PCH support. llvm-svn: 111986
2010-08-24Add testcase for C++ chained PCH and fix the bugs it uncovered in name lookup.Sebastian Redl2-0/+35
llvm-svn: 111882
2010-08-04Activate selectors in chained PCH. Chained PCH now works for Objective-C.Sebastian Redl2-0/+23
llvm-svn: 110262
2010-08-02Query only the latest version of an identifier in the PCH chain. Make sure ↵Sebastian Redl2-0/+14
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
2010-07-30Correctly deal with using names for both functions and structs in chained PCH.Sebastian Redl4-2/+9
llvm-svn: 109871
2010-07-30Make macro weirdness in chained PCH work. This required changing the way ↵Sebastian Redl2-0/+8
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
2010-07-28Support extended vector types in chained PCH.Sebastian Redl2-0/+6
llvm-svn: 109675
2010-07-28Add a test case for tentative definitions in chained PCH. Fix a bug that ↵Sebastian Redl2-0/+24
completely messed up source locations and thus caused a crash whenever a diagnostic was emitted in chained PCH files. llvm-svn: 109660
2010-07-27Record macros in dependent PCHs. Also add various info tables to dependent ↵Sebastian Redl2-0/+2
PCHs; tests for this to follow. llvm-svn: 109554
2010-07-26Introduce basic support for loading a precompiled preamble whileDouglas Gregor1-0/+1
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
2010-07-23Make declarations in the dependent PCH visible, for C at least.Sebastian Redl2-0/+2
llvm-svn: 109292
2010-07-22Thread bitstream cursors all the way through the AST reading stuff. This ↵Sebastian Redl2-0/+0
way, reading a trivial 2-element chained file actually works. llvm-svn: 109191
2010-05-07add PCH support for a bunch of C++ Decls, patch byChris Lattner1-0/+27
Andrew Sutton! llvm-svn: 103301
2010-02-24Add PCH test for C++ namespaces, missing from a previous commitDouglas Gregor1-0/+13
llvm-svn: 97061