summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH
Commit message (Collapse)AuthorAgeFilesLines
...
* [PCH] Now that we store the location of a decl outside its recordArgyrios Kyrtzidis2011-10-311-0/+22
| | | | | | make sure that we keep track of locations of replaced decls as well. llvm-svn: 143341
* Disable on Windows, for real.Douglas Gregor2011-10-261-2/+1
| | | | llvm-svn: 143027
* Implement support for dependent Microsoft __if_exists/__if_not_existsDouglas Gregor2011-10-251-0/+29
| | | | | | | | | | statements. As noted in the documentation for the AST node, the semantics of __if_exists/__if_not_exists are somewhat different from the way Visual C++ implements them, because our parsed-template representation can't accommodate VC++ semantics without serious contortions. Hopefully this implementation is "good enough". llvm-svn: 142901
* [PCH] When serializing Stmts, keep track of when sub statements are ↵Argyrios Kyrtzidis2011-10-212-0/+49
| | | | | | | | | | | | referenced again and in such a case just write out a reference of a previously serialized Stmt, instead of serializing it all over again. This saves memory + space + [de]serializing time, and avoids blowing up memory with pathological cases. rdar://10293911 llvm-svn: 142696
* Really protect from infinite loop when there are objc method redeclarations.Argyrios Kyrtzidis2011-10-141-0/+5
| | | | | | Serialization part will come later. llvm-svn: 141950
* Keep track of objc method redeclarations in the same interface.Argyrios Kyrtzidis2011-10-141-0/+13
| | | | | | Avoid possible infinite loop when iterating over an ObjCMethod's redeclarations. llvm-svn: 141946
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-1310-31/+31
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* Add a simple PCH test for _Atomic.Eli Friedman2011-10-072-4/+7
| | | | llvm-svn: 141409
* Make -fobjc-nonfragile-abi the -cc1 default, since it's theJohn McCall2011-10-021-6/+6
| | | | | | | | | | | | | | | | | | | increasingly prevailing case to the point that new features like ARC don't even support the fragile ABI anymore. This required a little bit of reshuffling with exceptions because a check was assuming that ObjCNonFragileABI was only being set in ObjC mode, and that's actually a bit obnoxious to do. Most, though, it involved a perl script to translate a ton of test cases. Mostly no functionality change for driver users, although there are corner cases with disabling language-specific exceptions that we should handle more correctly now. llvm-svn: 140957
* [libclang] When getting a source location from a file:line:col tripletArgyrios Kyrtzidis2011-09-191-2/+4
| | | | | | | check whether the requested location points inside the precompiled preamble, in which case the returned source location will be a "loaded" one. llvm-svn: 140060
* Disable this test on win32. My "sleep 2" trick didn't seem to workDouglas Gregor2011-09-141-1/+2
| | | | llvm-svn: 139729
* Refactoring, mostly to give ObjCPropertyDecls stronger invariants forJohn McCall2011-09-131-1/+1
| | | | | | their semantic attributes and then to take advantage of that. llvm-svn: 139615
* Switch the serialization of LangOptions over to use the .def file. WeDouglas Gregor2011-09-131-2/+2
| | | | | | | should no longer have the serialization of LangOptions out of sync with the structure itself (yay). llvm-svn: 139613
* Treat the weak export of block runtime symbols as a deployment-targetJohn McCall2011-09-092-58/+0
| | | | | | | | feature akin to the ARC runtime checks. Removes a terrible hack where IR gen needed to find the declarations of those symbols in the translation unit. llvm-svn: 139404
* Do a lookup for the blocks runtime globals to see if they were declared,Argyrios Kyrtzidis2011-09-092-0/+58
| | | | | | | | | instead of codegen waiting to consume such a declaration, which won't happen if that decls are coming from a PCH. Fixes rdar://10028656. llvm-svn: 139359
* Add some delay between PCH creation and modifying one of the headers it ↵Douglas Gregor2011-09-081-0/+1
| | | | | | depends on, which will---hopefully make this test predictably pass on Windows llvm-svn: 139327
* Implement the Objective-C 'instancetype' type, which is an alias ofDouglas Gregor2011-09-082-2/+2
| | | | | | | | | | 'id' that can be used (only!) via a contextual keyword as the result type of an Objective-C message send. 'instancetype' then gives the method a related result type, which we have already been inferring for a variety of methods (new, alloc, init, self, retain). Addresses <rdar://problem/9267640>. llvm-svn: 139275
* Finish implementing (de-)serialization of the CXXDefinitionData bitsDouglas Gregor2011-09-061-0/+23
| | | | | | | needed for implicit move constructors and move assignment operators. Fixes PR10847. llvm-svn: 139144
* Support importing of ObjC categories from modules.Argyrios Kyrtzidis2011-09-011-0/+51
| | | | | | | | | | | | The initial incentive was to fix a crash when PCH chaining categories to an interface, but the fix was done in the "modules way" that I hear is popular with the kids these days. Each module stores the local chain of categories and we combine them when the interface is loaded. We also warn if non-dependent modules introduce duplicate named categories. llvm-svn: 138926
* When writing out the entries in a lookup table for a DeclContext, makeDouglas Gregor2011-08-302-5/+12
| | | | | | | | 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
* Eliminate the -chained-pch flag and all of the frontend and libclang options ↵Douglas Gregor2011-08-259-9/+9
| | | | | | associated with it. Chained PCH is the only way to build a PCH file that includes another PCH file llvm-svn: 138597
* Remove a bogus assertion from the AST reader, which assumed thatDouglas Gregor2011-08-251-0/+61
| | | | | | | | | | redeclarations of a particular entity would occur in source order. Friend declarations that occur within class templates (or member classes thereof) do not follow this, nor would modules. Big thanks to Erik Verbruggen for reducing this problem from the Very Large Qt preamble testcase he found. llvm-svn: 138557
* Add serialization support for ClassScopeFunctionSpecializationDecl.Francois Pichet2011-08-172-0/+42
| | | | llvm-svn: 137799
* Change the hashing function for DeclContext lookup within an AST fileDouglas Gregor2011-08-021-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | by eliminating the type ID from constructor, destructor, and conversion function names. There are several reasons for this change: - A given type (say, int*) isn't guaranteed to have a single, unique type ID within a chain of PCH files. Hence, we could end up hashing based on the wrong type ID, causing name lookup to fail. - The mapping from types back to type IDs required one DenseMap entry for every type that was ever deserialized, which was an unacceptable cost to support just the name lookup of constructors, destructors, and conversion functions. Plus, this mapping could never actually work with chained or multiple PCH, based on the first bullet. Once we have eliminated the type from the hash function, these problems go away, as does my horrible "reverse type remap" hack, which was doomed from the start (see bullet #1 above) and far too complicated. However, note that removing the type from the hash function means that all constructors, destructors, and conversion functions have the same hash key, so I've updated the caller to double-check that the declarations found have the appropriate name. llvm-svn: 136708
* Fix an inconsistency in Sema::ConvertArgumentsForCall in thatPeter Collingbourne2011-07-291-1/+1
| | | | | | | the callee note diagnostic was not emitted in the case where there were too few arguments. llvm-svn: 136437
* Fix diagnostic when loading a PCH which has different enabled/disabled state ↵Argyrios Kyrtzidis2011-07-211-2/+10
| | | | | | of -fobjc-arc. rdar://9818341 llvm-svn: 135707
* Revamp the SourceManager to separate the representation of parsedDouglas Gregor2011-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | source locations from source locations loaded from an AST/PCH file. Previously, loading an AST/PCH file involved carefully pre-allocating space at the beginning of the source manager for the source locations and FileIDs that correspond to the prefix, and then appending the source locations/FileIDs used for parsing the remaining translation unit. This design forced us into loading PCH files early, as a prefix, whic has become a rather significant limitation. This patch splits the SourceManager space into two parts: for source location "addresses", the lower values (growing upward) are used to describe parsed code, while upper values (growing downward) are used for source locations loaded from AST/PCH files. Similarly, positive FileIDs are used to describe parsed code while negative FileIDs are used to file/macro locations loaded from AST/PCH files. As a result, we can load PCH/AST files even during parsing, making various improvemnts in the future possible, e.g., teaching #include <foo.h> to look for and load <foo.h.gch> if it happens to be already available. This patch was originally written by Sebastian Redl, then brought forward to the modern age by Jonathan Turner, and finally polished/finished by me to be committed. llvm-svn: 135484
* Make the Preprocessor more memory efficient and improve macro instantiation ↵Argyrios Kyrtzidis2011-07-072-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostics. When a macro instantiation occurs, reserve a SLocEntry chunk with length the full length of the macro definition source. Set the spelling location of this chunk to point to the start of the macro definition and any tokens that are lexed directly from the macro definition will get a location from this chunk with the appropriate offset. For any tokens that come from argument expansion, '##' paste operator, etc. have their instantiation location point at the appropriate place in the instantiated macro definition (the argument identifier and the '##' token respectively). This improves macro instantiation diagnostics: Before: t.c:5:9: error: invalid operands to binary expression ('struct S' and 'int') int y = M(/); ^~~~ t.c:5:11: note: instantiated from: int y = M(/); ^ After: t.c:5:9: error: invalid operands to binary expression ('struct S' and 'int') int y = M(/); ^~~~ t.c:3:20: note: instantiated from: \#define M(op) (foo op 3); ~~~ ^ ~ t.c:5:11: note: instantiated from: int y = M(/); ^ The memory savings for a candidate boost library that abuses the preprocessor are: - 32% less SLocEntries (37M -> 25M) - 30% reduction in PCH file size (900M -> 635M) - 50% reduction in memory usage for the SLocEntry table (1.6G -> 800M) llvm-svn: 134587
* Add support for C++ namespace-aware typo correction, e.g., correctingDouglas Gregor2011-06-282-0/+25
| | | | | | | | | | | | | | | 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
* Automatic Reference Counting.John McCall2011-06-152-0/+29
| | | | | | | | | | 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
* Implement support for C++11 in-class initialization of non-static data members.Richard Smith2011-06-111-0/+22
| | | | llvm-svn: 132878
* Implement Objective-C Related Result Type semantics.Douglas Gregor2011-06-112-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Related result types apply Cocoa conventions to the type of message sends and property accesses to Objective-C methods that are known to always return objects whose type is the same as the type of the receiving class (or a subclass thereof), such as +alloc and -init. This tightens up static type safety for Objective-C, so that we now diagnose mistakes like this: t.m:4:10: warning: incompatible pointer types initializing 'NSSet *' with an expression of type 'NSArray *' [-Wincompatible-pointer-types] NSSet *array = [[NSArray alloc] init]; ^ ~~~~~~~~~~~~~~~~~~~~~~ /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1: note: instance method 'init' is assumed to return an instance of its receiver type ('NSArray *') - (id)init; ^ It also means that we get decent type inference when writing code in Objective-C++0x: auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil]; // ^ now infers NSMutableArray* rather than id llvm-svn: 132868
* Start fixing up clang tests to work on the clang-native-arm-cortex-a9 builder.Eli Friedman2011-06-061-1/+1
| | | | llvm-svn: 132691
* Revert r132426; this test passes more often than not, and we don't have a ↵Eli Friedman2011-06-021-1/+0
| | | | | | way to mark tests as intermittently failing at the moment. llvm-svn: 132446
* XFAIL the test on windows.Argyrios Kyrtzidis2011-06-011-0/+1
| | | | llvm-svn: 132426
* [PCH] Be conservative and check all the files the PCH references to see ifArgyrios Kyrtzidis2011-06-011-0/+11
| | | | | | | | a file was modified since the time the PCH was created. The parser is not fit to deal with stale PCHs, too many invariants do not hold up. rdar://9530587. llvm-svn: 132389
* Update our diagnostics to properly account for move operations.Alexis Hunt2011-05-251-1/+1
| | | | llvm-svn: 132096
* Implement a few basic tests for defaulted and deleted functions.Alexis Hunt2011-05-131-0/+23
| | | | | | | More comprehensive testing once copy {constructors,assignment operators} can be defaulted. llvm-svn: 131275
* Implement support for C++0x alias templates.Richard Smith2011-05-052-0/+31
| | | | llvm-svn: 130953
* there i fixed itAlexis Hunt2011-05-042-11/+13
| | | | | | | | | Increase robustness of the delegating constructor cycle detection mechanism. No more infinite loops on invalid or logic errors leading to false results. Ensure that this is maintained correctly accross serialization. llvm-svn: 130887
* Change test/PCH/cxx-static_assert.cpp so that it doesn't need a separate header.Argyrios Kyrtzidis2011-05-042-12/+12
| | | | llvm-svn: 130839
* Implement a better version of delegating constructor cycle detection.Alexis Hunt2011-05-042-2/+6
| | | | | | | | | | | | | This is more efficient as it's all done at once at the end of the TU. This could still get expensive, so a flag is provided to disable it. As an added bonus, the diagnostics will now print out a cycle. The PCH test is XFAILed because we currently can't deal with a note emitted in the header and I, being tired, see no other way to verify the serialization of delegating constructors. We should probably address this problem /somehow/ but no good solution comes to mind. llvm-svn: 130836
* Implement serialization of delegating constructors.Alexis Hunt2011-05-042-0/+14
| | | | llvm-svn: 130822
* Fixed test case asserts due to checkin of r130710.Chad Rosier2011-05-022-6/+6
| | | | llvm-svn: 130720
* lib/Frontend/InitHeaderSearch.cpp: Tweak AddPath() to accept "/foo/bar" (not ↵NAKAMURA Takumi2011-05-021-1/+1
| | | | | | | "X:\foo\bar") with -isysroot. test/PCH/reloc.c can pass. FIXME: We should consider better isysroot scheme on Win32 hosts. llvm-svn: 130683
* Add a decl update when a static data member of a class template is ↵Sebastian Redl2011-04-291-0/+20
| | | | | | instantiated in a different PCH than its containing class. Otherwise we get double definition errors. Fixes a Boost.MPL problem that affects Boost.Accumulators and probably a lot more of Boost. llvm-svn: 130488
* Use -emit-llvm-only as suggested by Argyrios.Sebastian Redl2011-04-291-2/+2
| | | | llvm-svn: 130486
* Because of r130359 this test no longer fail on Windows.Francois Pichet2011-04-281-3/+0
| | | | llvm-svn: 130370
* Fix modified-header-crash.c for read-only source treesMatt Beaumont-Gay2011-04-281-2/+3
| | | | llvm-svn: 130359
* Disable a test that fails on windows; for some reason we don't detect that ↵Argyrios Kyrtzidis2011-04-261-0/+3
| | | | | | the header has different timestamp. llvm-svn: 130204
OpenPOWER on IntegriCloud