summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH
Commit message (Collapse)AuthorAgeFilesLines
...
* Patch for handling C99 veriadic macros when using precompiled headers,Douglas Gregor2012-06-292-0/+8
| | | | | | from Filipe Cabecinhas! llvm-svn: 159446
* Add the PCH file name to the message about not being able to read the PCH.Kaelyn Uhrain2012-06-203-0/+13
| | | | | | | | Also add a couple of unit tests to check the invalid-PCH error messages to satisfy PR4568 and for the assertion (introduced in r149918 and fixed in r158769) that would cause clang to crash when given an empty PCH. llvm-svn: 158772
* Explicitly build __builtin_va_list.Meador Inge2012-06-161-2/+0
| | | | | | | The target specific __builtin_va_list types are now explicitly built instead of injecting strings into the preprocessor input. llvm-svn: 158592
* PR13064: Store whether an in-class initializer uses direct or copyRichard Smith2012-06-101-0/+4
| | | | | | | initialization, and use that information to produce the right kind of initialization during template instantiation. llvm-svn: 158288
* Add pedantic warning -Wempty-translation-unit (C11 6.9p1).Jordan Rose2012-06-061-0/+27
| | | | | | | | | | | | | | | | | | | In standard C since C89, a 'translation-unit' is syntactically defined to have at least one "external-declaration", which is either a decl or a function definition. In Clang the latter gives us a declaration as well. The tricky bit about this warning is that our predefines can contain external declarations (__builtin_va_list and the 128-bit integer types). Therefore our AST parser now makes sure we have at least one declaration that doesn't come from the predefines buffer. Also, remove bogus warning about empty source files. This doesn't catch source files that only contain comments, and never fired anyway because of our predefines. PR12665 and <rdar://problem/9165548> llvm-svn: 158085
* Improve some of the conversion warnings to fire on conversion to bool.David Blaikie2012-05-151-1/+1
| | | | | | | | | | | Moves the bool bail-out down a little in SemaChecking - so now -Wnull-conversion and -Wliteral-conversion can fire when the target type is bool. Also improve the wording/details in the -Wliteral-conversion warning to match the -Wconstant-conversion. llvm-svn: 156826
* The Lexer constructor expects a source location at the start of theArgyrios Kyrtzidis2012-05-111-0/+18
| | | | | | | | file buffer, not at the start of lexing. Fixes assertion hit in format diagnostics. rdar://11418366 llvm-svn: 156647
* test/PCH/remap-file-from-pch.cpp: Fix expression for DOS pathsep.NAKAMURA Takumi2012-05-041-1/+1
| | | | llvm-svn: 156153
* [PCH] Really, pinky swear, fix for PR12689Argyrios Kyrtzidis2012-05-041-0/+14
| | | | | | rdar://11353109 llvm-svn: 156145
* [PCH] When validating that the files coming from PCH did not change, alsoArgyrios Kyrtzidis2012-05-033-0/+16
| | | | | | | | | | | validate that we didn't override the contents of any of such files. If this is detected, emit a diagnostic error and recover gracefully by using the contents of the original file that the PCH was built from. Part of rdar://11305263 llvm-svn: 156107
* [PCH] Clear switch case IDs when deserializing a objc method body.Argyrios Kyrtzidis2012-05-031-0/+16
| | | | | | Fixes rdar://11353109 & http://llvm.org/bugs/show_bug.cgi?id=12689 llvm-svn: 156056
* PR12585: When processing a friend template inside a class template, don'tRichard Smith2012-04-222-0/+20
| | | | | | | | pretend there was no previous declaration -- that can lead us to injecting a class template (with no access specifier) into a class scope. Instead, just avoid the problematic checks. llvm-svn: 155303
* Fix serialization of uninstantiated exception specifications. Patch by Li Kan,Richard Smith2012-04-211-0/+17
| | | | | | test by me. llvm-svn: 155289
* Implement the all_lookups_iterator for PCH as a follow-up to r153970. ThisNick Lewycky2012-04-161-0/+13
| | | | | | | | | | | includes a patch from Matthias Kleine with a regression testcase! Adds a new iterator 'data_iterator' to OnDiskHashTable which doesn't try to reconstruct the external_key from the internal_key, which is useful for traits that don't store enough information to do that mapping in their key. Also deletes the 'item_iterator' from OnDiskHashTable as dead code. llvm-svn: 154784
* Added a new attribute, objc_root_class, which informs the compiler when a ↵Patrick Beard2012-04-063-9/+9
| | | | | | | | | root class is intentionally declared. The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698> llvm-svn: 154187
* Enable warn_impcast_literal_float_to_integer by default.David Blaikie2012-04-051-1/+3
| | | | | | | | | | | | | | | | | This diagnostic seems to be production ready, it's just an oversight that it wasn't turned on by default. The test changes are a bit of a mixed bag. Some tests that seemed like they clearly didn't need to use this behavior have been modified not to use it. Others that I couldn't be sure about, I added the necessary expected-warnings to. It's possible the diagnostic message could be improved to make it clearer that this warning can be suppressed by using a value that won't lose precision when converted to the target type (but can still be a floating point literal, such as "bool b = 1.0;"). llvm-svn: 154068
* Eliminate obvious use-after-free. Fixes PR12433 / <rdar://problem/11168333>.Douglas Gregor2012-04-042-0/+11
| | | | llvm-svn: 153982
* Canonicalize the declaration we write to a PCH file for anDouglas Gregor2012-03-262-0/+16
| | | | | | | | InjectedClassNameType; otherwise, it won't be properly wired to the original (canonical) declaration when it is deserialized. Fixes <rdar://problem/11112464>. llvm-svn: 153442
* [PCH] When we are replacing a decl in a chained PCH that is also a DeclContext,Argyrios Kyrtzidis2012-03-221-0/+42
| | | | | | | | | make sure to fully load its external lexical and visible declarations before re-writing it. rdar://10914192 llvm-svn: 153254
* Instantiating a class template should not instantiate the definition of anyRichard Smith2012-03-141-0/+26
| | | | | | | | scoped enumeration members. Later uses of an enumeration temploid as a nested name specifier should cause its instantiation. Plus some groundwork for explicit specialization of member enumerations of class templates. llvm-svn: 152750
* AST representation for user-defined literals, plus just enough of semanticRichard Smith2012-03-071-0/+21
| | | | | | | | | | | | | | | | | | | | | analysis to make the AST representation testable. They are represented by a new UserDefinedLiteral AST node, which is a sugared CallExpr. All semantic properties, including full CodeGen support, are achieved for free by this representation. UserDefinedLiterals can never be dependent, so no custom instantiation behavior is required. They are mangled as if they were direct calls to the underlying literal operator. This matches g++'s apparent behavior (but not its actual mangling, which is broken for literal-operator-ids). User-defined *string* literals are now fully-operational, but the semantic analysis is quite hacky and needs more work. No other forms of user-defined literal are created yet, but the AST support for them is present. This patch committed after midnight because we had already hit the quota for new kinds of literal yesterday. llvm-svn: 152211
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-065-0/+224
| | | | | | | | | | | | | NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. llvm-svn: 152137
* [PCH] Include a darwin-only PCH test on Cocoa.h.Argyrios Kyrtzidis2012-02-281-0/+7
| | | | llvm-svn: 151668
* Teach CXXRecordDecl::hasIrrelevantDestructor to check the base classes andRichard Smith2012-02-252-0/+40
| | | | | | | | | data members for deleted or user-provided destructors. Now it's computed in advance, serialize it, and in passing fix all the other record DefinitionData flags whose serialization was missing. llvm-svn: 151441
* Implement a new type trait __is_trivially_constructible(T, Args...)Douglas Gregor2012-02-242-3/+11
| | | | | | | | | | | | | | | | that provides the behavior of the C++11 library trait std::is_trivially_constructible<T, Args...>, which can't be implemented purely as a library. Since __is_trivially_constructible can have zero or more arguments, I needed to add Yet Another Type Trait Expression Class, this one handling arbitrary arguments. The next step will be to migrate UnaryTypeTrait and BinaryTypeTrait over to this new, more general TypeTrait class. Fixes the Clang side of <rdar://problem/10895483> / PR12038. llvm-svn: 151352
* objective-c++: Type of an objc string literal is NSString, not 'id'.Fariborz Jahanian2012-02-231-1/+1
| | | | | | // rdar://10907410 llvm-svn: 151296
* Generate an AST for the conversion from a lambda closure type to aDouglas Gregor2012-02-221-0/+0
| | | | | | | | | | | | | | | block pointer that returns a block literal which captures (by copy) the lambda closure itself. Some aspects of the block literal are left unspecified, namely the capture variable (which doesn't actually exist) and the body (which will be filled in by IRgen because it can't be written as an AST). Because we're switching to this model, this patch also eliminates tracking the copy-initialization expression for the block capture of the conversion function, since that information is now embedded in the synthesized block literal. -1 side tables FTW. llvm-svn: 151131
* Deserialize the direct-initialization range of a "new" expressionDouglas Gregor2012-02-201-0/+27
| | | | | | | properly. Previously, we deserialized it but failed to set the corresponding member in CXXNewExpr. Fixes <rdar://problem/10893600>. llvm-svn: 150963
* Implicitly define a lambda's conversion functions (to functionDouglas Gregor2012-02-161-3/+10
| | | | | | | | | | | | | pointers and block pointers). We use dummy definitions to keep the invariant that an implicit, used definition has a body; IR generation will substitute the actual contents, since they can't be represented as C++. For the block pointer case, compute the copy-initialization needed to capture the lambda object in the block, which IR generation will need later. llvm-svn: 150645
* Simplify and robustify lambda PCH testDouglas Gregor2012-02-141-3/+1
| | | | llvm-svn: 150493
* Implement AST (de-)serialization for lambda expressions.Douglas Gregor2012-02-141-0/+43
| | | | llvm-svn: 150491
* Track whether a function type has a trailing return type as type sugar. Use thisRichard Smith2012-02-101-0/+15
| | | | | | | | | | | to pretty-print such function types better, and to fix a case where we were not instantiating templates in lexical order. In passing, move the Variadic bit from Type's bitfields to FunctionProtoType to get the Type bitfields down to 32 bits. Also ensure that we always substitute the return type of a function when substituting explicitly-specified arguments, since that can cause us to bail out with a SFINAE error before we hit a hard error in parameter substitution. llvm-svn: 150241
* [PCH] Add a PCH test.Argyrios Kyrtzidis2012-02-091-0/+35
| | | | llvm-svn: 150192
* rename -ccc-host-triple into -targetSebastian Pop2012-01-201-3/+3
| | | | llvm-svn: 148582
* Revert r148138; it's causing test failures.Eli Friedman2012-01-131-3/+3
| | | | llvm-svn: 148141
* rename -ccc-host-triple into -targetSebastian Pop2012-01-131-3/+3
| | | | llvm-svn: 148138
* C++ constant expression handling: eagerly instantiate static const integral dataRichard Smith2011-12-211-1/+6
| | | | | | | | members of class templates so that their values can be used in ICEs. This required reverting r105465, to get such instantiated members to be included in serialized ASTs. llvm-svn: 147023
* objc-arc: bridge casts in non-arc mode are nowFariborz Jahanian2011-12-191-2/+8
| | | | | | error. // rdar://10597832 llvm-svn: 146918
* constexpr handling improvements. Produce detailed diagnostics when a 'constexpr'Richard Smith2011-12-191-0/+19
| | | | | | | | | | | | | | | | | | | | | variable is initialized by a non-constant expression, and pass in the variable being declared so that earlier-initialized fields' values can be used. Rearrange VarDecl init evaluation to make this possible, and in so doing fix a long-standing issue in our C++ constant expression handling, where we would mishandle cases like: extern const int a; const int n = a; const int a = 5; int arr[n]; Here, n is not initialized by a constant expression, so can't be used in an ICE, even though the initialization expression would be an ICE if it appeared later in the TU. This requires computing whether the initializer is an ICE eagerly, and saving that information in PCH files. llvm-svn: 146856
* Completely re-implement (de-)serialization of declarationDouglas Gregor2011-12-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | chains. The previous implementation relied heavily on the declaration chain being stored as a (circular) linked list on disk, as it is in memory. However, when deserializing from multiple modules, the different chains could get mixed up, leading to broken declaration chains. The new solution keeps track of the first and last declarations in the chain for each module file. When we load a declaration, we search all of the module files for redeclarations of that declaration, then splice together all of the lists into a coherent whole (along with any redeclarations that were actually parsed). As a drive-by fix, (de-)serialize the redeclaration chains of TypedefNameDecls, which had somehow gotten missed previously. Add a test of this serialization. This new scheme creates a redeclaration table that is fairly large in the PCH file (on the order of 400k for Cocoa.h's 12MB PCH file). The table is mmap'd in and searched via a binary search, but it's still quite large. A future tweak will eliminate entries for declarations that have no redeclarations anywhere, and should drastically reduce the size of this table. llvm-svn: 146841
* [PCH] Remove extraneous line in the test that was mistakenly copied.Argyrios Kyrtzidis2011-12-171-2/+0
| | | | | | No functionality change. llvm-svn: 146825
* [PCH] Fix bug where we failed to update an identifier for a single tokenArgyrios Kyrtzidis2011-12-171-0/+26
| | | | | | | | macro expansion. rdar://10588825 llvm-svn: 146818
* Modify how the -verify flag works. Currently, the verification string andRichard Trieu2011-12-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic message are compared. If either is a substring of the other, then no error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}} will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parameters It will also match these other error messages: candidate function function has different number of parameters number of parameters This patch will change so that the verification string must be a substring of the diagnostic message before accepting. Also, all the failing tests from this change have been corrected. Some stats from this cleanup: 87 - removed extra spaces around verification strings 70 - wording updates to diagnostics 40 - extra leading or trailing characters (typos, unmatched parens or quotes) 35 - diagnostic level was included (error:, warning:, or note:) 18 - flag name put in the warning (-Wprotocol) llvm-svn: 146619
* [PCH] In ASTReader::FinishedDeserializing, after we do ↵Argyrios Kyrtzidis2011-11-301-0/+33
| | | | | | | | | | | | | PassInterestingDeclsToConsumer we may end up having added more pending stuff to do, so go in a loop until everything is cleared out. This fixes the error in rdar://10278815 which has a certain David Lynch-esque quality.. error: unknown type name 'BOOL'; did you mean 'BOOL'? llvm-svn: 145536
* [PCH] When serializing an PseudoObjectExpr or AtomicExpr, the serialization ↵Argyrios Kyrtzidis2011-11-151-0/+8
| | | | | | | | code must be set otherwise it will crash with asserts on or it will be written as null pointer. llvm-svn: 144626
* [PCH] Do not crash if a class extension in a chained PCH ↵Argyrios Kyrtzidis2011-11-141-0/+13
| | | | | | introduces/redeclares a property. llvm-svn: 144520
* [PCH] Fix the test.Argyrios Kyrtzidis2011-11-121-2/+2
| | | | llvm-svn: 144467
* [PCH] When completing an objc forward reference, do not serialize the chain ↵Argyrios Kyrtzidis2011-11-121-0/+44
| | | | | | | | | | | | | | | of its categories because it is going to be rewritten (and the chain will be serialized again), otherwise we may form a cycle in its categories list when deserializing. Also introduce ASTMutationListener::CompletedObjCForwardRef to notify that a forward reference was completed; using Decl's isChangedSinceDeserialization/setChangedSinceDeserialization is bug inducing and kinda gross, we should phase it out. Fixes infinite loop in rdar://10418538. llvm-svn: 144465
* This test was assuming that /usr/include was in the system header searchChandler Carruth2011-11-061-5/+5
| | | | | | | | path. That assumption should never have been true, but it was until I fixed it. Now that its fixed, add a triple here to get correct behavior even on Windows. llvm-svn: 143863
* Switch these two tests to use the Clang driver instead of CC1. They wantChandler Carruth2011-11-051-3/+3
| | | | | | | | to do "realistic" includes, and so need the header search logic now in the driver. This in turn requires switching the CC1 options to the actual driver options, and passing -Xclang where there is no analogy. llvm-svn: 143805
OpenPOWER on IntegriCloud